@runlot/access 0.1.0-rc.15 → 0.1.0-rc.150
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/index.d.ts +51 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +130 -12
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,19 +1,64 @@
|
|
|
1
1
|
export type AccessMode = "public" | "org" | "password" | "bypass";
|
|
2
2
|
export type OrgRole = "admin" | "member" | "viewer";
|
|
3
3
|
export interface Identity {
|
|
4
|
-
/** front
|
|
4
|
+
/** The mode the front decided. When it is `public`, the rest is empty. */
|
|
5
5
|
mode: AccessMode;
|
|
6
|
-
/**
|
|
6
|
+
/** The user id. In `password` mode it is `pw:…`, in `bypass` it is
|
|
7
|
+
* `bypass`. */
|
|
7
8
|
subject: string | null;
|
|
8
9
|
email: string | null;
|
|
9
10
|
orgRole: OrgRole | null;
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* The identity of the request. When the headers are absent entirely (running
|
|
14
|
+
* outside the front — local `wrangler dev` and the like) it reads as `public`:
|
|
15
|
+
* the front **always** attaches Mode, so its absence means "there was no
|
|
16
|
+
* decision", and that is the same as open.
|
|
15
17
|
*/
|
|
16
18
|
export declare function identity(request: Request): Identity;
|
|
17
|
-
/**
|
|
19
|
+
/** Is there a login — somebody who is neither `public` nor `bypass`. */
|
|
18
20
|
export declare function isSignedIn(who: Identity): boolean;
|
|
21
|
+
export interface AccessClaims {
|
|
22
|
+
iss: string;
|
|
23
|
+
aud: string[];
|
|
24
|
+
/** The user id, or `svc:<name>` for a service credential. */
|
|
25
|
+
sub: string;
|
|
26
|
+
email?: string;
|
|
27
|
+
common_name?: string;
|
|
28
|
+
type: "app";
|
|
29
|
+
idp?: string;
|
|
30
|
+
identity_nonce?: string;
|
|
31
|
+
iat: number;
|
|
32
|
+
nbf: number;
|
|
33
|
+
exp: number;
|
|
34
|
+
runlot: {
|
|
35
|
+
project: string;
|
|
36
|
+
mode: "allow" | "service_auth";
|
|
37
|
+
org_role?: OrgRole;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface VerifyOptions {
|
|
41
|
+
/** The project id the token must be addressed to. */
|
|
42
|
+
aud: string;
|
|
43
|
+
/** The org slug — the `<org>` in `https://<dash>/access/<org>`. */
|
|
44
|
+
org: string;
|
|
45
|
+
/** The dashboard origin. Default `https://dash.runlot.io`. */
|
|
46
|
+
dashboard?: string;
|
|
47
|
+
/** Clock skew allowance in seconds. Default 60. */
|
|
48
|
+
leeway?: number;
|
|
49
|
+
/** Injected for tests or non-global runtimes. */
|
|
50
|
+
fetch?: (input: string, init?: RequestInit) => Promise<Response>;
|
|
51
|
+
}
|
|
52
|
+
export declare class AccessVerifyError extends Error {
|
|
53
|
+
constructor(message: string);
|
|
54
|
+
}
|
|
55
|
+
export declare const ACCESS_JWT_HEADER = "Runlot-Access-Jwt";
|
|
56
|
+
/** Test hook: drop every cached key set. */
|
|
57
|
+
export declare function _resetJwksCache(): void;
|
|
58
|
+
/**
|
|
59
|
+
* Verify the request's `Runlot-Access-Jwt`. Resolves to the claims, or rejects
|
|
60
|
+
* with `AccessVerifyError` (missing, malformed, wrong signature, issuer,
|
|
61
|
+
* audience, or time).
|
|
62
|
+
*/
|
|
63
|
+
export declare function verify(request: Request, opts: VerifyOptions): Promise<AccessClaims>;
|
|
19
64
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAcA,MAAM,MAAM,UAAU,GAAG,QAAQ,GAAG,KAAK,GAAG,UAAU,GAAG,QAAQ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D,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;CAClE;AAED,qBAAa,iBAAkB,SAAQ,KAAK;gBAC9B,OAAO,EAAE,MAAM;CAI5B;AAED,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAUrD,4CAA4C;AAC5C,wBAAgB,eAAe,IAAI,IAAI,CAGtC;AAiDD;;;;GAIG;AACH,wBAAsB,MAAM,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,YAAY,CAAC,CAuCzF"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,23 @@
|
|
|
1
|
-
// `identity(request)` —
|
|
1
|
+
// `identity(request)` — reads the identity the front attached
|
|
2
|
+
// (docs/access.md §4.2).
|
|
2
3
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
4
|
+
// Reading it from the request rather than from `env.auth` is a constraint, not
|
|
5
|
+
// a taste: `env` is a bundle fixed for the lifetime of the worker, and the
|
|
6
|
+
// identity is a different value on every request. Reading it from the request
|
|
7
|
+
// means the problem of an implicit store (AsyncLocalStorage) being cut at a
|
|
8
|
+
// streaming or waitUntil boundary does not exist at all.
|
|
7
9
|
//
|
|
8
|
-
//
|
|
9
|
-
// (proto/front-headers.md).
|
|
10
|
-
//
|
|
10
|
+
// The headers cannot be forged, because the front attaches them after erasing
|
|
11
|
+
// every inbound `Runlot-*` (proto/front-headers.md). This function **trusts**
|
|
12
|
+
// that — there is no deployment where a worker is opened directly without
|
|
13
|
+
// passing through the front.
|
|
11
14
|
const MODES = new Set(["public", "org", "password", "bypass"]);
|
|
12
15
|
const ROLES = new Set(["admin", "member", "viewer"]);
|
|
13
16
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
+
* The identity of the request. When the headers are absent entirely (running
|
|
18
|
+
* outside the front — local `wrangler dev` and the like) it reads as `public`:
|
|
19
|
+
* the front **always** attaches Mode, so its absence means "there was no
|
|
20
|
+
* decision", and that is the same as open.
|
|
17
21
|
*/
|
|
18
22
|
export function identity(request) {
|
|
19
23
|
const h = request.headers;
|
|
@@ -29,8 +33,122 @@ export function identity(request) {
|
|
|
29
33
|
orgRole: rawRole !== null && ROLES.has(rawRole) ? rawRole : null,
|
|
30
34
|
};
|
|
31
35
|
}
|
|
32
|
-
/**
|
|
36
|
+
/** Is there a login — somebody who is neither `public` nor `bypass`. */
|
|
33
37
|
export function isSignedIn(who) {
|
|
34
38
|
return who.mode === "org";
|
|
35
39
|
}
|
|
40
|
+
export class AccessVerifyError extends Error {
|
|
41
|
+
constructor(message) {
|
|
42
|
+
super(message);
|
|
43
|
+
this.name = "AccessVerifyError";
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
export const ACCESS_JWT_HEADER = "Runlot-Access-Jwt";
|
|
47
|
+
const JWKS_TTL_MS = 5 * 60 * 1000;
|
|
48
|
+
const REFETCH_MIN_MS = 30 * 1000;
|
|
49
|
+
const jwksCache = new Map();
|
|
50
|
+
/** Test hook: drop every cached key set. */
|
|
51
|
+
export function _resetJwksCache() {
|
|
52
|
+
jwksCache.clear();
|
|
53
|
+
missRefetchAt.clear();
|
|
54
|
+
}
|
|
55
|
+
function b64urlDecode(s) {
|
|
56
|
+
const pad = s.length % 4 === 0 ? "" : "=".repeat(4 - (s.length % 4));
|
|
57
|
+
const bin = atob(s.replace(/-/g, "+").replace(/_/g, "/") + pad);
|
|
58
|
+
const out = new Uint8Array(bin.length);
|
|
59
|
+
for (let i = 0; i < bin.length; i++)
|
|
60
|
+
out[i] = bin.charCodeAt(i);
|
|
61
|
+
return out;
|
|
62
|
+
}
|
|
63
|
+
async function loadJwks(url, f) {
|
|
64
|
+
const res = await f(url, { headers: { accept: "application/json" } });
|
|
65
|
+
if (!res.ok)
|
|
66
|
+
throw new AccessVerifyError(`JWKS fetch failed: ${res.status}`);
|
|
67
|
+
const body = (await res.json());
|
|
68
|
+
const keys = new Map();
|
|
69
|
+
for (const k of body.keys ?? []) {
|
|
70
|
+
if (k.kty !== "EC" || k.crv !== "P-256" || !k.kid || !k.x || !k.y)
|
|
71
|
+
continue;
|
|
72
|
+
const jwk = { kty: "EC", crv: "P-256", x: k.x, y: k.y, ext: true };
|
|
73
|
+
const key = await crypto.subtle.importKey("jwk", jwk, { name: "ECDSA", namedCurve: "P-256" }, false, ["verify"]);
|
|
74
|
+
keys.set(k.kid, key);
|
|
75
|
+
}
|
|
76
|
+
return { keys, fetchedAt: Date.now() };
|
|
77
|
+
}
|
|
78
|
+
async function keyFor(url, kid, f) {
|
|
79
|
+
const now = Date.now();
|
|
80
|
+
const cached = jwksCache.get(url);
|
|
81
|
+
const entry = cached ? await cached.catch(() => undefined) : undefined;
|
|
82
|
+
if (entry && now - entry.fetchedAt < JWKS_TTL_MS) {
|
|
83
|
+
if (entry.keys.has(kid))
|
|
84
|
+
return entry.keys.get(kid);
|
|
85
|
+
// An unknown kid is either a rotation (refetch now) or garbage (do not let
|
|
86
|
+
// it turn every request into a JWKS fetch): at most one refetch per window.
|
|
87
|
+
if (now - (missRefetchAt.get(url) ?? 0) < REFETCH_MIN_MS)
|
|
88
|
+
return undefined;
|
|
89
|
+
missRefetchAt.set(url, now);
|
|
90
|
+
}
|
|
91
|
+
const p = loadJwks(url, f);
|
|
92
|
+
jwksCache.set(url, p);
|
|
93
|
+
try {
|
|
94
|
+
return (await p).keys.get(kid);
|
|
95
|
+
}
|
|
96
|
+
catch (e) {
|
|
97
|
+
jwksCache.delete(url);
|
|
98
|
+
throw e instanceof AccessVerifyError ? e : new AccessVerifyError(`JWKS fetch failed: ${String(e)}`);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const missRefetchAt = new Map();
|
|
102
|
+
/**
|
|
103
|
+
* Verify the request's `Runlot-Access-Jwt`. Resolves to the claims, or rejects
|
|
104
|
+
* with `AccessVerifyError` (missing, malformed, wrong signature, issuer,
|
|
105
|
+
* audience, or time).
|
|
106
|
+
*/
|
|
107
|
+
export async function verify(request, opts) {
|
|
108
|
+
const tok = request.headers.get(ACCESS_JWT_HEADER);
|
|
109
|
+
if (!tok)
|
|
110
|
+
throw new AccessVerifyError("no Runlot-Access-Jwt header");
|
|
111
|
+
const parts = tok.split(".");
|
|
112
|
+
if (parts.length !== 3)
|
|
113
|
+
throw new AccessVerifyError("malformed token");
|
|
114
|
+
const [h64, p64, s64] = parts;
|
|
115
|
+
let header;
|
|
116
|
+
let claims;
|
|
117
|
+
try {
|
|
118
|
+
header = JSON.parse(new TextDecoder().decode(b64urlDecode(h64)));
|
|
119
|
+
claims = JSON.parse(new TextDecoder().decode(b64urlDecode(p64)));
|
|
120
|
+
}
|
|
121
|
+
catch {
|
|
122
|
+
throw new AccessVerifyError("malformed token");
|
|
123
|
+
}
|
|
124
|
+
if (header.alg !== "ES256" || !header.kid)
|
|
125
|
+
throw new AccessVerifyError("unsupported token header");
|
|
126
|
+
const iss = `${(opts.dashboard ?? "https://dash.runlot.io").replace(/\/+$/, "")}/access/${opts.org}`;
|
|
127
|
+
const f = opts.fetch ?? ((input, init) => fetch(input, init));
|
|
128
|
+
const key = await keyFor(`${iss}/certs`, header.kid, f);
|
|
129
|
+
if (!key)
|
|
130
|
+
throw new AccessVerifyError("unknown signing key");
|
|
131
|
+
let sig;
|
|
132
|
+
try {
|
|
133
|
+
sig = b64urlDecode(s64);
|
|
134
|
+
}
|
|
135
|
+
catch {
|
|
136
|
+
throw new AccessVerifyError("malformed signature");
|
|
137
|
+
}
|
|
138
|
+
const ok = sig.length === 64 && await crypto.subtle.verify({ name: "ECDSA", hash: "SHA-256" }, key, sig, new TextEncoder().encode(`${h64}.${p64}`));
|
|
139
|
+
if (!ok)
|
|
140
|
+
throw new AccessVerifyError("bad signature");
|
|
141
|
+
if (claims.iss !== iss)
|
|
142
|
+
throw new AccessVerifyError("wrong issuer");
|
|
143
|
+
const aud = Array.isArray(claims.aud) ? claims.aud : [claims.aud];
|
|
144
|
+
if (!aud.includes(opts.aud))
|
|
145
|
+
throw new AccessVerifyError("wrong audience");
|
|
146
|
+
const now = Math.floor(Date.now() / 1000);
|
|
147
|
+
const leeway = opts.leeway ?? 60;
|
|
148
|
+
if (typeof claims.exp !== "number" || now >= claims.exp + leeway)
|
|
149
|
+
throw new AccessVerifyError("expired");
|
|
150
|
+
if (typeof claims.nbf === "number" && now < claims.nbf - leeway)
|
|
151
|
+
throw new AccessVerifyError("not yet valid");
|
|
152
|
+
return claims;
|
|
153
|
+
}
|
|
36
154
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,yBAAyB;AACzB,EAAE;AACF,+EAA+E;AAC/E,2EAA2E;AAC3E,8EAA8E;AAC9E,4EAA4E;AAC5E,yDAAyD;AACzD,EAAE;AACF,8EAA8E;AAC9E,8EAA8E;AAC9E,0EAA0E;AAC1E,6BAA6B;AAe7B,MAAM,KAAK,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC;AACpF,MAAM,KAAK,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAE1E;;;;;GAKG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAgB;IACvC,MAAM,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAC1B,MAAM,OAAO,GAAG,CAAC,CAAC,GAAG,CAAC,oBAAoB,CAAC,IAAI,QAAQ,CAAC;IACxD,MAAM,IAAI,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,O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ity (Runlot-Access-* headers) that Runlot attaches to a request",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"@types/node": "^22.10.2",
|
|
27
27
|
"esbuild": "^0.24.2",
|
|
28
28
|
"typescript": "^5.7.2",
|
|
29
|
-
"@runlot/config": "0.1.0-rc.
|
|
29
|
+
"@runlot/config": "0.1.0-rc.150"
|
|
30
30
|
},
|
|
31
31
|
"scripts": {
|
|
32
32
|
"test": "node build.mjs",
|