Skip to content

Commit 585b88a

Browse files
authored
docs: update credential storage docs and remove stale config.json references (#408)
## Summary Auth credentials were migrated to SQLite (`cli.db`) but docs and code comments still referenced `~/.sentry/config.json`. This updates everything to match reality: - Rewrites the auth command docs "Credential Storage" section to note that credentials live in `cli.db` with restricted permissions, and points users to `sentry auth token` / `sentry auth status` instead of exposing the internal schema - Updates the configuration page's credential storage section to name `cli.db`, mention WAL permissions, and link to the auth docs - Removes DB schema details (column/type table), `sqlite3` query examples, and "Direct Database Access" subsection — users shouldn't read the DB directly - Removes sqlite3 examples from the SKILL.md agent skill file - Fixes three stale comments/strings in `logout.ts`, `oauth.ts`, and `dsn/types.ts` ## Test Plan - `bun run typecheck` — passes (pre-existing trial module errors only) - `bun run lint` — clean - `bun run test:unit` — no new failures - Verified no `sqlite3` or schema content remains in docs
1 parent 84d2812 commit 585b88a

File tree

5 files changed

+18
-16
lines changed

5 files changed

+18
-16
lines changed

docs/src/content/docs/commands/auth.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -84,18 +84,18 @@ sentry auth refresh
8484

8585
This is typically handled automatically when tokens expire.
8686

87-
## Configuration
87+
## Credential Storage
8888

89-
Credentials are stored in `~/.sentry/config.json` with restricted file permissions (mode 600).
89+
Credentials are stored in a SQLite database at `~/.sentry/cli.db` with restricted file permissions (mode 600).
9090

91-
**Config structure:**
91+
Use `sentry auth token` to retrieve your current access token, or `sentry auth status` to check authentication state.
9292

93-
```json
94-
{
95-
"auth": {
96-
"token": "...",
97-
"refreshToken": "...",
98-
"expiresAt": "2024-12-31T00:00:00Z"
99-
}
100-
}
101-
```
93+
### Environment Variable Precedence
94+
95+
The CLI checks for auth tokens in the following order, using the first one found:
96+
97+
1. `SENTRY_AUTH_TOKEN` environment variable (legacy)
98+
2. `SENTRY_TOKEN` environment variable
99+
3. The stored token in the SQLite database
100+
101+
When a token comes from an environment variable, the CLI skips expiry checks and automatic refresh.

docs/src/content/docs/configuration.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,11 @@ The `sentry api` command also uses `--verbose` to show full HTTP request/respons
144144

145145
## Credential Storage
146146

147-
Credentials are stored in a SQLite database at `~/.sentry/` (or the path set by `SENTRY_CONFIG_DIR`) with restricted file permissions (mode 600) for security. The database also caches:
147+
We store credentials and caches in a SQLite database (`cli.db`) inside the config directory (`~/.sentry/` by default, overridable via `SENTRY_CONFIG_DIR`). The database file and its WAL side-files are created with restricted permissions (mode 600) so that only the current user can read them. The database also caches:
148148

149149
- Organization and project defaults
150150
- DSN resolution results
151151
- Region URL mappings
152152
- Project aliases (for monorepo support)
153+
154+
See [Credential Storage](./commands/auth/#credential-storage) in the auth command docs for more details.

src/commands/auth/logout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export const logoutCommand = buildCommand({
3030
docs: {
3131
brief: "Log out of Sentry",
3232
fullDescription:
33-
"Remove stored authentication credentials from the configuration file.",
33+
"Remove stored authentication credentials from the local database.",
3434
},
3535
output: { json: true, human: formatLogoutResult },
3636
parameters: {

src/lib/dsn/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ export type ResolvedProject = ResolvedProjectInfo & {
6666
/**
6767
* Cached DSN entry with full resolution info
6868
*
69-
* Stored in ~/.sentry/config.json under dsnCache[directory]
69+
* Stored in ~/.sentry/cli.db in the dsn_cache table
7070
*/
7171
export type CachedDsnEntry = {
7272
/** The raw DSN string */

src/lib/oauth.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@ export async function performDeviceFlow(
302302
}
303303

304304
/**
305-
* Complete the OAuth flow by storing the token in the config file.
305+
* Complete the OAuth flow by storing the token in the database.
306306
*
307307
* @param tokenResponse - The token response from performDeviceFlow
308308
*/

0 commit comments

Comments
 (0)