@lunora/cloudflare-access 1.0.0-alpha.1 → 1.0.0-alpha.10

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/dist/admin.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { verifyRequest } from './packem_shared/accessIssuer-DhKaNoyU.mjs';
1
+ import { verifyRequest } from './packem_shared/accessIssuer-83KYwaCp.mjs';
2
2
 
3
3
  const accessAdminGate = (options) => async (request) => {
4
4
  const claims = await verifyRequest(request, options);
@@ -1,5 +1,6 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.mjs";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.mjs";
2
2
  import { A as AccessClaims } from "./packem_shared/types.d-BO8d74KI.mjs";
3
+ import '@lunora/errors';
3
4
  import 'jose';
4
5
  /**
5
6
  * The slice of context {@link accessContext} reads: the `auth` facade every
package/dist/context.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.js";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.js";
2
2
  import { A as AccessClaims } from "./packem_shared/types.d-BO8d74KI.js";
3
+ import '@lunora/errors';
3
4
  import 'jose';
4
5
  /**
5
6
  * The slice of context {@link accessContext} reads: the `auth` facade every
package/dist/index.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export { composeResolvers, createAccessResolver } from './packem_shared/composeResolvers-C_7T5dDj.mjs';
2
- export { accessIssuer, verifyAccessJwt } from './packem_shared/accessIssuer-DhKaNoyU.mjs';
1
+ export { composeResolvers, createAccessResolver } from './packem_shared/composeResolvers-BI3envaN.mjs';
2
+ export { accessIssuer, verifyAccessJwt } from './packem_shared/accessIssuer-83KYwaCp.mjs';
@@ -1,3 +1,4 @@
1
+ import { LunoraError } from '@lunora/errors';
1
2
  import { jwtVerify, createRemoteJWKSet } from 'jose';
2
3
 
3
4
  const DEFAULT_HEADER = "cf-access-jwt-assertion";
@@ -36,7 +37,7 @@ const stripTrailingSlashes = (value) => {
36
37
  const accessIssuer = (teamDomain) => {
37
38
  const trimmed = stripTrailingSlashes(teamDomain.trim().replace(SCHEME_PREFIX, ""));
38
39
  if (trimmed.length === 0) {
39
- throw new Error('@lunora/cloudflare-access: `teamDomain` is required (e.g. "acme" or "acme.cloudflareaccess.com")');
40
+ throw new LunoraError("INTERNAL", '@lunora/cloudflare-access: `teamDomain` is required (e.g. "acme" or "acme.cloudflareaccess.com")');
40
41
  }
41
42
  const candidate = trimmed.includes(".") ? `https://${trimmed}` : `https://${trimmed}.cloudflareaccess.com`;
42
43
  const host = new URL(candidate).host.toLowerCase();
@@ -57,7 +58,8 @@ const verifyAccessJwt = async (token, options) => {
57
58
  (entry) => typeof entry === "string" && entry.length > 0
58
59
  );
59
60
  if (audiences.length === 0) {
60
- throw new Error(
61
+ throw new LunoraError(
62
+ "INTERNAL",
61
63
  "@lunora/cloudflare-access: `aud` is required and must be a non-empty Access AUD tag — refusing to verify a token without an audience to scope it to your application"
62
64
  );
63
65
  }
@@ -1,4 +1,4 @@
1
- import { verifyRequest } from './accessIssuer-DhKaNoyU.mjs';
1
+ import { verifyRequest } from './accessIssuer-83KYwaCp.mjs';
2
2
 
3
3
  const ANONYMOUS = null;
4
4
  const deriveUserId = (claims) => {
@@ -1,3 +1,4 @@
1
+ import '@lunora/errors';
1
2
  /**
2
3
  * `next()` advances the middleware chain. Called with no argument it forwards
3
4
  * the current context unchanged; called with `{ ctx }` it shallow-merges the
@@ -1,3 +1,4 @@
1
+ import '@lunora/errors';
1
2
  /**
2
3
  * `next()` advances the middleware chain. Called with no argument it forwards
3
4
  * the current context unchanged; called with `{ ctx }` it shallow-merges the
package/dist/roles.d.mts CHANGED
@@ -1,4 +1,5 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.mjs";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.mjs";
2
+ import '@lunora/errors';
2
3
  /**
3
4
  * The slice of context {@link accessRoles} reads and augments: the `auth` facade
4
5
  * every Lunora ctx carries. `getIdentity()` returns the verified identity
package/dist/roles.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- import { M as Middleware } from "./packem_shared/index.d-C7lOF4ZA.js";
1
+ import { M as Middleware } from "./packem_shared/index.d-ByAnpUzP.js";
2
+ import '@lunora/errors';
2
3
  /**
3
4
  * The slice of context {@link accessRoles} reads and augments: the `auth` facade
4
5
  * every Lunora ctx carries. `getIdentity()` returns the verified identity
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/cloudflare-access",
3
- "version": "1.0.0-alpha.1",
3
+ "version": "1.0.0-alpha.10",
4
4
  "description": "Cloudflare Access (Zero Trust) identity for Lunora — verify the Cf-Access-Jwt-Assertion JWT against your team JWKS and feed the verified identity into ctx.auth / RLS via a resolveIdentity adapter",
5
5
  "keywords": [
6
6
  "access",
@@ -54,10 +54,11 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
+ "@lunora/errors": "1.0.0-alpha.1",
57
58
  "jose": "^6.1.0"
58
59
  },
59
60
  "peerDependencies": {
60
- "@lunora/server": "1.0.0-alpha.7"
61
+ "@lunora/server": "1.0.0-alpha.16"
61
62
  },
62
63
  "peerDependenciesMeta": {
63
64
  "@lunora/server": {