Uh oh!
There was an error while loading. Please reload this page.
Sourcegraph - Update AccessToken schema - #593
Conversation
scottisloud
left a comment
There was a problem hiding this comment.
Thanks for updating the Sourcegraph plugin schema and for the detailed manual test steps — the URL updates and making Endpoint required look right for how src authenticates today.
A few things I'd like to see before we merge, non-blocking, but ideally polish up if you deem it worthwhile:
- Token charset: Sourcegraph access tokens are hex-based and often include uppercase
A–F(for examplesgp_AaD80dc6E02eCAE1_d3cba16CC0F18fA14A2EFB61CbDFceEBf9fAD16b). The token field composition should includeUppercase: truein the charset, similar toplugins/github/personal_access_token.go. - Token length:
Length: 60doesn't match the current v3 format (sgp_{16hex}_{40hex}, 61 characters total). Legacy tokens (sgp_{40hex}) are shorter. I'd drop the fixed length and rely onPrefix: "sgp_"plus the hex charset, or pick a length that matches the format you're targeting. - Tests:
access_token_test.gostill uses a pre-sgp_fixture. Please update the test token to a realisticsgp_-prefixed value so the tests match the schema.
nit: spacing in AlternativeNames: []string{"Website","URL"} for gofmt.
Could you also confirm make sourcegraph/validate and go test ./plugins/sourcegraph/... pass locally? I only see the signed-commits check on the PR so far.
Happy to take another look after those updates/you indicate no intent to make those optional updates.
(forgot to do this as a proper Review the first time 🤦 )
Overview
Updated the schema, and doc links
Type of change
Related Issue(s)
How To Test
op plugin init srcLocate your Sourcegraph Access Token:Import into 1Password...Enter or paste in the value of the Endpoint: Paste inhttps://sourcegraph.comEnter or paste in the value of the Token: Paste in the access token created earliersrc loginEntry created in 1Password desktop app:

Changelog
Updated plugin for Sourcegraph src-cli with new access token format, and made Endpoint a required field, as each Token is unique to a specific Endpoint.