Skip to content

Commit 9b03cf7

Browse files
authored
docs: fix access token config to show correct nested JSON structure (#1741)
1 parent b753c18 commit 9b03cf7

1 file changed

Lines changed: 21 additions & 9 deletions

File tree

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
# Managing access tokens
22

3-
The `auth.accessTokens` setting in Sourcegraph's site configuration allows admins to fine-tune parameters related to access tokens.
3+
The `auth.accessTokens` setting in Sourcegraph's site configuration allows admins to fine-tune parameters related to access tokens:
4+
5+
```json
6+
{
7+
"auth.accessTokens": {
8+
"allow": "all-users-create",
9+
"allowNoExpiration": false,
10+
"maxTokensPerUser": 25,
11+
"expirationOptionDays": [7, 14, 30, 60, 90],
12+
"defaultExpirationDays": 90
13+
}
14+
}
15+
```
416

517
## Access token creation
618

7-
The `auth.accessTokens.allow` configuration field permits or restricts the creation of access tokens. It can be assigned one of three values: "none," "all-users-create" (which is the default option), or "site-admin-create.”
19+
The `allow` property permits or restricts the use of access tokens. It can be assigned one of three values:
820

9-
- `none` Disables the creation of access tokens.
10-
- `all-users-create` Allows users to create their own token.
11-
- `site-admin-create` Allows site admins to create tokens for users.
21+
- `all-users-create` (default) Enables all users to create access tokens.
22+
- `site-admin-create` Restricts creation of new tokens to admin users (existing tokens will still work until revoked).
23+
- `none` Disables access tokens entirely.
1224

13-
`auth.accessTokens.maxTokensPerUser` - This config field determines the maximum number of active access tokens a user can have. The default maximum is 25 tokens.
25+
The `maxTokensPerUser` property determines the maximum number of active access tokens a user can have. The default maximum is 25 tokens.
1426

1527
## Access token expiration
1628

1729
Admins can set expiration policies for access tokens. After this specified period, tokens will automatically lose their access. Note that tokens created before version 5.3 do not expire; this policy only applies to **new** tokens.
1830

19-
`auth.accessTokens.allowNoExpiration` - This controls whether tokens can be created with no expiration date. The default setting is false.
31+
`allowNoExpiration` - Controls whether tokens can be created with no expiration date. The default setting is false.
2032

21-
`auth.accessTokens.expirationOptionDays` - This represents the options users are presented with for the token expiration period. The default options are [7, 14, 30, 60, 90].
33+
`expirationOptionDays` - The options users are presented with for the token expiration period. The default options are [7, 14, 30, 60, 90].
2234

23-
`auth.accessTokens.defaultExpirationDays` - This sets the default duration selection when creating a new access token. The default is 90 days.
35+
`defaultExpirationDays` - The default duration selection when creating a new access token. The default is 90 days.

0 commit comments

Comments
 (0)