@lunora/cloudflare-access 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +1 -1
- package/dist/context.d.mts +2 -1
- package/dist/context.d.ts +2 -1
- package/dist/index.mjs +2 -2
- package/dist/packem_shared/{accessIssuer-DhKaNoyU.mjs → accessIssuer-83KYwaCp.mjs} +4 -2
- package/dist/packem_shared/{composeResolvers-C_7T5dDj.mjs → composeResolvers-BI3envaN.mjs} +1 -1
- package/dist/packem_shared/{index.d-C7lOF4ZA.d.mts → index.d-ByAnpUzP.d.mts} +1 -0
- package/dist/packem_shared/{index.d-C7lOF4ZA.d.ts → index.d-ByAnpUzP.d.ts} +1 -0
- package/dist/roles.d.mts +2 -1
- package/dist/roles.d.ts +2 -1
- package/package.json +3 -2
package/dist/admin.mjs
CHANGED
package/dist/context.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { M as Middleware } from "./packem_shared/index.d-
|
|
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-
|
|
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-
|
|
2
|
-
export { accessIssuer, verifyAccessJwt } from './packem_shared/accessIssuer-
|
|
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
|
|
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
|
|
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
|
}
|
package/dist/roles.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { M as Middleware } from "./packem_shared/index.d-
|
|
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-
|
|
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.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
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.
|
|
61
|
+
"@lunora/server": "1.0.0-alpha.14"
|
|
61
62
|
},
|
|
62
63
|
"peerDependenciesMeta": {
|
|
63
64
|
"@lunora/server": {
|