This repository was archived by the owner on Sep 30, 2024. It is now read-only.
feat(sg): add command to generate a dotcom user gateway access token#63125
Merged
janhartman merged 5 commits intomainfrom Jun 7, 2024
Merged
feat(sg): add command to generate a dotcom user gateway access token#63125janhartman merged 5 commits intomainfrom
janhartman merged 5 commits intomainfrom
Conversation
burmudar
reviewed
Jun 6, 2024
burmudar
reviewed
Jun 6, 2024
burmudar
reviewed
Jun 6, 2024
dev/sg/sg_gen_access_token.go
Outdated
| ) | ||
|
|
||
| func genGatewayAccessTokenExec(c *cli.Context) error { | ||
| accessToken, err := accesstoken.GenerateDotcomUserGatewayAccessToken(c.Args().Get(0)) |
Contributor
There was a problem hiding this comment.
Suggested change
| accessToken, err := accesstoken.GenerateDotcomUserGatewayAccessToken(c.Args().Get(0)) | |
| // we use the current binary name (ie. `sg`) as the token prefix since that is required for the token to be generated | |
| tokenPrefix := c.Args().Get(0) | |
| accessToken, err := accesstoken.GenerateDotcomUserGatewayAccessToken(tokenPrefix) |
Contributor
Author
There was a problem hiding this comment.
That's not the token prefix though - inside the 0-th arg we have the full sgp_local token.
burmudar
suggested changes
Jun 6, 2024
Contributor
burmudar
left a comment
There was a problem hiding this comment.
Thanks for adding this!
Few small comments!
rafax
reviewed
Jun 6, 2024
rafax
approved these changes
Jun 6, 2024
Contributor
|
@janhartman added some improvements here https://github.com/sourcegraph/sourcegraph/pull/63149 |
This reverts commit fc5553c.
Add some messaging around generating a token as well as when arguments are missing ## Test plan Tested locally ## Changelog
Contributor
Author
|
@burmudar mind approving so we can merge? |
burmudar
approved these changes
Jun 7, 2024
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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
We can now generate gateway access tokens from sg instead of having to manually wrangle a script to do it every time. This will help with making Cody Gateway easier to run locally.
Test plan
Tested locally.