@owlmeans/oidc 0.1.15 → 0.1.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -87,10 +87,9 @@ Array of dispatcher module declarations: `POST /authenticate/oidc/init` and `POS
87
87
  <!-- owlmeans:agent-guidance:start -->
88
88
  ## Agent guidance
89
89
 
90
- This package ships embedded Claude Code skills and GitHub Copilot instructions under
91
- `agent-meta/`. After installing your `@owlmeans/*` packages, run the OwlMeans
92
- agent-skills installer to place them into your project's native locations
93
- (`.claude/skills/` and `.github/instructions/`):
90
+ This package ships embedded agent skills under `agent-meta/`. After installing your
91
+ `@owlmeans/*` packages, run the OwlMeans agent-skills installer to place them into
92
+ your project's skill store (`.agents/skills/`):
94
93
 
95
94
  ```sh
96
95
  npx @owlmeans/agent-skills
@@ -1,8 +1,8 @@
1
1
  {
2
- "schemaVersion": 1,
2
+ "schemaVersion": 2,
3
3
  "package": "@owlmeans/oidc",
4
- "version": "0.1.15",
5
- "generatedAt": "2026-08-07T17:06:32.903Z",
4
+ "version": "0.1.16",
5
+ "generatedAt": "2026-08-14T10:14:48.853Z",
6
6
  "canonicalRepo": "https://github.com/owlmeans/common",
7
7
  "entries": [
8
8
  {
@@ -10,21 +10,14 @@
10
10
  "name": "oidc-versions",
11
11
  "category": "multi-package",
12
12
  "file": "skills/oidc-versions/SKILL.md",
13
- "canonicalPath": ".claude/skills/oidc-versions/SKILL.md"
13
+ "canonicalPath": ".agents/skills/oidc-versions/SKILL.md"
14
14
  },
15
15
  {
16
16
  "kind": "skill",
17
17
  "name": "oidc",
18
18
  "category": "package-specific",
19
19
  "file": "skills/oidc/SKILL.md",
20
- "canonicalPath": ".claude/skills/oidc/SKILL.md"
21
- },
22
- {
23
- "kind": "instruction",
24
- "name": "oidc",
25
- "category": "package-specific",
26
- "file": "instructions/oidc.instructions.md",
27
- "canonicalPath": ".github/instructions/oidc.instructions.md"
20
+ "canonicalPath": ".agents/skills/oidc/SKILL.md"
28
21
  }
29
22
  ]
30
23
  }
@@ -8,7 +8,7 @@ user-invocable: false
8
8
  # @owlmeans/oidc
9
9
 
10
10
  **Layer:** Core
11
- **Install:** `"@owlmeans/oidc": "^0.1.15"` in `dependencies`
11
+ **Install:** `"@owlmeans/oidc": "^0.1.16"` in `dependencies`
12
12
 
13
13
  ## Key Exports
14
14
 
@@ -17,6 +17,10 @@ user-invocable: false
17
17
  | `OIDC_GATE` | Gate alias to pass to `gate(...)` inside `guard(...)` |
18
18
  | `GOOGLE_CLIENT_AUTH` | Client auth plugin type for Google OAuth |
19
19
  | `GOOGLE_SERVICE` | Provider service key for Google (`'google'`) |
20
+ | `OIDC_RP_BASE_SCOPES` / `OIDC_RP_BASE_SCOPE` | The scopes every OwlMeans RP requests, as array / space-delimited string |
21
+ | `EMAIL_SCOPE`, `PERMISSIONS_SCOPE`, `PERMISSIONS_CLAIM` | Standard email scope; the integrated-IAM grant scope and its claim |
22
+ | `OIDC_ERROR_QUERY`, `OIDC_ERROR_DESCRIPTION_QUERY` | Redirect-URI params an authorization server sets on failure |
23
+ | `INTERACTION`, `INTERACTION_PATH`, `INTERACTION_UID` | Interaction screen entrypoint alias, path, and its uid path param |
20
24
  | `OidcProviderDescriptor` | Shared provider config shape, including service, endpoints, redirect URI, and optional default flag |
21
25
  | `OidcGuard` types | Guard payload shapes |
22
26
  | Modules | Shared OIDC module declarations |
@@ -38,6 +42,19 @@ entrypoint(
38
42
 
39
43
  The actual OIDC verification happens in `@owlmeans/server-oidc-rp` (server) and `@owlmeans/web-oidc-rp` (browser). The `oidc` package gives both sides a shared name to refer to.
40
44
 
45
+ ## Scope names are a cross-package contract
46
+
47
+ `OIDC_RP_BASE_SCOPES` is the one definition of what an OwlMeans relying party asks an authorization
48
+ server for. Two sides must agree on it and both read it from here:
49
+
50
+ - the **RP** builds its request from it (`requestedScope()` in `@owlmeans/server-oidc-rp`);
51
+ - whoever **registers the client** must allow at least these scopes — an authorization server
52
+ rejects the entire request with `invalid_scope` when a requested scope is one it supports but
53
+ the client is not allowed to use (see `@owlmeans/iam-integrated`'s `INTEGRATED_CLIENT_SCOPES`).
54
+
55
+ Never hardcode a scope string on either side; adding one to `OIDC_RP_BASE_SCOPES` must widen every
56
+ client allowlist derived from it in the same change.
57
+
41
58
  ## Product-Viable Usage Notes
42
59
 
43
60
  - Provider config is stored in `cfg.oidc.providers`; viable config registers both an internal admin provider and a Google provider with `service: GOOGLE_SERVICE`.
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  name: oidc-versions
3
3
  description: How to manage and upgrade the four OIDC/OAuth third-party dependencies used by OwlMeans OIDC packages. Covers exact-pin policy, official doc anchors, breaking-change checklists for each lib, the OwlMeans isolation principle, and the verification flow across common and downstream repos. Auto-invoked when touching oidc-provider, openid-client, jose, or oidc-client-ts version strings in package.json files.
4
- allowed-tools: Bash(npm view *), Bash(grep *), Bash(bun *)
4
+ allowed-tools: Bash(npm view *) Bash(grep *) Bash(bun *)
5
5
  ---
6
6
  <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
7
 
package/build/consts.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  export declare const DEFAULT_PATH = "oidc";
2
2
  export declare const DEFAULT_FRONT = "oidc-client";
3
+ /** The path param carrying the interaction uid — every INTERACTION route must declare it. */
4
+ export declare const INTERACTION_UID = "uid";
3
5
  export declare const INTERACTION_PATH = "/interaction/:uid";
4
6
  export declare const INTERACTION = "oidc:interaction";
5
7
  export declare const OIDC_FLOW = "oidc";
@@ -13,11 +15,31 @@ export declare const OIDC_GUARD_CACHE = "resource:oidc-guard:cache";
13
15
  export declare const DISPATCHER_OIDC_INIT = "dispatcher:oidc:init";
14
16
  export declare const DISPATCHER_OIDC = "dispatcher:oidc:authenticate";
15
17
  export declare const OIDC_CODE_QUERY = "code";
18
+ /**
19
+ * Query params an authorization server sets on the redirect URI when the request failed
20
+ * (RFC 6749 §4.1.2.1). Their presence means the flow is over — a relying party that re-enters
21
+ * authorization on seeing them loops between itself and the provider forever.
22
+ */
23
+ export declare const OIDC_ERROR_QUERY = "error";
24
+ export declare const OIDC_ERROR_DESCRIPTION_QUERY = "error_description";
16
25
  export declare const OIDC_WRAPPED_TOKEN = "oidc-wrapped-token";
17
26
  export declare const WRAPPED_OIDC = "wrapped-oidc-authz";
18
27
  export declare const OIDC_GATE = "oidc-gate";
28
+ /** Standard OIDC scope that requests the `email` / `email_verified` claims. */
29
+ export declare const EMAIL_SCOPE = "email";
19
30
  /** OIDC scope that requests the permissions claim from the integrated provider. */
20
31
  export declare const PERMISSIONS_SCOPE = "permissions";
32
+ /**
33
+ * The scopes an OwlMeans relying party asks for on every authorization request, before the
34
+ * provider-specific `extraScopes` are appended.
35
+ *
36
+ * Any provider we register a client with must allow all of them: `oidc-provider` rejects the whole
37
+ * request with `invalid_scope` when a requested scope is one it supports but the client is not
38
+ * allowed to use (`email` is such a scope — it exists as soon as `claims.email` is configured).
39
+ */
40
+ export declare const OIDC_RP_BASE_SCOPES: string[];
41
+ /** `OIDC_RP_BASE_SCOPES` as the space-delimited string an authorization request carries. */
42
+ export declare const OIDC_RP_BASE_SCOPE: string;
21
43
  /** Token/userinfo claim carrying the subject's PermissionSet[] for the requesting client. */
22
44
  export declare const PERMISSIONS_CLAIM = "permissions";
23
45
  //# sourceMappingURL=consts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.d.ts","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,YAAY,SAAS,CAAA;AAElC,eAAO,MAAM,aAAa,gBAAgB,CAAA;AAE1C,eAAO,MAAM,gBAAgB,sBAAsB,CAAA;AAEnD,eAAO,MAAM,WAAW,qBAAqB,CAAA;AAE7C,eAAO,MAAM,SAAS,SAAS,CAAA;AAE/B,eAAO,MAAM,kBAAkB,oBAAoB,CAAA;AAEnD,eAAO,MAAM,oBAAoB,4BAA4B,CAAA;AAE7D,eAAO,MAAM,gBAAgB,gBAA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AS,CAAA;AAErC;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,UAAU,CAAA;AAEvC,eAAO,MAAM,4BAA4B,sBAAsB,CAAA;AAE/D,eAAO,MAAM,kBAAkB,uBAAuB,CAAA;AAEtD,eAAO,MAAM,YAAY,uBAAuB,CAAA;AAEhD,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,+EAA+E;AAC/E,eAAO,MAAM,WAAW,UAAU,CAAA;AAElC,mFAAmF;AACnF,eAAO,MAAM,iBAAiB,gBAAgB,CAAA;AAE9C;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,UAAqC,CAAA;AAErE,4FAA4F;AAC5F,eAAO,MAAM,kBAAkB,QAAgC,CAAA;AAE/D,6FAA6F;AAC7F,eAAO,MAAM,iBAAiB,gBAAgB,CAAA"}
package/build/consts.js CHANGED
@@ -1,6 +1,9 @@
1
+ import { PARAM } from '@owlmeans/route';
1
2
  export const DEFAULT_PATH = 'oidc';
2
3
  export const DEFAULT_FRONT = 'oidc-client';
3
- export const INTERACTION_PATH = '/interaction/:uid';
4
+ /** The path param carrying the interaction uid — every INTERACTION route must declare it. */
5
+ export const INTERACTION_UID = 'uid';
6
+ export const INTERACTION_PATH = `/interaction/${PARAM}${INTERACTION_UID}`;
4
7
  export const INTERACTION = 'oidc:interaction';
5
8
  export const OIDC_FLOW = 'oidc';
6
9
  export const OIDC_AUTHEN_MODULE = 'iam-oidc-authen';
@@ -14,11 +17,31 @@ export const OIDC_GUARD_CACHE = 'resource:oidc-guard:cache';
14
17
  export const DISPATCHER_OIDC_INIT = 'dispatcher:oidc:init';
15
18
  export const DISPATCHER_OIDC = 'dispatcher:oidc:authenticate';
16
19
  export const OIDC_CODE_QUERY = 'code';
20
+ /**
21
+ * Query params an authorization server sets on the redirect URI when the request failed
22
+ * (RFC 6749 §4.1.2.1). Their presence means the flow is over — a relying party that re-enters
23
+ * authorization on seeing them loops between itself and the provider forever.
24
+ */
25
+ export const OIDC_ERROR_QUERY = 'error';
26
+ export const OIDC_ERROR_DESCRIPTION_QUERY = 'error_description';
17
27
  export const OIDC_WRAPPED_TOKEN = 'oidc-wrapped-token';
18
28
  export const WRAPPED_OIDC = 'wrapped-oidc-authz';
19
29
  export const OIDC_GATE = 'oidc-gate';
30
+ /** Standard OIDC scope that requests the `email` / `email_verified` claims. */
31
+ export const EMAIL_SCOPE = 'email';
20
32
  /** OIDC scope that requests the permissions claim from the integrated provider. */
21
33
  export const PERMISSIONS_SCOPE = 'permissions';
34
+ /**
35
+ * The scopes an OwlMeans relying party asks for on every authorization request, before the
36
+ * provider-specific `extraScopes` are appended.
37
+ *
38
+ * Any provider we register a client with must allow all of them: `oidc-provider` rejects the whole
39
+ * request with `invalid_scope` when a requested scope is one it supports but the client is not
40
+ * allowed to use (`email` is such a scope — it exists as soon as `claims.email` is configured).
41
+ */
42
+ export const OIDC_RP_BASE_SCOPES = ['openid', 'profile', EMAIL_SCOPE];
43
+ /** `OIDC_RP_BASE_SCOPES` as the space-delimited string an authorization request carries. */
44
+ export const OIDC_RP_BASE_SCOPE = OIDC_RP_BASE_SCOPES.join(' ');
22
45
  /** Token/userinfo claim carrying the subject's PermissionSet[] for the requesting client. */
23
46
  export const PERMISSIONS_CLAIM = 'permissions';
24
47
  //# sourceMappingURL=consts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"consts.js","sourceRoot":"","sources":["../src/consts.ts"],"names":[],"mappings":"AACA,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAA;AAElC,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAA;AAE1C,MAAM,CAAC,MAAM,gBAAgB,GAAG,mBAAmB,CAAA;AAEnD,MAAM,CAAC,MAAM,WAAW,GAAG,kBAAkB,CAAA;AAE7C,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAA;AAE/B,MAAM,CAAC,MAAM,kBAAkB,GAAG,iBAAiB,CAAA;AAEnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,yBAAyB,C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"version": "0.1.15",
3
+ "version": "0.1.16",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -21,14 +21,14 @@
21
21
  }
22
22
  },
23
23
  "dependencies": {
24
- "@owlmeans/auth": "^0.1.15",
25
- "@owlmeans/auth-common": "^0.1.15",
26
- "@owlmeans/basic-envelope": "^0.1.15",
27
- "@owlmeans/config": "^0.1.15",
28
- "@owlmeans/context": "^0.1.15",
29
- "@owlmeans/entrypoint": "^0.1.15",
30
- "@owlmeans/resource": "^0.1.15",
31
- "@owlmeans/route": "^0.1.15"
24
+ "@owlmeans/auth": "^0.1.16",
25
+ "@owlmeans/auth-common": "^0.1.16",
26
+ "@owlmeans/basic-envelope": "^0.1.16",
27
+ "@owlmeans/config": "^0.1.16",
28
+ "@owlmeans/context": "^0.1.16",
29
+ "@owlmeans/entrypoint": "^0.1.16",
30
+ "@owlmeans/resource": "^0.1.16",
31
+ "@owlmeans/route": "^0.1.16"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "ajv": "*"
package/src/consts.ts CHANGED
@@ -1,9 +1,14 @@
1
1
 
2
+ import { PARAM } from '@owlmeans/route'
3
+
2
4
  export const DEFAULT_PATH = 'oidc'
3
5
 
4
6
  export const DEFAULT_FRONT = 'oidc-client'
5
7
 
6
- export const INTERACTION_PATH = '/interaction/:uid'
8
+ /** The path param carrying the interaction uid — every INTERACTION route must declare it. */
9
+ export const INTERACTION_UID = 'uid'
10
+
11
+ export const INTERACTION_PATH = `/interaction/${PARAM}${INTERACTION_UID}`
7
12
 
8
13
  export const INTERACTION = 'oidc:interaction'
9
14
 
@@ -30,14 +35,39 @@ export const DISPATCHER_OIDC = 'dispatcher:oidc:authenticate'
30
35
 
31
36
  export const OIDC_CODE_QUERY = 'code'
32
37
 
38
+ /**
39
+ * Query params an authorization server sets on the redirect URI when the request failed
40
+ * (RFC 6749 §4.1.2.1). Their presence means the flow is over — a relying party that re-enters
41
+ * authorization on seeing them loops between itself and the provider forever.
42
+ */
43
+ export const OIDC_ERROR_QUERY = 'error'
44
+
45
+ export const OIDC_ERROR_DESCRIPTION_QUERY = 'error_description'
46
+
33
47
  export const OIDC_WRAPPED_TOKEN = 'oidc-wrapped-token'
34
48
 
35
49
  export const WRAPPED_OIDC = 'wrapped-oidc-authz'
36
50
 
37
51
  export const OIDC_GATE = 'oidc-gate'
38
52
 
53
+ /** Standard OIDC scope that requests the `email` / `email_verified` claims. */
54
+ export const EMAIL_SCOPE = 'email'
55
+
39
56
  /** OIDC scope that requests the permissions claim from the integrated provider. */
40
57
  export const PERMISSIONS_SCOPE = 'permissions'
41
58
 
59
+ /**
60
+ * The scopes an OwlMeans relying party asks for on every authorization request, before the
61
+ * provider-specific `extraScopes` are appended.
62
+ *
63
+ * Any provider we register a client with must allow all of them: `oidc-provider` rejects the whole
64
+ * request with `invalid_scope` when a requested scope is one it supports but the client is not
65
+ * allowed to use (`email` is such a scope — it exists as soon as `claims.email` is configured).
66
+ */
67
+ export const OIDC_RP_BASE_SCOPES = ['openid', 'profile', EMAIL_SCOPE]
68
+
69
+ /** `OIDC_RP_BASE_SCOPES` as the space-delimited string an authorization request carries. */
70
+ export const OIDC_RP_BASE_SCOPE = OIDC_RP_BASE_SCOPES.join(' ')
71
+
42
72
  /** Token/userinfo claim carrying the subject's PermissionSet[] for the requesting client. */
43
73
  export const PERMISSIONS_CLAIM = 'permissions'
@@ -1,47 +0,0 @@
1
- ---
2
- description: "How to use @owlmeans/oidc — shared OIDC protocol abstractions including OIDC_GATE constant used in module gate() declarations."
3
- applyTo: "**/*.ts, **/*.tsx"
4
- ---
5
- <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
6
-
7
- # @owlmeans/oidc
8
-
9
- **Layer:** Core
10
- **Install:** `"@owlmeans/oidc": "^0.1.15"` in `dependencies`
11
-
12
- ## Key Exports
13
-
14
- | Export | Description |
15
- |--------|-------------|
16
- | `OIDC_GATE` | Gate alias to pass to `gate(...)` inside `guard(...)` |
17
- | `GOOGLE_CLIENT_AUTH` | Client auth plugin type for Google OAuth |
18
- | `GOOGLE_SERVICE` | Provider service key for Google (`'google'`) |
19
- | `OidcProviderDescriptor` | Shared provider config shape, including service, endpoints, redirect URI, and optional default flag |
20
- | `OidcGuard` types | Guard payload shapes |
21
- | Modules | Shared OIDC module declarations |
22
- | Models | Token/profile shapes |
23
-
24
- ## Usage
25
-
26
- ```typescript
27
- import { OIDC_GATE } from '@owlmeans/oidc'
28
- import { guard, gate } from '@owlmeans/entrypoint'
29
- import { DEFAULT_GUARD } from '@owlmeans/auth-common'
30
-
31
- guard(DEFAULT_GUARD, gate(OIDC_GATE, [`my-service-account-{entity}`]))
32
- ```
33
-
34
- ## Product-Viable Usage Notes
35
-
36
- - Provider config is stored in `cfg.oidc.providers`; viable config registers both an internal admin provider and a Google provider with `service: GOOGLE_SERVICE`.
37
- - `GOOGLE_SERVICE` is the provider service value `'google'`. Keep it stable so browser plugins, backend provider lookup, and identity credentials derive the same login-service key.
38
- - `GOOGLE_CLIENT_AUTH` names the browser authentication plugin registered by `@owlmeans/web-oidc-rp/auth/plugins`.
39
- - `OIDC_GATE` is for OIDC/UMA-style authorization gates. Do not use it for downstream products that authenticate with OIDC/Google but authorize against local identity resources; those products should declare their own gate alias.
40
-
41
- - `PERMISSIONS_SCOPE` / `PERMISSIONS_CLAIM` (`'permissions'`) — the OIDC scope requesting, and the
42
- token claim carrying, the subject's `PermissionSet[]` from the integrated IAM provider. Shared by
43
- `server-oidc-provider` (emission), `server-oidc-rp` (extraction), and target provider config (`extraScopes`).
44
-
45
- ## Depends On
46
-
47
- - `@owlmeans/entrypoint`, `@owlmeans/route`, `@owlmeans/auth`