Skip to content

Commit b2016e9

Browse files
Updated documentation
1 parent 57d7914 commit b2016e9

2 files changed

Lines changed: 25 additions & 6 deletions

File tree

DOCS/features/access-authentication-and-session-controls/user-profile-and-tokens.mdx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ The **Profile Overview** card presents user details in a condensed grid so they
2323

2424
The **API Tokens** card is for user-bound automation tokens. API tokens authenticate as your user account and inherit your current Ghostwriter permissions. Use API tokens when automation should do exactly what your user account can do.
2525

26-
API tokens are opaque `gwat_` credentials. They are not JWTs, and Ghostwriter stores only a hash of the token secret. The full token value is shown once when you create a token or save an expiry update.
26+
API tokens are opaque `gwat_` credentials. They are not JWTs, and Ghostwriter stores only a hash of the token secret. The full token value is shown once when you create or regenerate a token.
2727

2828
Ghostwriter records an API token's last-used timestamp when the token authenticates. Updates are throttled to avoid writing on every request, so a recently active token may show the latest tracked interval instead of the exact most recent request time.
2929

@@ -34,11 +34,19 @@ The API token card lets you:
3434
* create a new API token with an expiration date
3535
* review existing tokens
3636
* view token details, including current project access for the token's user
37-
* edit a token's expiration date and receive a replacement token
37+
* edit a token's expiration date
38+
* regenerate a token without changing its expiration date
3839
* revoke tokens you no longer need
3940
* hide expired tokens from the table
4041

41-
Tokens expiring within seven days use the warning color. Expired tokens use the expired color. The **Hide Expired** preference is saved in your browser's local storage so the same browser remembers your choice.
42+
Tokens expiring within seven days use the warning color. Expired tokens use the expired color. The **Hide Expired** preference is saved in your browser's local
43+
storage so the same browser remembers your choice.
44+
45+
Token expiration changes follow the server's General Settings. New tokens and expiry edits cannot exceed the configured maximum lifetime, which defaults to
46+
365 days from the time of the change. Existing tokens that already exceed a newly lowered maximum are not changed automatically, but they cannot be extended
47+
beyond the active policy. Shortening a token's expiry updates the existing credential in place. Extending a token's expiry either updates the existing credential
48+
or rotates it immediately, depending on whether administrators require rotation for expiry extensions. Expired tokens cannot be regenerated until their expiry is
49+
extended. If administrators do not require rotation for expiry extensions, regenerate the token after extending expiry to rotate the credential.
4250

4351
## Service Tokens
4452

@@ -68,11 +76,12 @@ The service token card lets you:
6876
* choose or create a reusable service principal
6977
* select the token scope
7078
* review existing service tokens
79+
* regenerate a service token without changing its expiration date or scope
7180
* revoke tokens you no longer need
7281
* hide expired tokens from the table
7382

7483
Service-token expiration styling and the **Hide Expired** browser preference work the same way as API tokens.
7584

7685
<Warning>
77-
Store newly created API tokens and service tokens immediately. Ghostwriter only shows the token value once.
86+
Store newly created and regenerated API tokens and service tokens immediately. Ghostwriter only shows the token value once. Revocation and regeneration invalidate the previous credential immediately.
7887
</Warning>

DOCS/features/graphql-api/authentication.mdx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ The `Login` action is disabled for accounts with MFA configured. An account with
7777
### API Tokens
7878

7979
You can also generate API tokens by visiting your profile page and using the **API Tokens** card. In this section, you
80-
can create new tokens, see all existing tokens, hide expired tokens, and revoke tokens you no longer need.
80+
can create new tokens, see all existing tokens, edit expiry dates, regenerate tokens, hide expired tokens, and revoke
81+
tokens you no longer need.
8182

8283
API tokens are opaque tokens with a `gwat_` prefix. They are not JWTs and do not contain a readable payload. Ghostwriter
8384
stores a hash of the token secret and validates the database record on each request so tokens can be revoked immediately.
@@ -87,6 +88,15 @@ request.
8788
API tokens have user-defined expiration dates. They are intended for automation tasks that should inherit the current
8889
permissions of the user who created the token.
8990

91+
General Settings control token lifecycle policy for both user tokens and service tokens. New tokens and expiry edits cannot
92+
exceed the configured maximum lifetime, which defaults to 365 days. Existing tokens that already exceed a lowered maximum
93+
are not shortened automatically, but they cannot be extended beyond the active policy.
94+
95+
Shortening expiry updates the same credential in place. Extending expiry rotates the credential but administrators can disable
96+
forced rotation for expiry extensions. Regenerating or revoking a token invalidates the previous credential immediately. Expired
97+
tokens must have expiry extended before regeneration. If administrators do not require rotation for expiry extensions, regenerate
98+
the token after extending expiry to rotate the credential.
99+
90100
<CodeGroup>
91101
```plaintext Example Token
92102
gwat_a0f02f188578a48b_ERJdqkkqz8U3Ny9cItiHT-1k62Ed4fNPPJ2LbjAVWH4
@@ -111,7 +121,7 @@ required project-read grant.
111121

112122
These tokens are not JWTs. They are opaque tokens with a `gwst_` prefix for easy identification. Opaque tokens do not include
113123
a payload that describes a user or permission set. Rather, they are backed by a database entry that controls their permission
114-
set.
124+
set. Service tokens follow the same maximum lifetime, expiry-edit, regeneration, and revocation policy as API tokens.
115125

116126
<CodeGroup>
117127
```plaintext Example Token

0 commit comments

Comments
 (0)