jfrog / jfrog-cli

JFrog CLI is a client that provides a simple interface that automates access to the JFrog products.
https://www.jfrog.com/confluence/display/CLI/JFrog+CLI
Apache License 2.0
529 stars 223 forks source link

Support anonymous downloading? #209

Closed LeiYangGH closed 6 years ago

LeiYangGH commented 6 years ago

Hi I'm using 1.19.0, and using in some continuous integration(bamboo plan). My artifactory server supports anonymous downloading(for some directories I think, but that's enough, and the administrator did not give us any user name or password, and I didn't see anywhere in the webapp/#/login page to create a personal account). Downloading by browser manually is OK.

But jfrog cli seems require user name and password.

  1. if not configure, then when downloading, jfrog will say JFrog CLI with these parameters now will save you having to include them as command options. You can also configure these parameters later using the 'config' command. Configure now? (y/n): and above words will wait user input, which means my CI plan will hang.

  2. if I try to configure with empty password, seems it will automatically ignore: [root@localhost cp2vm]# ./jfrog rt c golden --url="https://aac-srv-artifactory.mycompany.com/" --user="" --password="" User: it will prompt interactively again.

  3. if I try to configure with random password: _[root@localhost cp2vm]# ./jfrog rt c golden \

    --url="https://aac-srv-artifactory.mycompany.com/" \ --user="x" \ --password="y" [Info] Encrypting password... [Error] Get https://aac-srv-artifactory.nuance.com/api/security/encryptedPassword: EOF_

So what to do to support anonymous downloading?

eyalbe4 commented 6 years ago

@LeiYangGH, JFrog CLI uses AQL to find artifacts in Artifactory for most commands. AQL cannot currently be used without authenticating with Artifactory. That's why anonymous access is currently not allowed in JFrog CLI.

asaddamhussain commented 5 years ago

@eyalbe4

It is understood that Artifactory Query Language doesn't support anonymous access. But when artifactory Rest APIs supports some limited operations, Why cannot the anonymous request alone from jfrog-cli is redirected to artfiactory Rest APIs instead of artfiactory AQL instead of returning error?

eyalbe4 commented 5 years ago

@asaddamhussain, How would you suggest JFrog CLI support downloading multiple files (using patterns), without running an AQL search to find the matching files in Artifactory?

asaddamhussain commented 5 years ago

@eyalbe4 Sorry for the delayed reply.

Note: the following API does support anonymous requests.

1) GET /api/storage/{repoKey}/{folder-path} can be used get folder information along with its child(files and folders). Child folder can be recursively called with above API to get further information to dig further. Finally, you get all the files and folders in a given folder artifact. If you want to support patterns, it can also be done based on the list of files and folder you get before you start downloading.

2) As far I know before 2 years, above API will not list files or folder when not cached in remote repository/virtual repository, But this can be overcome by listing the information directly through native browser URL of the artifact instead of Rest API call. GET /repo/{folder/file-path}

3) Even Quick search(Other searches as well) API from artifactory support anonymous requests that support patters by default.

Thanks!