@fluixi/oauth2 1.0.0-alpha.1 → 1.0.0-alpha.100
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/LICENSE +1 -1
- package/dist/backchannel.cjs +462 -0
- package/dist/backchannel.d.ts +39 -0
- package/dist/backchannel.d.ts.map +1 -0
- package/dist/backchannel.js +97 -0
- package/dist/backchannel.mjs +307 -0
- package/dist/{browser-ONMHX3Z3.mjs → browser-TV25RBLT.mjs} +2 -2
- package/dist/browser.cjs +10 -3
- package/dist/browser.mjs +10 -3
- package/dist/callback.cjs +8 -7
- package/dist/callback.js +1 -1
- package/dist/callback.mjs +3 -2
- package/dist/{chunk-4NSOGPLM.mjs → chunk-2B3I72DV.mjs} +1 -1
- package/dist/chunk-KOP5Z4LB.mjs +108 -0
- package/dist/{chunk-25WE6UWI.mjs → chunk-KTGVSZE6.mjs} +1 -1
- package/dist/discovery.cjs +6 -1
- package/dist/discovery.d.ts.map +1 -1
- package/dist/discovery.js +6 -1
- package/dist/discovery.mjs +6 -1
- package/dist/dpop-O3HWR7AH.mjs +22 -0
- package/dist/{dpop-LVPWWADA.mjs → dpop-SGWG3K2I.mjs} +26 -6
- package/dist/{dpop-NS7NKOWM.mjs → dpop-YPGCGL7S.mjs} +22 -2
- package/dist/dpop-store.cjs +4 -2
- package/dist/dpop-store.mjs +4 -2
- package/dist/dpop.cjs +22 -2
- package/dist/dpop.d.ts +18 -1
- package/dist/dpop.d.ts.map +1 -1
- package/dist/dpop.js +23 -2
- package/dist/dpop.mjs +22 -2
- package/dist/index.cjs +135 -10
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.mjs +138 -13
- package/dist/module.cjs +44 -0
- package/dist/module.d.ts +13 -0
- package/dist/module.d.ts.map +1 -0
- package/dist/module.js +22 -0
- package/dist/module.mjs +23 -0
- package/dist/server.cjs +755 -80
- package/dist/server.d.ts +91 -4
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +518 -65
- package/dist/server.mjs +638 -82
- package/dist/service-client.cjs +7 -2
- package/dist/service-client.mjs +9 -4
- package/dist/service.cjs +116 -7
- package/dist/service.d.ts +2 -18
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +48 -5
- package/dist/service.mjs +116 -7
- package/dist/session-monitor.cjs +98 -0
- package/dist/session-monitor.d.ts +32 -0
- package/dist/session-monitor.d.ts.map +1 -0
- package/dist/session-monitor.js +104 -0
- package/dist/session-monitor.mjs +77 -0
- package/dist/tokens.cjs +1 -1
- package/dist/tokens.d.ts +2 -2
- package/dist/tokens.d.ts.map +1 -1
- package/dist/tokens.js +1 -1
- package/dist/tokens.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/types.d.ts +12 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -12
- package/dist/verify.cjs +30 -4
- package/dist/verify.mjs +12 -7
- package/package.json +22 -16
package/dist/verify.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/*! @fluixi/oauth2 v1.0.0-alpha.
|
|
1
|
+
/*! @fluixi/oauth2 v1.0.0-alpha.100 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
|
|
2
2
|
import {
|
|
3
3
|
OAuthError
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-2B3I72DV.mjs";
|
|
5
|
+
import "./chunk-KTGVSZE6.mjs";
|
|
6
6
|
|
|
7
7
|
// src/client-auth.ts
|
|
8
8
|
var CANONICAL = {
|
|
@@ -35,7 +35,7 @@ function assertUsable(auth, who) {
|
|
|
35
35
|
}
|
|
36
36
|
async function loadJose() {
|
|
37
37
|
try {
|
|
38
|
-
return await import("./browser-
|
|
38
|
+
return await import("./browser-TV25RBLT.mjs");
|
|
39
39
|
} catch {
|
|
40
40
|
throw new OAuthError(
|
|
41
41
|
"private_key_jwt needs `jose`. Install it: npm i jose. It is an optional peer, so a client using a secret does not carry it.",
|
|
@@ -85,8 +85,12 @@ async function discover(issuer, fetcher = fetch) {
|
|
|
85
85
|
try {
|
|
86
86
|
response = await fetcher(documentUrl(issuer));
|
|
87
87
|
} catch (cause) {
|
|
88
|
+
const why = cause instanceof Error ? cause.message : String(cause);
|
|
88
89
|
throw new OAuthError(
|
|
89
|
-
|
|
90
|
+
typeof window === "undefined" ? (
|
|
91
|
+
// On a server nothing blocks the read: the provider is down, or the address is wrong.
|
|
92
|
+
`Could not reach the provider at ${documentUrl(issuer)}: is it running, and is the issuer right? (${why})`
|
|
93
|
+
) : `Could not read the discovery document at ${documentUrl(issuer)}. In a browser this is usually the provider refusing a cross-origin read: give \`endpoints\` directly, or resolve them on a server. (${why})`,
|
|
90
94
|
"discovery_unreachable"
|
|
91
95
|
);
|
|
92
96
|
}
|
|
@@ -111,6 +115,7 @@ async function discover(issuer, fetcher = fetch) {
|
|
|
111
115
|
jwks: doc.jwks_uri,
|
|
112
116
|
introspection: doc.introspection_endpoint,
|
|
113
117
|
revocation: doc.revocation_endpoint,
|
|
118
|
+
checkSession: doc.check_session_iframe,
|
|
114
119
|
issuer: doc.issuer ?? issuer
|
|
115
120
|
};
|
|
116
121
|
})();
|
|
@@ -307,7 +312,7 @@ function bearerOf(request) {
|
|
|
307
312
|
}
|
|
308
313
|
async function loadJose2() {
|
|
309
314
|
try {
|
|
310
|
-
return await import("./browser-
|
|
315
|
+
return await import("./browser-TV25RBLT.mjs");
|
|
311
316
|
} catch {
|
|
312
317
|
throw new OAuthError(
|
|
313
318
|
"Token verification needs `jose`. Install it: npm i jose. It is an optional peer so an app that does not verify does not carry it.",
|
|
@@ -359,7 +364,7 @@ function createTokenVerifier(options) {
|
|
|
359
364
|
}
|
|
360
365
|
const checkProof = async (claims, token, request) => {
|
|
361
366
|
const jose = await loadJose2();
|
|
362
|
-
const { boundKeyOf, thumbprintOf } = await import("./dpop-
|
|
367
|
+
const { boundKeyOf, thumbprintOf } = await import("./dpop-SGWG3K2I.mjs");
|
|
363
368
|
const bound = boundKeyOf(claims);
|
|
364
369
|
if (!bound) {
|
|
365
370
|
throw new TokenError(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fluixi/oauth2",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.100",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Ibrahima Touré",
|
|
6
6
|
"description": "OAuth2 / OIDC for Fluixi apps: an AuthClient that drives the flow, and an AuthService built on @fluixi/session. Browser PKCE or a server-held session, chosen by config.",
|
|
@@ -74,28 +74,34 @@
|
|
|
74
74
|
"default": "./dist/env-config.js"
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
"dependencies": {
|
|
77
|
+
"dependencies": {
|
|
78
|
+
"@fluixi/auth": "^1.0.0-alpha.100",
|
|
79
|
+
"@fluixi/session": "^1.0.0-alpha.100"
|
|
80
|
+
},
|
|
78
81
|
"peerDependencies": {
|
|
79
82
|
"jose": ">=5",
|
|
80
|
-
"@fluixi/core": "1.0.0-alpha.
|
|
81
|
-
"@fluixi/
|
|
82
|
-
"@fluixi/
|
|
83
|
-
"@fluixi/
|
|
84
|
-
"@fluixi/server": "1.0.0-alpha.
|
|
85
|
-
"@fluixi/
|
|
83
|
+
"@fluixi/core": "^1.0.0-alpha.100",
|
|
84
|
+
"@fluixi/di": "^1.0.0-alpha.100",
|
|
85
|
+
"@fluixi/dom": "^1.0.0-alpha.100",
|
|
86
|
+
"@fluixi/reactive": "^1.0.0-alpha.100",
|
|
87
|
+
"@fluixi/server": "^1.0.0-alpha.100",
|
|
88
|
+
"@fluixi/start": "^1.0.0-alpha.100",
|
|
89
|
+
"@fluixi/storage": "^1.0.0-alpha.100"
|
|
86
90
|
},
|
|
87
91
|
"devDependencies": {
|
|
88
92
|
"@bambiste/mix-builder": "^0.4.0",
|
|
89
93
|
"cross-env": "^7.0.3",
|
|
90
94
|
"jose": "^5.9.6",
|
|
91
|
-
"@fluixi/
|
|
92
|
-
"@fluixi/
|
|
93
|
-
"@fluixi/
|
|
94
|
-
"@fluixi/
|
|
95
|
-
"@fluixi/
|
|
96
|
-
"@fluixi/
|
|
97
|
-
"@fluixi/
|
|
98
|
-
"@fluixi/
|
|
95
|
+
"@fluixi/auth": "1.0.0-alpha.100",
|
|
96
|
+
"@fluixi/core": "1.0.0-alpha.100",
|
|
97
|
+
"@fluixi/di": "1.0.0-alpha.100",
|
|
98
|
+
"@fluixi/dom": "1.0.0-alpha.100",
|
|
99
|
+
"@fluixi/reactive": "1.0.0-alpha.100",
|
|
100
|
+
"@fluixi/server": "1.0.0-alpha.100",
|
|
101
|
+
"@fluixi/session": "1.0.0-alpha.100",
|
|
102
|
+
"@fluixi/start": "1.0.0-alpha.100",
|
|
103
|
+
"@fluixi/storage": "1.0.0-alpha.100",
|
|
104
|
+
"@fluixi/testing": "1.0.0-alpha.100"
|
|
99
105
|
},
|
|
100
106
|
"peerDependenciesMeta": {
|
|
101
107
|
"@fluixi/start": {
|