Repository navigation
Document explicit permissions in the Sourcegraph API - #2083
taras-yemets wants to merge 9 commits into
Conversation
The explicit permissions page only described the GraphQL API, even though Sourcegraph 7.4 added explicit repository permissions to the Sourcegraph API (explicitrepopermissions.v1.Service).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Direct preview links to pages changed in this PR: |
This comment has been minimized.
This comment has been minimized.
| The Sourcegraph API identifies repositories by numeric ID and cannot look them up by name yet. Get the ID with the [GraphQL API](/api/graphql): | ||
|
|
||
| ```graphql | ||
| query { | ||
| repository(name: "github.example.com/owner/repo") { | ||
| databaseID | ||
| } | ||
| } | ||
| ``` |
There was a problem hiding this comment.
That we have to document this, feels like a product gap 👀 Users shouldn't have to switch back and forth between the two
|
We should also remove the GraphQL API docs for this |
@bobheadxi before we do, we should build https://linear.app/sourcegraph/issue/SVC-2428/explicit-permissions-rest-api-for-lists-of-users-and-or-repos the new API endpoint to take in lists of repos and users, so we don’t need to overload both API client and server with individual requests for each user + repo pair. |
|
@marcleblanc2 agreed, this should be usable without jumping between GraphQL and the external API, @taras-yemets is looking into the gaps with @pjlast |
The explicit permissions page only documented the GraphQL API. It now points to the Sourcegraph API (
explicitrepopermissions.v1.Service) to grant, revoke, check, and list explicit permissions, with the required token scopes andREPO_PERMISSIONSpermission, how to get a repository's numeric ID, and a link to/api-referencefor request examples and schemas. The GraphQL sections stay as they were for what the Sourcegraph API doesn't support yet, with a note thatsetRepositoryPermissionsForUsersalso removes permissions granted with the Sourcegraph API. The authentication and service accounts pages point to the Sourcegraph API too.Closes SVC-2607
Companion PR: sourcegraph/sourcegraph#16836
Supersedes #1785