jfrog / jfrog-vscode-extension

JFrog VS-Code Extension
https://jfrog.github.io/jfrog-vscode-extension
Apache License 2.0
188 stars 32 forks source link

Programmatically setup JFrog Extension #46

Closed paulmowat closed 4 years ago

paulmowat commented 4 years ago

Hi,

I'm looking at creating a cli that sets up my developers workstations. i.e. installing and configuring default extensions etc.

Is there a way to programmatically setup the jFrog credentials rather than going via the connect button?

Also when asking for username/password. If your using a identity provider like github for access what would you enter?

Thanks

Paul

eyalbe4 commented 4 years ago

@paulmowat, The JFrog VS Code Extension stores the credentials through the operating system's key storage service. We are planning to also add an option for reading the connection details from environment variables. If you'd like to help us deliver this functionality faster, you are moire than welcome to contribute this functionality to the extension through a pull request.

yahavi commented 4 years ago

@paulmowat, Thank you for using JFrog VS-Code extension! To speed things up, I created this PR. With that, you will be able to reach your goal in 2 steps:

  1. Export JFROG_IDE_URL, JFROG_IDE_USERNAME, and JFROG_IDE_PASSWORD environment variables.
  2. Install JFrog VS-Code extension by the command line or by the UI. The credentials will automatically be saved in the file system. Xray URL and username will be stored in global VS-Code storage. The password will be stored in the operating system's key storage service. For security reasons, you may be requested to prompt user's password once. I believe that there are ways to avoid this prompt once, depending on the OS.

Please let us know if this solution is acceptable for you.

paulmowat commented 4 years ago

@yahavi Thanks for the quick turnaround on the changes. Yes this solution should work perfectly for us.

The goal is to write a bash script to install the extensions so could prompt user to enter the values as required, set them as env variables and then install the extension.

yahavi commented 4 years ago

Thanks, @paulmowat! We added 4 environment variables as described in this section: JFROG_IDE_URL, JFROG_IDE_USERNAME, JFROG_IDE_PASSWORD and JFROG_IDE_STORE_CONNECTION. In that case, you'll need to set JFROG_IDE_STORE_CONNECTION to true.

This feature will be introduced in the next release. We'll keep you updated.

yahavi commented 4 years ago

@paulmowat JFrog VS-Code extension 1.4.0 is released. This version includes enhanced Maven experience and your requested feature.

See release note here: https://github.com/jfrog/jfrog-vscode-extension/releases/tag/1.4.0

We'll appreciate your feedback for that.