@o3co/create-auth-provider 0.8.0 → 0.9.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3co/create-auth-provider",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Scaffold a new o3co/auth.provider project from the standalone template",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
"node": ">=18.19.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@types/node": "^25.
|
|
32
|
-
"vitest": "^4.1.
|
|
31
|
+
"@types/node": "^25.9.1",
|
|
32
|
+
"vitest": "^4.1.8"
|
|
33
33
|
},
|
|
34
34
|
"scripts": {
|
|
35
35
|
"build": "tsc",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@o3co/auth-provider-standalone",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"private": true,
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -28,24 +28,24 @@
|
|
|
28
28
|
"@o3co/auth-provider-foundation": "workspace:*",
|
|
29
29
|
"@o3co/auth-provider-redis": "workspace:*",
|
|
30
30
|
"@o3co/auth.utils": "^0.0.4",
|
|
31
|
-
"@o3co/ts.hocon": "^1.
|
|
31
|
+
"@o3co/ts.hocon": "^1.2.0",
|
|
32
32
|
"connect-redis": "^9.0.0",
|
|
33
33
|
"express": "^5.2.1",
|
|
34
34
|
"express-session": "^1.19.0",
|
|
35
35
|
"helmet": "^8.1.0",
|
|
36
|
-
"ioredis": "^5.
|
|
36
|
+
"ioredis": "^5.11.0",
|
|
37
37
|
"pino": "^10.3.1",
|
|
38
38
|
"redis": "^5.12.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
41
|
"@types/express": "^5.0.6",
|
|
42
42
|
"@types/express-session": "^1",
|
|
43
|
-
"@types/node": "^25.
|
|
43
|
+
"@types/node": "^25.9.1",
|
|
44
44
|
"@types/supertest": "^7.2.0",
|
|
45
45
|
"supertest": "^7.1.0",
|
|
46
|
-
"tsx": "^4.
|
|
46
|
+
"tsx": "^4.22.3",
|
|
47
47
|
"typescript": "^5.9.3",
|
|
48
|
-
"vitest": "^4.1.
|
|
48
|
+
"vitest": "^4.1.8"
|
|
49
49
|
},
|
|
50
50
|
"pnpm": {
|
|
51
51
|
"onlyBuiltDependencies": [
|
|
@@ -222,6 +222,42 @@ describe("standalone smoke test", () => {
|
|
|
222
222
|
expect(res.status).toBe(200);
|
|
223
223
|
});
|
|
224
224
|
|
|
225
|
+
it("issuer-configured buildModules serves the advertised jwks_uri (discovery <-> JWKS presence contract)", async () => {
|
|
226
|
+
// Guards the cross-module contract end-to-end against the REAL composition
|
|
227
|
+
// root: core's `jwksModule` contributes `jwks_uri` to discovery AND mounts
|
|
228
|
+
// the JWKS route, while `oauthModule` contributes the provider endpoints;
|
|
229
|
+
// core's aggregator assembles the document. If `buildModules` ever drops
|
|
230
|
+
// `jwksModule`, the issuer-configured composition now fails the discovery
|
|
231
|
+
// presence contract at boot (missing `jwks_uri`) — this test fails (RED) in
|
|
232
|
+
// that case. (The oauth package's integration test hand-composes both
|
|
233
|
+
// modules, so only a scaffold-level test like this can catch the
|
|
234
|
+
// composition root forgetting to wire jwksModule.)
|
|
235
|
+
const issuerConfig: AppConfig = {
|
|
236
|
+
...config,
|
|
237
|
+
oauth: {
|
|
238
|
+
...config.oauth,
|
|
239
|
+
jwt: { ...config.oauth.jwt, issuer: "https://auth.example.com" },
|
|
240
|
+
},
|
|
241
|
+
};
|
|
242
|
+
const handle = await createApp({
|
|
243
|
+
modules: buildModules(issuerConfig, {
|
|
244
|
+
keyStoreModule: testKeyStoreModule,
|
|
245
|
+
repositoriesModule: testRepositoriesModule,
|
|
246
|
+
refreshTokenFamilyModules: [memoryRefreshTokenFamilyStoreModule],
|
|
247
|
+
}),
|
|
248
|
+
bootstrapComponents: { config: issuerConfig, pathResolver: (s) => s },
|
|
249
|
+
});
|
|
250
|
+
handleRef = handle;
|
|
251
|
+
const app = express();
|
|
252
|
+
app.use(handle.router);
|
|
253
|
+
const disco = await request(app).get("/.well-known/openid-configuration");
|
|
254
|
+
expect(disco.status).toBe(200);
|
|
255
|
+
const jwksPath = new URL(disco.body.jwks_uri as string).pathname;
|
|
256
|
+
const res = await request(app).get(jwksPath);
|
|
257
|
+
expect(res.status).toBe(200);
|
|
258
|
+
expect(Array.isArray(res.body.keys)).toBe(true);
|
|
259
|
+
});
|
|
260
|
+
|
|
225
261
|
it("POST /oauth/token with unsupported grant_type returns 400", async () => {
|
|
226
262
|
const { app, handle } = await buildApp();
|
|
227
263
|
handleRef = handle;
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
type AppConfig,
|
|
18
18
|
defaultRefreshTokenFamilyRevocationModule,
|
|
19
19
|
defaultRefreshTokenFamilyRotationModule,
|
|
20
|
+
jwksModule,
|
|
20
21
|
type Module,
|
|
21
22
|
memoryRateLimiterModule,
|
|
22
23
|
} from "@o3co/auth-provider-core";
|
|
@@ -165,6 +166,13 @@ export function buildModules(config: AppConfig, overrides: BuildModulesOverrides
|
|
|
165
166
|
oauthModule({ config }),
|
|
166
167
|
oauthSessionModule({ config }),
|
|
167
168
|
oauthAuthorizationModule({ config }),
|
|
169
|
+
// JWKS publishing — always wired (depends only on config + keyStore).
|
|
170
|
+
// Contributed by core's `jwksModule`, NOT oauthModule: a provider that
|
|
171
|
+
// signs tokens must publish its verification keys regardless of OIDC
|
|
172
|
+
// issuer config. Co-installed with oauthModule so the discovery
|
|
173
|
+
// `jwks_uri` (advertised by oauthModule when an issuer is set) always
|
|
174
|
+
// resolves to this mounted route.
|
|
175
|
+
jwksModule,
|
|
168
176
|
sessionModule,
|
|
169
177
|
...(googleEnabled ? [googleFederationModule, googleFederationConfigModule] : []),
|
|
170
178
|
overrides.keyStoreModule ?? keyStoreModule,
|
package/templates/versions.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
|
-
"@o3co/auth-provider-core": "0.
|
|
3
|
-
"@o3co/auth-provider-dpop": "0.
|
|
4
|
-
"@o3co/auth-provider-mtls": "0.
|
|
5
|
-
"@o3co/auth-provider-federation-google": "0.
|
|
6
|
-
"@o3co/auth-provider-federation-github": "0.
|
|
7
|
-
"@o3co/auth-provider-oauth": "0.
|
|
8
|
-
"@o3co/auth-provider-oauth-token-exchange": "0.
|
|
9
|
-
"@o3co/auth-provider-session": "0.
|
|
10
|
-
"@o3co/auth-provider-foundation": "0.
|
|
11
|
-
"@o3co/auth-provider-redis": "0.
|
|
12
|
-
"@o3co/auth-provider-webauthn": "0.
|
|
2
|
+
"@o3co/auth-provider-core": "0.9.0",
|
|
3
|
+
"@o3co/auth-provider-dpop": "0.9.0",
|
|
4
|
+
"@o3co/auth-provider-mtls": "0.9.0",
|
|
5
|
+
"@o3co/auth-provider-federation-google": "0.9.0",
|
|
6
|
+
"@o3co/auth-provider-federation-github": "0.9.0",
|
|
7
|
+
"@o3co/auth-provider-oauth": "0.9.0",
|
|
8
|
+
"@o3co/auth-provider-oauth-token-exchange": "0.9.0",
|
|
9
|
+
"@o3co/auth-provider-session": "0.9.0",
|
|
10
|
+
"@o3co/auth-provider-foundation": "0.9.0",
|
|
11
|
+
"@o3co/auth-provider-redis": "0.9.0",
|
|
12
|
+
"@o3co/auth-provider-webauthn": "0.9.0"
|
|
13
13
|
}
|