-
Notifications
You must be signed in to change notification settings - Fork 70
Add jit access endpoint support in the cli #554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+57
−0
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to pass a
hostproperty to tell the proxy which hosts can use JIT. The propertyusernameis not used for JIT access, the request is authenticated using the job token, so this property can be removed.Also I wanted to mention this is already possible to do without environment variables by specifying a jit_access credential in the job definition passed to Dependabot CLI using the
-fflag:$ dependabot update -f job.jsonor
$ dependabot update -f job.ymlThe definition would be something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for catching the missing host! Fixing that and removing
username.Yes! I used that
-fflag to test this locally for proof of concept but on ADO Dependabot, it looks like we are passing credentials through env variables and we construct the credentials input in the CLI (in this file) so Im thinking to just use the same approach here. The jit_access endpoint value here will be unique to each jobs we run. Are you suggesting to prepopulate thejit_accesscredential type in the input before we call the CLI? That might work too, I'll have to take another look on our service.During my test, I have two credential type in my job file -- one with github token and one for jit_access. This is how it looks like and what I'm attempting to add here!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update: I think I found the place where I can insert credentials in our job definition before calling the CLI! I'll work on that first, if it works out then I wont need to pass a new env var anymore
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it's best to put it all in the job definition. We started using environment variables as a convenience running on our local machines because we had $LOCAL_GITHUB_ACCESS_TOKEN set already, makes it easier to run jobs with the short-hand
dependabot update go_modules dependabot/cli, but for production it's best to provide the full job and credentials in a file.