You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@
19
19
20
20
## Protocol Boundaries
21
21
22
-
- The server is an OAuth 2.0 protected resource; list/download routes are public and mutations require operation-specific scopes.
22
+
- The server is an OAuth 2.0 protected resource; list/download routes are public and mutations require operation-specific scopes. Identity-provider client restrictions, not local user/role mappings, determine who receives those scopes.
23
23
- The CLI discovers RFC 9728 protected-resource metadata and then OIDC metadata. Generic RFC 8414-only providers and direct endpoint overrides are unsupported.
24
24
- Keep OAuth mechanics in `golang.org/x/oauth2`, OIDC discovery/validation in `go-oidc`, URL trust rules in `internal/urlpolicy`, and authorization policy in `internal/auth`.
25
25
-`PKGDEPOT_OIDC_*` configures the server; `PKGDEPOT_OAUTH_*` configures CLI clients. Do not interchange them.
|`PKGDEPOT_CLIENT_CREDENTIALS_SUBJECT_TEMPLATE`| Disabled | Client-credentials subject format containing one `{client_id}`. |
234
233
235
234
### CLI OAuth
236
235
237
236
| Variable | Default | Description |
238
237
| --- | --- | --- |
239
-
|`PKGDEPOT_OAUTH_CLIENT_ID`| Empty | Required for client credentials and delegated clients without CIMD. HTTPS delegated clients with CIMD derive the server metadata URL when it is empty. |
238
+
|`PKGDEPOT_OAUTH_CLIENT_ID`| Empty | Required for client credentials and delegated clients without CIMD. HTTPS delegated clients with CIMD derive the publisher or admin CIMD URL. |
Copy file name to clipboardExpand all lines: internal/auth/AGENTS.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,16 +5,14 @@
5
5
- Validate RFC 9068 access tokens, not generic JWTs or ID tokens. Require a three-part JWT with case-insensitive `typ` exactly `at+jwt` or `application/at+jwt`.
6
6
- Enforce issuer, audience, expiry, signature, allowed algorithms, and nonempty `sub`, `client_id`, and `jti`, plus a positive numeric `iat`. The default algorithm is RS256 only.
7
7
-`scp` must be a JSON string array; `scope` is whitespace-delimited. An absent `scp` is valid, but a scalar is not.
8
-
- The role claim defaults to `pkgdepot_roles`. Missing or `null` means no roles; any other present non-string-array value invalidates the token.
9
8
- Do not expose verifier details: log the underlying cause and return `ErrInvalidToken`.
10
9
- Signing-key trust expires from key-set creation and defaults to 15 minutes. Replace the remote key set once under its mutex; do not extend trust on successful traffic.
11
10
12
11
## Authorization
13
12
14
-
- Delegated tokens need both the requested OAuth scope and a role mapped to it. A mapped role alone is insufficient; unknown roles grant nothing.
15
-
- Role-less tokens are denied unless the configured client-credentials subject template exactly matches `sub` after `{client_id}` substitution. Tokens with roles always use role mapping.
13
+
- Authorization is scope-only: a validated token is allowed when it contains the requested operation scope. User/group and client restrictions belong to the identity provider.
16
14
- Bearer parsing distinguishes missing credentials from malformed credentials; HTTP integration relies on that distinction for challenges and OAuth error codes.
17
-
- Preserve the five mutation scope constants and built-in mapping: `admin` gets all; `publisher` gets only `package:publish`.
0 commit comments