@owlmeans/server-oidc-provider 0.1.7 → 0.1.8

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
@@ -63,3 +63,20 @@ Returns middleware that mounts the OIDC authorize/token/userinfo/jwks endpoints
63
63
  - [`@owlmeans/server-oidc-rp`](../server-oidc-rp) — relying-party counterpart for consuming external IdPs
64
64
  - [`@owlmeans/server-api`](../server-api) — the underlying server API the middleware mounts onto
65
65
  - [`@owlmeans/web-oidc-provider`](../web-oidc-provider) — browser UI for the provider's interaction screens
66
+
67
+ <!-- owlmeans:agent-guidance:start -->
68
+ ## Agent guidance
69
+
70
+ This package ships embedded Claude Code skills and GitHub Copilot instructions under
71
+ `agent-meta/`. After installing your `@owlmeans/*` packages, run the OwlMeans
72
+ agent-skills installer to place them into your project's native locations
73
+ (`.claude/skills/` and `.github/instructions/`):
74
+
75
+ ```sh
76
+ npx @owlmeans/agent-skills
77
+ ```
78
+
79
+ The embedded files are version-matched to this package release. Do not edit them
80
+ directly — they are regenerated on each publish. To contribute guidance edits,
81
+ open a PR against the source monorepo.
82
+ <!-- owlmeans:agent-guidance:end -->
@@ -0,0 +1,41 @@
1
+ ---
2
+ description: "How to use @owlmeans/server-oidc-provider — embedded OIDC identity provider built on the oidc-provider library."
3
+ applyTo: "**/*.ts, **/*.tsx"
4
+ ---
5
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
6
+
7
+ # @owlmeans/server-oidc-provider
8
+
9
+ **Layer:** Server
10
+ **Install:** `"@owlmeans/server-oidc-provider": "^0.1.8"` in `dependencies`
11
+
12
+ ## Key Exports
13
+
14
+ | Export | Description |
15
+ |--------|-------------|
16
+ | `makeOidcProviderService()` | Factory for the OIDC provider service |
17
+ | Middleware | OIDC endpoints |
18
+ | Constants | Endpoint paths, default scopes |
19
+ | `OidcProvider` types | Provider config shape |
20
+
21
+ ## Usage
22
+
23
+ ```typescript
24
+ import { makeOidcProviderService } from '@owlmeans/server-oidc-provider'
25
+ context.registerService(makeOidcProviderService())
26
+ ```
27
+
28
+ For consuming an external IdP instead, use `@owlmeans/server-oidc-rp`.
29
+
30
+ ## Permissions claim seam (integrated IAM)
31
+
32
+ - `findAccount` threads the requesting `clientId` into `OidcAccountService.loadById(ctx, id, { clientId })`
33
+ (`OidcAccountParams`) so the account service can scope claims per client.
34
+ - `combineConfig` registers the `permissions` scope and the `permissions → [permissions]` claim mapping
35
+ by default (consts from `@owlmeans/oidc`); this is inert unless the account service emits the claim.
36
+ - To mint the claim into the id_token set `customConfiguration.conformIdTokenClaims: false` and return
37
+ `permissions: PermissionSet[]` from the account's `claims()` when the scope includes `permissions`.
38
+
39
+ ## Depends On
40
+
41
+ - `@owlmeans/oidc`, `@owlmeans/server-api`, `@owlmeans/server-context`, `oidc-provider`
@@ -0,0 +1,23 @@
1
+ {
2
+ "schemaVersion": 1,
3
+ "package": "@owlmeans/server-oidc-provider",
4
+ "version": "0.1.8",
5
+ "generatedAt": "2026-06-11T16:30:27.178Z",
6
+ "canonicalRepo": "https://github.com/owlmeans/common",
7
+ "entries": [
8
+ {
9
+ "kind": "skill",
10
+ "name": "server-oidc-provider",
11
+ "category": "package-specific",
12
+ "file": "skills/server-oidc-provider/SKILL.md",
13
+ "canonicalPath": ".claude/skills/server-oidc-provider/SKILL.md"
14
+ },
15
+ {
16
+ "kind": "instruction",
17
+ "name": "server-oidc-provider",
18
+ "category": "package-specific",
19
+ "file": "instructions/server-oidc-provider.instructions.md",
20
+ "canonicalPath": ".github/instructions/server-oidc-provider.instructions.md"
21
+ }
22
+ ]
23
+ }
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: server-oidc-provider
3
+ description: How to use @owlmeans/server-oidc-provider — embedded OIDC identity provider built on the oidc-provider library. Auto-invoked when serving OIDC endpoints from your own service.
4
+ user-invocable: false
5
+ ---
6
+ <!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->
7
+
8
+ # @owlmeans/server-oidc-provider
9
+
10
+ **Layer:** Server
11
+ **Install:** `"@owlmeans/server-oidc-provider": "^0.1.8"` in `dependencies`
12
+ **Runtime deps:** `oidc-provider@9.8.4` (exact), `jose@6.2.3` (exact)
13
+
14
+ ## Key Exports
15
+
16
+ | Export | Description |
17
+ |--------|-------------|
18
+ | `createOidcProviderService(alias?)` | Factory for the embedded OIDC provider service |
19
+ | `appendOidcProviderService<C,T>(ctx, alias?)` | Register the provider service on a context |
20
+ | Constants | `DEFAULT_ALIAS`, `OIDC_ACCOUNT_SERVICE` |
21
+ | Types | `OidcProviderService`, `OidcAccountService`, `OidcAdapterService`, `Config`, `Context` |
22
+
23
+ ## Usage
24
+
25
+ Use this only when your service IS the identity provider (e.g. self-hosted Keycloak alternative). For consuming an external IdP, use `@owlmeans/server-oidc-rp`.
26
+
27
+ ```typescript
28
+ import { appendOidcProviderService } from '@owlmeans/server-oidc-provider'
29
+ appendOidcProviderService<C, T>(context)
30
+ ```
31
+
32
+ The service mounts the oidc-provider Koa app onto Fastify via `api.server.use(base, oidc.callback())`. It wires `findAccount`, `interactions.url`, the JWKS, and optional adapter.
33
+
34
+ ## oidc-provider v9 notes (important)
35
+
36
+ - **Provider is a Koa app instance.** `oidc.use()` callbacks where the work happens *after* `await next()` will **not** fire once a route is matched — Koa's downstream does not continue past matched routes in v9. Move post-response header work (e.g. CSP rewrites) to a **Fastify `onSend`/`preHandler` hook** scoped to the OIDC base path.
37
+ - **`enableHttpPostMethods`** defaults `false` — set it in the Provider config if your interaction UI POSTs to the authorization/end-session endpoints.
38
+ - **DPoP is enabled by default.** Add `features: { dPoP: { enabled: false } }` if RP clients do not send DPoP proofs.
39
+ - **Cookie `sameSite` defaults to `lax`** (was `none`). Adjust `cookies.*.sameSite` if the interaction UI is on a different subdomain.
40
+ - **JWKS `kid` must be unique.** Every key in `jwks.keys` needs a distinct `kid`.
41
+ - **Node 22+** required.
42
+
43
+ ## jose v6 notes
44
+
45
+ `importPKCS8` now returns a **non-extractable `CryptoKey`** by default. Pass `{ extractable: true }` so `exportJWK` succeeds:
46
+
47
+ ```typescript
48
+ const key = await jose.importPKCS8(pkcs8Pem, 'RS256', { extractable: true })
49
+ const jwk = await jose.exportJWK(key)
50
+ ```
51
+
52
+ ## Depends On
53
+
54
+ - `@owlmeans/oidc`, `@owlmeans/server-api`, `@owlmeans/server-context`
55
+ - `oidc-provider` v9, `jose` v6 (runtime — see [[oidc-versions]] for pinned versions and upgrade checklist)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@owlmeans/server-oidc-provider",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -23,7 +23,7 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@owlmeans/dep-config": "workspace:*",
26
- "@owlmeans/context": "^0.1.7",
26
+ "@owlmeans/context": "^0.1.8",
27
27
  "@types/bun": "^1.3.0",
28
28
  "@types/node": "^24.10.1",
29
29
  "@types/oidc-provider": "9.5.0",
@@ -36,13 +36,13 @@
36
36
  },
37
37
  "dependencies": {
38
38
  "@noble/hashes": "^1.5.0",
39
- "@owlmeans/client-entrypoint": "^0.1.7",
40
- "@owlmeans/config": "^0.1.7",
41
- "@owlmeans/context": "^0.1.7",
42
- "@owlmeans/oidc": "^0.1.7",
43
- "@owlmeans/route": "^0.1.7",
44
- "@owlmeans/server-api": "^0.1.7",
45
- "@owlmeans/server-context": "^0.1.7",
39
+ "@owlmeans/client-entrypoint": "^0.1.8",
40
+ "@owlmeans/config": "^0.1.8",
41
+ "@owlmeans/context": "^0.1.8",
42
+ "@owlmeans/oidc": "^0.1.8",
43
+ "@owlmeans/route": "^0.1.8",
44
+ "@owlmeans/server-api": "^0.1.8",
45
+ "@owlmeans/server-context": "^0.1.8",
46
46
  "@scure/base": "^1.1.9",
47
47
  "jose": "6.2.3",
48
48
  "oidc-provider": "9.8.4"