@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.
Files changed (68) hide show
  1. package/LICENSE +1 -1
  2. package/dist/backchannel.cjs +462 -0
  3. package/dist/backchannel.d.ts +39 -0
  4. package/dist/backchannel.d.ts.map +1 -0
  5. package/dist/backchannel.js +97 -0
  6. package/dist/backchannel.mjs +307 -0
  7. package/dist/{browser-ONMHX3Z3.mjs → browser-TV25RBLT.mjs} +2 -2
  8. package/dist/browser.cjs +10 -3
  9. package/dist/browser.mjs +10 -3
  10. package/dist/callback.cjs +8 -7
  11. package/dist/callback.js +1 -1
  12. package/dist/callback.mjs +3 -2
  13. package/dist/{chunk-4NSOGPLM.mjs → chunk-2B3I72DV.mjs} +1 -1
  14. package/dist/chunk-KOP5Z4LB.mjs +108 -0
  15. package/dist/{chunk-25WE6UWI.mjs → chunk-KTGVSZE6.mjs} +1 -1
  16. package/dist/discovery.cjs +6 -1
  17. package/dist/discovery.d.ts.map +1 -1
  18. package/dist/discovery.js +6 -1
  19. package/dist/discovery.mjs +6 -1
  20. package/dist/dpop-O3HWR7AH.mjs +22 -0
  21. package/dist/{dpop-LVPWWADA.mjs → dpop-SGWG3K2I.mjs} +26 -6
  22. package/dist/{dpop-NS7NKOWM.mjs → dpop-YPGCGL7S.mjs} +22 -2
  23. package/dist/dpop-store.cjs +4 -2
  24. package/dist/dpop-store.mjs +4 -2
  25. package/dist/dpop.cjs +22 -2
  26. package/dist/dpop.d.ts +18 -1
  27. package/dist/dpop.d.ts.map +1 -1
  28. package/dist/dpop.js +23 -2
  29. package/dist/dpop.mjs +22 -2
  30. package/dist/index.cjs +135 -10
  31. package/dist/index.d.ts +3 -0
  32. package/dist/index.d.ts.map +1 -1
  33. package/dist/index.js +2 -0
  34. package/dist/index.mjs +138 -13
  35. package/dist/module.cjs +44 -0
  36. package/dist/module.d.ts +13 -0
  37. package/dist/module.d.ts.map +1 -0
  38. package/dist/module.js +22 -0
  39. package/dist/module.mjs +23 -0
  40. package/dist/server.cjs +755 -80
  41. package/dist/server.d.ts +91 -4
  42. package/dist/server.d.ts.map +1 -1
  43. package/dist/server.js +518 -65
  44. package/dist/server.mjs +638 -82
  45. package/dist/service-client.cjs +7 -2
  46. package/dist/service-client.mjs +9 -4
  47. package/dist/service.cjs +116 -7
  48. package/dist/service.d.ts +2 -18
  49. package/dist/service.d.ts.map +1 -1
  50. package/dist/service.js +48 -5
  51. package/dist/service.mjs +116 -7
  52. package/dist/session-monitor.cjs +98 -0
  53. package/dist/session-monitor.d.ts +32 -0
  54. package/dist/session-monitor.d.ts.map +1 -0
  55. package/dist/session-monitor.js +104 -0
  56. package/dist/session-monitor.mjs +77 -0
  57. package/dist/tokens.cjs +1 -1
  58. package/dist/tokens.d.ts +2 -2
  59. package/dist/tokens.d.ts.map +1 -1
  60. package/dist/tokens.js +1 -1
  61. package/dist/tokens.mjs +1 -1
  62. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  63. package/dist/types.d.ts +12 -2
  64. package/dist/types.d.ts.map +1 -1
  65. package/dist/types.js +0 -12
  66. package/dist/verify.cjs +30 -4
  67. package/dist/verify.mjs +12 -7
  68. package/package.json +22 -16
package/dist/verify.mjs CHANGED
@@ -1,8 +1,8 @@
1
- /*! @fluixi/oauth2 v1.0.0-alpha.1 | (c) 2026 Ibrahima Touré and Fluixi contributors | MIT */
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-4NSOGPLM.mjs";
5
- import "./chunk-25WE6UWI.mjs";
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-ONMHX3Z3.mjs");
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
- `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. (${cause instanceof Error ? cause.message : String(cause)})`,
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-ONMHX3Z3.mjs");
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-LVPWWADA.mjs");
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.1",
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.87",
81
- "@fluixi/reactive": "1.0.0-alpha.87",
82
- "@fluixi/session": "1.0.0-alpha.87",
83
- "@fluixi/start": "0.1.0-alpha.77",
84
- "@fluixi/server": "1.0.0-alpha.87",
85
- "@fluixi/auth": "1.0.0-alpha.87"
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/reactive": "1.0.0-alpha.87",
92
- "@fluixi/session": "1.0.0-alpha.87",
93
- "@fluixi/start": "0.1.0-alpha.77",
94
- "@fluixi/server": "1.0.0-alpha.87",
95
- "@fluixi/auth": "1.0.0-alpha.87",
96
- "@fluixi/core": "1.0.0-alpha.87",
97
- "@fluixi/testing": "1.0.0-alpha.35",
98
- "@fluixi/dom": "1.0.0-alpha.87"
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": {