docs: document required API token scopes for Socket Basics#68
docs: document required API token scopes for Socket Basics#68David Larsen (dc-larsen) wants to merge 1 commit intomainfrom
Conversation
| | `socket-basics` | Loading scanner configuration from the Socket Dashboard | | ||
| | `full-scans` | Submitting scan results to your organization | | ||
|
|
||
| If your token is missing the `socket-basics` scope, you will see `Insufficient permissions` when Socket Basics tries to load dashboard config. As a workaround, set `SOCKET_ORG` explicitly in your workflow to skip the dashboard config load and run with CLI/environment configuration only. |
There was a problem hiding this comment.
"tries to load dashboard config", and why this workaround is needed is not super clear. We can probably highlight the breakdown a bit differently. Maybe something like this? Or, alternatively, should we just say that socket-basics is needed no matter what to simplify things?
If the Socket dashboard has been used to configure Socket Basics the socket-basics scope is required. If missing, a Insufficient permissions error will occur.
If Socket Basics is configured via CLI or environment files, only full-scans permissions are required. Note, this does require setting the SOCKET_ORG field appropriately.
|
|
||
| ### Required API Token Scopes | ||
|
|
||
| Create your `SOCKET_SECURITY_API_KEY` in the Socket Dashboard under **Settings → API Tokens**. Socket Basics needs the following scopes: |
There was a problem hiding this comment.
Is there a shortcut link we can include that takes customers directly to the API creation page for convenience? or will this not work as the URI would be org-slug-specific?
Summary
Document the minimum Socket API token scopes required for Socket Basics. Customers consistently hit
Insufficient permissionserrors when their token is missing thesocket-basicsscope, and there's no current guidance in the README on which scopes to grant when creating a token.What scopes does Socket Basics actually need?
Verified against
api.socket.dev/v0by testing each endpoint Socket Basics calls with tokens of varying scope:sdk.org.get()sdk.basics.get_config()sdk.fullscans.post()socket-basicsonlysocket-basics+full-scansfull-scans+reposocket-basics+full-scans+repoThe
reposcope is not needed —/full-scanscreates the repo implicitly when the named repo doesn't exist yet.Changes
Insufficient permissions.Test plan
sdk.org.get,sdk.basics.get_config,sdk.fullscans.post).#required-api-token-scopesresolves.