detached 7c8965b

docs: update auth CLI docs for token exchange and new commands

commit
7c8965b70a51a5da55cb738181d098be415dca34
author
brice · · 2026-03-22 20:13 UTC
parent
16515bf
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
2 files · +50 -9
M docs/cli/auth.md +45 -8
@@ -8,7 +8,10 @@ Manage Gordon server authentication tokens.
88
99 | Subcommand | Description |
1010 |------------|-------------|
11-| `login` | Authenticate with a remote Gordon server |
11+| `login` | Store a token for a remote Gordon server |
12+| `show-token` | Print the stored token for a remote |
13+| `logout` | Remove stored token for a remote |
14+| `status` | Check authentication session status |
1215 | `token generate` | Generate a new JWT token |
1316 | `token list` | List all stored tokens |
1417 | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) |
@@ -18,32 +21,31 @@ Manage Gordon server authentication tokens.
1821
1922 ## gordon auth login
2023
21-Authenticate with a remote Gordon server using a pre-generated token.
24+Store a pre-generated token for a remote Gordon server.
2225
2326 ```bash
24-gordon auth login [options]
27+gordon auth login --token <token> [options]
2528 ```
2629
2730 ### Options
2831
2932 | Option | Description |
3033 |--------|-------------|
34+| `-t, --token` | **Required.** Authentication token to store |
3135 | `-r, --remote` | Remote to authenticate with (defaults to active remote) |
32-| `-t, --token` | Authentication token to store for the remote |
3336
3437 ### Description
3538
36-This command stores a pre-generated token for use with a remote Gordon server. When [pass](https://www.passwordstore.org/) is available, the token is stored encrypted at `gordon/remotes/<name>/token` and any plaintext token fields are cleared from `remotes.toml`. When `pass` is unavailable, the token is stored in plaintext in `remotes.toml` with a warning.
39+Stores a token for use with a remote Gordon server. The `--token` flag is required — generate a token on the server with `gordon auth token generate`.
40+
41+When [pass](https://www.passwordstore.org/) is available, the token is stored encrypted at `gordon/remotes/<name>/token` and plaintext fields are cleared from `remotes.toml`. When `pass` is unavailable, the token is stored in plaintext with a warning.
3742
3843 The token is verified against `/admin/status` on a best-effort basis.
3944
4045 ### Examples
4146
4247 ```bash
43-# Store a token for the active remote
4448 gordon auth login --token <token>
45-
46-# Store a token for a specific remote
4749 gordon auth login --remote prod --token <token>
4850 ```
4951
@@ -64,6 +66,41 @@ Token stored for remote 'prod'
6466
6567 ---
6668
69+## gordon auth show-token
70+
71+Print the stored token for a remote.
72+
73+```bash
74+gordon auth show-token [--remote <name>]
75+```
76+
77+Output is the raw token string, suitable for piping. Returns an error if no token is stored.
78+
79+```bash
80+gordon auth show-token
81+gordon auth show-token --remote prod
82+gordon auth show-token | pbcopy # copy to clipboard
83+```
84+
85+---
86+
87+## gordon auth logout
88+
89+Remove the stored token for a remote.
90+
91+```bash
92+gordon auth logout [--remote <name>] [--revoke]
93+```
94+
95+| Option | Description |
96+|--------|-------------|
97+| `-r, --remote` | Remote to log out from (defaults to active remote) |
98+| `--revoke` | Also revoke the token server-side (not yet implemented) |
99+
100+Deletes the token from pass and clears token fields in `remotes.toml`.
101+
102+---
103+
67104 ## gordon auth token generate
68105
69106 Generate a new JWT authentication token for registry access.
@@ -8,7 +8,10 @@ Manage Gordon server authentication tokens.
8 8
9 | Subcommand | Description |9 | Subcommand | Description |
10 |------------|-------------|10 |------------|-------------|
11-| `login` | Authenticate with a remote Gordon server |11+| `login` | Store a token for a remote Gordon server |
12+| `show-token` | Print the stored token for a remote |
13+| `logout` | Remove stored token for a remote |
14+| `status` | Check authentication session status |
12 | `token generate` | Generate a new JWT token |15 | `token generate` | Generate a new JWT token |
13 | `token list` | List all stored tokens |16 | `token list` | List all stored tokens |
14 | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) |17 | `token revoke` | Revoke a token by ID (use `--all` to revoke all tokens) |
@@ -18,32 +21,31 @@ Manage Gordon server authentication tokens.
18 21
19 ## gordon auth login22 ## gordon auth login
20 23
21-Authenticate with a remote Gordon server using a pre-generated token.24+Store a pre-generated token for a remote Gordon server.
22 25
23 ```bash26 ```bash
24-gordon auth login [options]27+gordon auth login --token <token> [options]
25 ```28 ```
26 29
27 ### Options30 ### Options
28 31
29 | Option | Description |32 | Option | Description |
30 |--------|-------------|33 |--------|-------------|
34+| `-t, --token` | **Required.** Authentication token to store |
31 | `-r, --remote` | Remote to authenticate with (defaults to active remote) |35 | `-r, --remote` | Remote to authenticate with (defaults to active remote) |
32-| `-t, --token` | Authentication token to store for the remote |
33 36
34 ### Description37 ### Description
35 38
36-This command stores a pre-generated token for use with a remote Gordon server. When [pass](https://www.passwordstore.org/) is available, the token is stored encrypted at `gordon/remotes/<name>/token` and any plaintext token fields are cleared from `remotes.toml`. When `pass` is unavailable, the token is stored in plaintext in `remotes.toml` with a warning.39+Stores a token for use with a remote Gordon server. The `--token` flag is required — generate a token on the server with `gordon auth token generate`.
40+
41+When [pass](https://www.passwordstore.org/) is available, the token is stored encrypted at `gordon/remotes/<name>/token` and plaintext fields are cleared from `remotes.toml`. When `pass` is unavailable, the token is stored in plaintext with a warning.
37 42
38 The token is verified against `/admin/status` on a best-effort basis.43 The token is verified against `/admin/status` on a best-effort basis.
39 44
40 ### Examples45 ### Examples
41 46
42 ```bash47 ```bash
43-# Store a token for the active remote
44 gordon auth login --token <token>48 gordon auth login --token <token>
45-
46-# Store a token for a specific remote
47 gordon auth login --remote prod --token <token>49 gordon auth login --remote prod --token <token>
48 ```50 ```
49 51
@@ -64,6 +66,41 @@ Token stored for remote 'prod'
64 66
65 ---67 ---
66 68
69+## gordon auth show-token
70+
71+Print the stored token for a remote.
72+
73+```bash
74+gordon auth show-token [--remote <name>]
75+```
76+
77+Output is the raw token string, suitable for piping. Returns an error if no token is stored.
78+
79+```bash
80+gordon auth show-token
81+gordon auth show-token --remote prod
82+gordon auth show-token | pbcopy # copy to clipboard
83+```
84+
85+---
86+
87+## gordon auth logout
88+
89+Remove the stored token for a remote.
90+
91+```bash
92+gordon auth logout [--remote <name>] [--revoke]
93+```
94+
95+| Option | Description |
96+|--------|-------------|
97+| `-r, --remote` | Remote to log out from (defaults to active remote) |
98+| `--revoke` | Also revoke the token server-side (not yet implemented) |
99+
100+Deletes the token from pass and clears token fields in `remotes.toml`.
101+
102+---
103+
67 ## gordon auth token generate104 ## gordon auth token generate
68 105
69 Generate a new JWT authentication token for registry access.106 Generate a new JWT authentication token for registry access.
M docs/upgrading.md +5 -1
@@ -13,12 +13,16 @@ Gordon v2.30.0 removes password-based authentication entirely. Only token-based
1313 - `auth.type = "password"` is no longer accepted
1414 - `auth.password` and `auth.password_hash` config fields are removed
1515 - The `gordon auth password hash` CLI command is removed
16-- The `gordon auth login` command no longer accepts `--username` or `--password` flags
16+- The `gordon auth login` command now requires `--token` (no more interactive password prompt)
1717 - The `/auth/password` endpoint now returns `410 Gone`
18+- Long-lived tokens are no longer accepted on admin/registry endpoints — they must be exchanged for ephemeral tokens via `/auth/token`
1819
1920 **New features:**
2021
2122 - `auth.access_token_ttl` configures the lifetime of ephemeral access tokens issued by `/auth/token` (default: `"15m"`)
23+- `gordon auth show-token` prints the stored token for a remote
24+- `gordon auth logout` removes the stored token (with optional `--revoke`)
25+- Automatic token exchange: the CLI transparently exchanges long-lived tokens for ephemeral ones before API calls
2226 - Admin scopes (`admin:*:*`, `admin:routes:read`, etc.) allow fine-grained access control for remote CLI operations
2327
2428 **Migration steps:**
@@ -13,12 +13,16 @@ Gordon v2.30.0 removes password-based authentication entirely. Only token-based
13 - `auth.type = "password"` is no longer accepted13 - `auth.type = "password"` is no longer accepted
14 - `auth.password` and `auth.password_hash` config fields are removed14 - `auth.password` and `auth.password_hash` config fields are removed
15 - The `gordon auth password hash` CLI command is removed15 - The `gordon auth password hash` CLI command is removed
16-- The `gordon auth login` command no longer accepts `--username` or `--password` flags16+- The `gordon auth login` command now requires `--token` (no more interactive password prompt)
17 - The `/auth/password` endpoint now returns `410 Gone`17 - The `/auth/password` endpoint now returns `410 Gone`
18+- Long-lived tokens are no longer accepted on admin/registry endpoints — they must be exchanged for ephemeral tokens via `/auth/token`
18 19
19 **New features:**20 **New features:**
20 21
21 - `auth.access_token_ttl` configures the lifetime of ephemeral access tokens issued by `/auth/token` (default: `"15m"`)22 - `auth.access_token_ttl` configures the lifetime of ephemeral access tokens issued by `/auth/token` (default: `"15m"`)
23+- `gordon auth show-token` prints the stored token for a remote
24+- `gordon auth logout` removes the stored token (with optional `--revoke`)
25+- Automatic token exchange: the CLI transparently exchanges long-lived tokens for ephemeral ones before API calls
22 - Admin scopes (`admin:*:*`, `admin:routes:read`, etc.) allow fine-grained access control for remote CLI operations26 - Admin scopes (`admin:*:*`, `admin:routes:read`, etc.) allow fine-grained access control for remote CLI operations
23 27
24 **Migration steps:**28 **Migration steps:**

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 7

Tags 106

↑↓ moveenter openesc close