@owlmeans/server-oidc-rp 0.1.18-rc.26 → 0.1.18-rc.28
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 +2 -2
- package/agent-meta/manifest.json +2 -2
- package/agent-meta/skills/server-oidc-rp/SKILL.md +25 -2
- package/build/actions/init.d.ts.map +1 -1
- package/build/actions/init.js +9 -1
- package/build/actions/init.js.map +1 -1
- package/package.json +17 -17
- package/src/actions/init.ts +10 -1
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ import { withOidcGuard } from '@owlmeans/oidc'
|
|
|
39
39
|
import { oidcEntrypoints } from '@owlmeans/server-oidc-rp'
|
|
40
40
|
|
|
41
41
|
const configuredProtocols = withOidcGuard(protocols)
|
|
42
|
-
const
|
|
42
|
+
const serverBindings = [
|
|
43
43
|
// Bind application protocols against configuredProtocols here.
|
|
44
44
|
...oidcEntrypoints,
|
|
45
45
|
]
|
|
@@ -117,7 +117,7 @@ This package ships embedded agent skills under `agent-meta/`. After installing y
|
|
|
117
117
|
your project's skill store (`.agents/skills/`):
|
|
118
118
|
|
|
119
119
|
```sh
|
|
120
|
-
npx @owlmeans/agent-skills@^0.1.18-rc.
|
|
120
|
+
npx @owlmeans/agent-skills@^0.1.18-rc.20
|
|
121
121
|
```
|
|
122
122
|
|
|
123
123
|
The embedded files are version-matched to this package release. Do not edit them
|
package/agent-meta/manifest.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 2,
|
|
3
3
|
"package": "@owlmeans/server-oidc-rp",
|
|
4
|
-
"version": "0.1.18-rc.
|
|
5
|
-
"generatedAt": "2026-09-
|
|
4
|
+
"version": "0.1.18-rc.28",
|
|
5
|
+
"generatedAt": "2026-09-14T17:28:17.884Z",
|
|
6
6
|
"canonicalRepo": "https://github.com/owlmeans/common",
|
|
7
7
|
"entries": [
|
|
8
8
|
{
|
|
@@ -8,7 +8,7 @@ user-invocable: false
|
|
|
8
8
|
# @owlmeans/server-oidc-rp
|
|
9
9
|
|
|
10
10
|
**Layer:** Server
|
|
11
|
-
**Install:** `"@owlmeans/server-oidc-rp": "^0.1.18-rc.
|
|
11
|
+
**Install:** `"@owlmeans/server-oidc-rp": "^0.1.18-rc.28"` in `dependencies`
|
|
12
12
|
|
|
13
13
|
## Key Exports
|
|
14
14
|
|
|
@@ -57,7 +57,7 @@ import { oidcEntrypoints, makeAuthServiceEntrypoints } from '@owlmeans/server-oi
|
|
|
57
57
|
import { bindAll } from '@owlmeans/server-entrypoint'
|
|
58
58
|
|
|
59
59
|
export const configuredProtocols = withOidcGuard(protocols)
|
|
60
|
-
export const
|
|
60
|
+
export const serverBindings = [
|
|
61
61
|
...bindAll(configuredProtocols.api),
|
|
62
62
|
...oidcEntrypoints,
|
|
63
63
|
...bindAll(makeAuthServiceEntrypoints('my-auth-api')),
|
|
@@ -164,6 +164,29 @@ every field it is given; a stored `entityId` that was never validated against th
|
|
|
164
164
|
— a caller-side default or placeholder, say — makes the exchange fail with a bare `AuthenFailed()`
|
|
165
165
|
even though the same default provider is trivially available again at exchange time.
|
|
166
166
|
|
|
167
|
+
## Building the redirect URI: the init handler has no `url()`
|
|
168
|
+
|
|
169
|
+
`init.ts` runs on the SERVER, but `DISPATCHER` (`@owlmeans/auth`) is a FRONTEND route
|
|
170
|
+
(`frontend({ service: DISPATCHER })` in `@owlmeans/auth-common`'s entrypoints) — the browser page
|
|
171
|
+
the identity provider redirects back to. `.url()` is attached to an entrypoint reference only by
|
|
172
|
+
`@owlmeans/client-entrypoint`, for a browser context that can resolve its own address; a server
|
|
173
|
+
context's `context.entrypoint(DISPATCHER)` is a `CommonEntrypoint` and has no such method. Typing
|
|
174
|
+
the call as `ClientEntrypoint<string>` (which does declare `.url()`) type-checks and builds clean
|
|
175
|
+
but throws at request time: `context.entrypoint(DISPATCHER).url is not a function`. This shipped
|
|
176
|
+
unnoticed for a long time because it is unreachable until a caller's own OIDC login FLOW actually
|
|
177
|
+
reaches the step that calls `authenticate()` — a consumer whose flow config never reaches that step
|
|
178
|
+
never exercises this line, so the fault surfaces only in a fully wired application, and only on the
|
|
179
|
+
very first sign-in attempt.
|
|
180
|
+
|
|
181
|
+
The fix — and the pattern for anywhere else in this package (or a consumer) that needs an absolute
|
|
182
|
+
URL for a route it does not own — is the one `@owlmeans/server-oidc-provider`'s interaction `url`
|
|
183
|
+
callback already uses: type the reference as `CommonEntrypoint`, then compose the address from
|
|
184
|
+
`.path()` and `.address()` through `makeSecurityHelper(ctx).makeUrl(entry.address(), entry.path())`
|
|
185
|
+
(`@owlmeans/config`). A route with path params (this one has none) needs its own substitution
|
|
186
|
+
first, the way the interaction URL substitutes `:uid` before qualifying it. Typing the reference as
|
|
187
|
+
`CommonEntrypoint` rather than `ClientEntrypoint` is itself the regression guard: calling `.url()`
|
|
188
|
+
on it is now a compile error, not a runtime one.
|
|
189
|
+
|
|
167
190
|
## Public type contract (isolation principle)
|
|
168
191
|
|
|
169
192
|
`openid-client` types **never appear in this package's public exports**. All public types are
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/actions/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/actions/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AAoBzE,eAAO,MAAM,IAAI,EAAE,sBAiGjB,CAAA"}
|
package/build/actions/init.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { handleBody } from '@owlmeans/server-api';
|
|
2
2
|
import { AuthenPayloadError, AuthUnknown, DISPATCHER } from '@owlmeans/auth';
|
|
3
3
|
import { assertContext } from '@owlmeans/context';
|
|
4
|
+
import { makeSecurityHelper } from '@owlmeans/config';
|
|
4
5
|
import { authService, DEFAULT_ALIAS } from '../consts.js';
|
|
5
6
|
// import { PROVIDER_CACHE_TTL } from '../consts.js'
|
|
6
7
|
// import type { Client } from 'openid-client'
|
|
@@ -72,7 +73,14 @@ export const init = handleBody(async (body, ctx) => {
|
|
|
72
73
|
client: client.getClientId(),
|
|
73
74
|
...(entityIdUsedForResolution ? { entityId } : {}),
|
|
74
75
|
}, { ttl: AUTHEN_TIMEFRAME / 1000 });
|
|
75
|
-
|
|
76
|
+
// The dispatcher is a FRONTEND route, and this is a server context — the entrypoint registered
|
|
77
|
+
// here has no `url()` (that helper is attached by `@owlmeans/client-entrypoint` only, for a
|
|
78
|
+
// browser context that can resolve its own address). Assembled the way `server-oidc-provider`'s
|
|
79
|
+
// interaction URL is: the entrypoint's path, qualified with the address it answers on — the
|
|
80
|
+
// frontend service's, not this backend's.
|
|
81
|
+
const dispatcherEntry = context.entrypoint(DISPATCHER);
|
|
82
|
+
const dispatcherUrl = makeSecurityHelper(context)
|
|
83
|
+
.makeUrl(dispatcherEntry.address(), dispatcherEntry.path());
|
|
76
84
|
const cfg = client.getConfig();
|
|
77
85
|
const url = client.makeAuthUrl({
|
|
78
86
|
scope: requestedScope(cfg?.extraScopes),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/actions/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/actions/init.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,EAAE,kBAAkB,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;A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a;KAC5B,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,CAAA;IAE9B,OAAO,GAAG,CAAA;AACZ,CAAC,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@owlmeans/server-oidc-rp",
|
|
3
|
-
"version": "0.1.18-rc.
|
|
3
|
+
"version": "0.1.18-rc.28",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@owlmeans/dep-config": "workspace:*",
|
|
40
|
-
"@owlmeans/test-auth": "^0.1.18-rc.
|
|
40
|
+
"@owlmeans/test-auth": "^0.1.18-rc.21",
|
|
41
41
|
"@types/bun": "^1.4.0",
|
|
42
42
|
"@types/node": "^26.1.0",
|
|
43
43
|
"nodemon": "^3.1.14",
|
|
@@ -45,21 +45,21 @@
|
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@noble/hashes": "^1.5.0",
|
|
48
|
-
"@owlmeans/auth": "^0.1.18-rc.
|
|
49
|
-
"@owlmeans/auth-common": "^0.1.18-rc.
|
|
50
|
-
"@owlmeans/basic-envelope": "^0.1.18-rc.
|
|
51
|
-
"@owlmeans/client-entrypoint": "^0.1.18-rc.
|
|
52
|
-
"@owlmeans/config": "^0.1.18-rc.
|
|
53
|
-
"@owlmeans/context": "^0.1.18-rc.
|
|
54
|
-
"@owlmeans/did": "^0.1.18-rc.
|
|
55
|
-
"@owlmeans/entrypoint": "^0.1.18-rc.
|
|
56
|
-
"@owlmeans/oidc": "^0.1.18-rc.
|
|
57
|
-
"@owlmeans/resource": "^0.1.18-rc.
|
|
58
|
-
"@owlmeans/route": "^0.1.18-rc.
|
|
59
|
-
"@owlmeans/server-api": "^0.1.18-rc.
|
|
60
|
-
"@owlmeans/server-auth": "^0.1.18-rc.
|
|
61
|
-
"@owlmeans/server-context": "^0.1.18-rc.
|
|
62
|
-
"@owlmeans/server-entrypoint": "^0.1.18-rc.
|
|
48
|
+
"@owlmeans/auth": "^0.1.18-rc.17",
|
|
49
|
+
"@owlmeans/auth-common": "^0.1.18-rc.21",
|
|
50
|
+
"@owlmeans/basic-envelope": "^0.1.18-rc.20",
|
|
51
|
+
"@owlmeans/client-entrypoint": "^0.1.18-rc.21",
|
|
52
|
+
"@owlmeans/config": "^0.1.18-rc.20",
|
|
53
|
+
"@owlmeans/context": "^0.1.18-rc.16",
|
|
54
|
+
"@owlmeans/did": "^0.1.18-rc.20",
|
|
55
|
+
"@owlmeans/entrypoint": "^0.1.18-rc.19",
|
|
56
|
+
"@owlmeans/oidc": "^0.1.18-rc.29",
|
|
57
|
+
"@owlmeans/resource": "^0.1.18-rc.17",
|
|
58
|
+
"@owlmeans/route": "^0.1.18-rc.17",
|
|
59
|
+
"@owlmeans/server-api": "^0.1.18-rc.25",
|
|
60
|
+
"@owlmeans/server-auth": "^0.1.18-rc.27",
|
|
61
|
+
"@owlmeans/server-context": "^0.1.18-rc.20",
|
|
62
|
+
"@owlmeans/server-entrypoint": "^0.1.18-rc.19",
|
|
63
63
|
"@scure/base": "^2.3.0",
|
|
64
64
|
"dayjs": "^1.11.13",
|
|
65
65
|
"jose": "6.2.5",
|
package/src/actions/init.ts
CHANGED
|
@@ -5,6 +5,8 @@ import { AuthenPayloadError, AuthUnknown, DISPATCHER } from '@owlmeans/auth'
|
|
|
5
5
|
import { assertContext } from '@owlmeans/context'
|
|
6
6
|
import type { Config, Context, OidcClientAdapter, OidcClientService } from '../types.js'
|
|
7
7
|
import type { ClientEntrypoint } from '@owlmeans/client-entrypoint'
|
|
8
|
+
import type { CommonEntrypoint } from '@owlmeans/entrypoint'
|
|
9
|
+
import { makeSecurityHelper } from '@owlmeans/config'
|
|
8
10
|
import { authService, DEFAULT_ALIAS } from '../consts.js'
|
|
9
11
|
// import { PROVIDER_CACHE_TTL } from '../consts.js'
|
|
10
12
|
// import type { Client } from 'openid-client'
|
|
@@ -93,7 +95,14 @@ export const init: RefedEntrypointHandler = handleBody(async (body: OIDCAuthInit
|
|
|
93
95
|
...(entityIdUsedForResolution ? { entityId } : {}),
|
|
94
96
|
}, { ttl: AUTHEN_TIMEFRAME / 1000 })
|
|
95
97
|
|
|
96
|
-
|
|
98
|
+
// The dispatcher is a FRONTEND route, and this is a server context — the entrypoint registered
|
|
99
|
+
// here has no `url()` (that helper is attached by `@owlmeans/client-entrypoint` only, for a
|
|
100
|
+
// browser context that can resolve its own address). Assembled the way `server-oidc-provider`'s
|
|
101
|
+
// interaction URL is: the entrypoint's path, qualified with the address it answers on — the
|
|
102
|
+
// frontend service's, not this backend's.
|
|
103
|
+
const dispatcherEntry = context.entrypoint<CommonEntrypoint>(DISPATCHER)
|
|
104
|
+
const dispatcherUrl = makeSecurityHelper<Config, Context>(context)
|
|
105
|
+
.makeUrl(dispatcherEntry.address(), dispatcherEntry.path())
|
|
97
106
|
|
|
98
107
|
const cfg = client.getConfig()
|
|
99
108
|
const url = client.makeAuthUrl({
|