@cotal-ai/auth 0.58.0 → 0.59.0
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/authority-client.d.ts.map +1 -1
- package/dist/authority-client.js +5 -1
- package/dist/authority-client.js.map +1 -1
- package/dist/barrier-evict.d.ts +7 -0
- package/dist/barrier-evict.d.ts.map +1 -1
- package/dist/barrier-evict.js +83 -21
- package/dist/barrier-evict.js.map +1 -1
- package/dist/callout.d.ts.map +1 -1
- package/dist/callout.js +9 -3
- package/dist/callout.js.map +1 -1
- package/dist/commands.js +18 -11
- package/dist/commands.js.map +1 -1
- package/dist/grant-command.d.ts +9 -8
- package/dist/grant-command.d.ts.map +1 -1
- package/dist/grant-command.js +9 -8
- package/dist/grant-command.js.map +1 -1
- package/dist/idp.d.ts +10 -1
- package/dist/idp.d.ts.map +1 -1
- package/dist/idp.js +11 -3
- package/dist/idp.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/issuer.d.ts +3 -1
- package/dist/issuer.d.ts.map +1 -1
- package/dist/issuer.js +6 -2
- package/dist/issuer.js.map +1 -1
- package/dist/ledger.d.ts +6 -7
- package/dist/ledger.d.ts.map +1 -1
- package/dist/ledger.js +1 -1
- package/dist/ledger.js.map +1 -1
- package/dist/managed-agent-enrollment.d.ts +29 -1
- package/dist/managed-agent-enrollment.d.ts.map +1 -1
- package/dist/managed-agent-enrollment.js +45 -1
- package/dist/managed-agent-enrollment.js.map +1 -1
- package/dist/permissions.d.ts +15 -1
- package/dist/permissions.d.ts.map +1 -1
- package/dist/permissions.js +20 -1
- package/dist/permissions.js.map +1 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/provider.js +36 -11
- package/dist/provider.js.map +1 -1
- package/dist/service.d.ts +22 -1
- package/dist/service.d.ts.map +1 -1
- package/dist/service.js +57 -7
- package/dist/service.js.map +1 -1
- package/dist/session-redemption.d.ts +51 -0
- package/dist/session-redemption.d.ts.map +1 -0
- package/dist/session-redemption.js +61 -0
- package/dist/session-redemption.js.map +1 -0
- package/dist/token.d.ts +15 -2
- package/dist/token.d.ts.map +1 -1
- package/dist/token.js +30 -3
- package/dist/token.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* #2312: the identity plane's decision for a user-mode session redemption.
|
|
3
|
+
*
|
|
4
|
+
* On a user-auth mesh the CLI holds no seed, so it cannot mint the per-session `session-caller`
|
|
5
|
+
* credential the static arm signs locally. Instead it presents its bearer identity together with the
|
|
6
|
+
* session grant, and THIS module decides whether that principal may hold that one session. The
|
|
7
|
+
* manager signs grants with an in-memory key the auth plane never sees, so the verifiable artifact is
|
|
8
|
+
* the durable `session.<sessionId>` row the manager's redemption wrote (create-only CAS, then
|
|
9
|
+
* finalized `active`), read leader-served from the dedicated sessions store. The grant's signature
|
|
10
|
+
* must equal the row's `grantSig`, so a forged or altered grant that reuses a session id refuses.
|
|
11
|
+
*
|
|
12
|
+
* Run at the exchange (before a bearer is signed) and again at the callout mint (before the broker
|
|
13
|
+
* credential exists), so a session that ends or a manager that restarts in between still refuses.
|
|
14
|
+
*/
|
|
15
|
+
import type { JetStreamManager } from "@nats-io/jetstream";
|
|
16
|
+
import type { UserTokenSession } from "./token.js";
|
|
17
|
+
/** What the verifier reads: the leader-served session row, and the serving manager's current gate. */
|
|
18
|
+
export interface SessionRedemptionReads {
|
|
19
|
+
jsm: JetStreamManager;
|
|
20
|
+
space: string;
|
|
21
|
+
/** The serving manager gate's verdict for (owner, instanceId) and its current process epoch. */
|
|
22
|
+
managerGate: (owner: string, instanceId: string) => Promise<{
|
|
23
|
+
verdict: string;
|
|
24
|
+
processEpoch?: number;
|
|
25
|
+
}>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Decide whether `principal` (owner + actor + lifecycleUid from a validated bearer) may hold the
|
|
29
|
+
* session named by `claim`. `grantSig` is present at the exchange (the presented grant) and absent at
|
|
30
|
+
* the callout, which re-checks the same row by its coordinates. Returns the session claim to stamp,
|
|
31
|
+
* with the expiry taken from the ROW (unix seconds), never from the caller. THROWS to refuse.
|
|
32
|
+
*/
|
|
33
|
+
export declare function verifySessionRedemption(r: SessionRedemptionReads, principal: {
|
|
34
|
+
owner: string;
|
|
35
|
+
actor: string;
|
|
36
|
+
lifecycleUid?: string;
|
|
37
|
+
}, claim: {
|
|
38
|
+
endpoint: string;
|
|
39
|
+
sessionId: string;
|
|
40
|
+
epoch: number;
|
|
41
|
+
grantSig?: string;
|
|
42
|
+
}, now?: number): Promise<UserTokenSession>;
|
|
43
|
+
/** The grant fields the exchange reads. The grant is never trusted for anything the row does not
|
|
44
|
+
* confirm: only its coordinates select the row, and its signature must equal the row's. */
|
|
45
|
+
export declare function grantCoordinates(raw: unknown): {
|
|
46
|
+
endpoint: string;
|
|
47
|
+
sessionId: string;
|
|
48
|
+
epoch: number;
|
|
49
|
+
grantSig: string;
|
|
50
|
+
};
|
|
51
|
+
//# sourceMappingURL=session-redemption.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-redemption.d.ts","sourceRoot":"","sources":["../src/session-redemption.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AACH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAE3D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,sGAAsG;AACtG,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,gBAAgB,CAAC;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,gGAAgG;IAChG,WAAW,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,YAAY,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACzG;AA8BD;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,CAAC,EAAE,sBAAsB,EACzB,SAAS,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,EAClE,KAAK,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,EAChF,GAAG,GAAE,MAAmB,GACvB,OAAO,CAAC,gBAAgB,CAAC,CAc3B;AAED;4FAC4F;AAC5F,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAMvH"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { EpEnvelopeError, sessionLedgerKey, sessionsBucket } from "@cotal-ai/core";
|
|
2
|
+
const deny = (why) => {
|
|
3
|
+
throw new EpEnvelopeError("permission-denied", `session redemption refused: ${why}`);
|
|
4
|
+
};
|
|
5
|
+
async function readRow(r, sessionId) {
|
|
6
|
+
const bucket = sessionsBucket(r.space);
|
|
7
|
+
let m;
|
|
8
|
+
try {
|
|
9
|
+
m = await r.jsm.streams.getMessage(`KV_${bucket}`, { last_by_subj: `$KV.${bucket}.${sessionLedgerKey(sessionId)}` });
|
|
10
|
+
}
|
|
11
|
+
catch (e) {
|
|
12
|
+
if (e.code === 10037)
|
|
13
|
+
deny(`no session row for ${sessionId}`);
|
|
14
|
+
throw e;
|
|
15
|
+
}
|
|
16
|
+
if (!m)
|
|
17
|
+
deny(`no session row for ${sessionId}`);
|
|
18
|
+
if (m.header?.get("KV-Operation"))
|
|
19
|
+
deny(`the session row for ${sessionId} is deleted`);
|
|
20
|
+
return JSON.parse(new TextDecoder().decode(m.data));
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Decide whether `principal` (owner + actor + lifecycleUid from a validated bearer) may hold the
|
|
24
|
+
* session named by `claim`. `grantSig` is present at the exchange (the presented grant) and absent at
|
|
25
|
+
* the callout, which re-checks the same row by its coordinates. Returns the session claim to stamp,
|
|
26
|
+
* with the expiry taken from the ROW (unix seconds), never from the caller. THROWS to refuse.
|
|
27
|
+
*/
|
|
28
|
+
export async function verifySessionRedemption(r, principal, claim, now = Date.now()) {
|
|
29
|
+
const row = await readRow(r, claim.sessionId);
|
|
30
|
+
if (row.state !== "active")
|
|
31
|
+
deny(`session ${claim.sessionId} is "${row.state}", not active`);
|
|
32
|
+
if (claim.grantSig !== undefined && row.grantSig !== claim.grantSig)
|
|
33
|
+
deny("the presented grant is not the one this session was redeemed with");
|
|
34
|
+
const holder = `${principal.owner}.${principal.actor}`;
|
|
35
|
+
if (row.holder.principal !== holder)
|
|
36
|
+
deny(`session ${claim.sessionId} was issued to ${row.holder.principal}, not ${holder}`);
|
|
37
|
+
if (principal.lifecycleUid === undefined || row.holder.lifecycleUid !== principal.lifecycleUid)
|
|
38
|
+
deny("the bearer's lifecycle is not the session holder's");
|
|
39
|
+
if (row.endpoint !== claim.endpoint)
|
|
40
|
+
deny(`session ${claim.sessionId} is on endpoint ${row.endpoint}, not ${claim.endpoint}`);
|
|
41
|
+
if (row.serving.epoch !== claim.epoch)
|
|
42
|
+
deny(`session ${claim.sessionId} is pinned to serving epoch ${row.serving.epoch}, not ${claim.epoch}`);
|
|
43
|
+
if (row.exp <= now)
|
|
44
|
+
deny(`session ${claim.sessionId} expired at ${new Date(row.exp).toISOString()}`);
|
|
45
|
+
const gate = await r.managerGate(principal.owner, row.serving.instanceId);
|
|
46
|
+
if (gate.verdict !== "candidate")
|
|
47
|
+
deny(`the serving manager ${row.serving.instanceId} is ${gate.verdict}`);
|
|
48
|
+
if (gate.processEpoch !== row.serving.epoch)
|
|
49
|
+
deny(`the serving manager's epoch is ${String(gate.processEpoch)}, not the session's ${row.serving.epoch}`);
|
|
50
|
+
return { endpoint: row.endpoint, sessionId: row.sessionId, epoch: row.serving.epoch, exp: Math.floor(row.exp / 1000) };
|
|
51
|
+
}
|
|
52
|
+
/** The grant fields the exchange reads. The grant is never trusted for anything the row does not
|
|
53
|
+
* confirm: only its coordinates select the row, and its signature must equal the row's. */
|
|
54
|
+
export function grantCoordinates(raw) {
|
|
55
|
+
const g = raw;
|
|
56
|
+
if (!g || typeof g !== "object" || typeof g.sessionId !== "string" || typeof g.endpoint !== "string" ||
|
|
57
|
+
typeof g.sig !== "string" || typeof g.serving?.epoch !== "number")
|
|
58
|
+
throw new Error("sessionGrant is not a session grant");
|
|
59
|
+
return { endpoint: g.endpoint, sessionId: g.sessionId, epoch: g.serving.epoch, grantSig: g.sig };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=session-redemption.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-redemption.js","sourceRoot":"","sources":["../src/session-redemption.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,cAAc,EAAqB,MAAM,gBAAgB,CAAC;AAqBtG,MAAM,IAAI,GAAG,CAAC,GAAW,EAAS,EAAE;IAClC,MAAM,IAAI,eAAe,CAAC,mBAAmB,EAAE,+BAA+B,GAAG,EAAE,CAAC,CAAC;AACvF,CAAC,CAAC;AAEF,KAAK,UAAU,OAAO,CAAC,CAAyB,EAAE,SAAiB;IACjE,MAAM,MAAM,GAAG,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACvC,IAAI,CAAC,CAAC;IACN,IAAI,CAAC;QACH,CAAC,GAAG,MAAM,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,MAAM,EAAE,EAAE,EAAE,YAAY,EAAE,OAAO,MAAM,IAAI,gBAAgB,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AK,EAAE,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,CAAC;AACzH,CAAC;AAED;4FAC4F;AAC5F,MAAM,UAAU,gBAAgB,CAAC,GAAY;IAC3C,MAAM,CAAC,GAAG,GAAmC,CAAC;IAC9C,IAAI,CAAC,CAAC,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,SAAS,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,QAAQ,KAAK,QAAQ;QAChG,OAAO,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,KAAK,QAAQ;QACnE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;AACnG,CAAC"}
|
package/dist/token.d.ts
CHANGED
|
@@ -13,18 +13,26 @@ export declare const MAX_TOKEN_TTL_SEC = 900;
|
|
|
13
13
|
* instead of `agent`. A closed enum on BOTH the mint and validate side — an unknown view fails
|
|
14
14
|
* closed, never falls back to a profile. Deliberately NOT a generic `view=<profile>` passthrough:
|
|
15
15
|
* most profiles are daemon/provisioning surfaces that must never become human-requestable. */
|
|
16
|
-
export declare const USER_TOKEN_VIEWS: readonly ["admin", "purger", "channel-purger", "channel-writer", "deployer", "manager-service", "manager-caller"];
|
|
16
|
+
export declare const USER_TOKEN_VIEWS: readonly ["admin", "purger", "channel-purger", "channel-writer", "deployer", "manager-service", "manager-caller", "session-caller"];
|
|
17
17
|
export type UserTokenView = (typeof USER_TOKEN_VIEWS)[number];
|
|
18
18
|
/** Views the public exchange face will mint (still ledger-gated). Every other
|
|
19
19
|
* {@link USER_TOKEN_VIEWS} value stays loopback-only. An actor-secret exchange may request
|
|
20
20
|
* only manager-caller, which narrows its existing command authority to one instance. */
|
|
21
|
-
export declare const PUBLIC_EXCHANGE_VIEWS: readonly ["channel-writer", "channel-purger", "manager-caller"];
|
|
21
|
+
export declare const PUBLIC_EXCHANGE_VIEWS: readonly ["channel-writer", "channel-purger", "manager-caller", "session-caller"];
|
|
22
22
|
/** The ONE central view policy table: which ledger capability each view's exchange requires (and
|
|
23
23
|
* the callout re-asserts, defense in depth). `admin` = operator authority (god-view read +
|
|
24
24
|
* destructive space writes); `deployer` is spawn-grade — deploying YOUR OWN team's manifest rides
|
|
25
25
|
* the same owner-domain model as own-agent stop/attach (the manager still enforces owner equality
|
|
26
26
|
* at launch, and the view's control grant is the PRIVILEGED tier, never the admin bypass). */
|
|
27
27
|
export declare const VIEW_REQUIRED_SCOPE: Record<UserTokenView, "admin" | "spawn" | "supervise" | undefined>;
|
|
28
|
+
/** The ONE §13.6 session a `session-caller` bearer may open: the rail coordinates plus the grant
|
|
29
|
+
* expiry (unix seconds) the minted connection is bound to, exactly what the static arm mints. */
|
|
30
|
+
export interface UserTokenSession {
|
|
31
|
+
endpoint: string;
|
|
32
|
+
sessionId: string;
|
|
33
|
+
epoch: number;
|
|
34
|
+
exp: number;
|
|
35
|
+
}
|
|
28
36
|
/** The server-authored actor claim. `owner` restates `sub` (cross-checked); `actor` is the
|
|
29
37
|
* ledger-derived agent-instance id; `parent` is at most ONE spawner audit link; `view` is the
|
|
30
38
|
* exchange-authorized elevated profile request (absent = the agent profile). */
|
|
@@ -48,6 +56,8 @@ export interface UserTokenActor {
|
|
|
48
56
|
view?: UserTokenView;
|
|
49
57
|
/** The one manager instance a manager-caller bearer may address. */
|
|
50
58
|
managerInstanceId?: string;
|
|
59
|
+
/** The one session a session-caller bearer may open (#2312). */
|
|
60
|
+
session?: UserTokenSession;
|
|
51
61
|
}
|
|
52
62
|
/** A fully validated user token, reduced to what the callout needs. */
|
|
53
63
|
export interface ValidatedUserToken {
|
|
@@ -72,6 +82,9 @@ export interface ValidatedUserToken {
|
|
|
72
82
|
* `cred.<uid>.<credid>` tail grammar; the STATE match is the connect boundary's job). Shared by
|
|
73
83
|
* the mint side (the issuer, so the mint ↔ validate inverse holds) and this validator. THROWS. */
|
|
74
84
|
export declare function assertCredentialIdClaim(v: unknown): asserts v is string;
|
|
85
|
+
/** Assert a `session` claim is the closed `{endpoint, sessionId, epoch, exp}` shape. Shared by the
|
|
86
|
+
* issuer (mint side) and the validator so the inverse holds. THROWS. */
|
|
87
|
+
export declare function assertSessionClaim(v: unknown): asserts v is UserTokenSession;
|
|
75
88
|
export interface ValidateUserTokenOpts {
|
|
76
89
|
/** The pinned verification key path: a `createRemoteJWKSet(new URL(<pinned origin>))` resolver
|
|
77
90
|
* or a local public key. The token itself NEVER influences where the key comes from. */
|
package/dist/token.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGvD;4EAC4E;AAC5E,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;8CAC8C;AAC9C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;+FAO+F;AAC/F,eAAO,MAAM,gBAAgB,
|
|
1
|
+
{"version":3,"file":"token.d.ts","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,MAAM,CAAC;AAGvD;4EAC4E;AAC5E,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;8CAC8C;AAC9C,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC;;;;;;;+FAO+F;AAC/F,eAAO,MAAM,gBAAgB,qIAAsI,CAAC;AACpK,MAAM,MAA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AE,MAAM,CAAC;CACb;AAMD;;mGAEmG;AACnG,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,IAAI,MAAM,CAGvE;AAED;yEACyE;AACzE,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,IAAI,gBAAgB,CAQ5E;AAED,MAAM,WAAW,qBAAqB;IACpC;6FACyF;IACzF,GAAG,EAAE,eAAe,GAAG,SAAS,CAAC;IACjC,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,QAAQ,EAAE,MAAM,CAAC;IACjB,uFAAuF;IACvF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED;;mBAEmB;AACnB,wBAAsB,iBAAiB,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,qBAAqB,GAAG,OAAO,CAAC,kBAAkB,CAAC,CA4G/G"}
|
package/dist/token.js
CHANGED
|
@@ -33,11 +33,11 @@ export const MAX_TOKEN_TTL_SEC = 900;
|
|
|
33
33
|
* instead of `agent`. A closed enum on BOTH the mint and validate side — an unknown view fails
|
|
34
34
|
* closed, never falls back to a profile. Deliberately NOT a generic `view=<profile>` passthrough:
|
|
35
35
|
* most profiles are daemon/provisioning surfaces that must never become human-requestable. */
|
|
36
|
-
export const USER_TOKEN_VIEWS = ["admin", "purger", "channel-purger", "channel-writer", "deployer", "manager-service", "manager-caller"];
|
|
36
|
+
export const USER_TOKEN_VIEWS = ["admin", "purger", "channel-purger", "channel-writer", "deployer", "manager-service", "manager-caller", "session-caller"];
|
|
37
37
|
/** Views the public exchange face will mint (still ledger-gated). Every other
|
|
38
38
|
* {@link USER_TOKEN_VIEWS} value stays loopback-only. An actor-secret exchange may request
|
|
39
39
|
* only manager-caller, which narrows its existing command authority to one instance. */
|
|
40
|
-
export const PUBLIC_EXCHANGE_VIEWS = ["channel-writer", "channel-purger", "manager-caller"];
|
|
40
|
+
export const PUBLIC_EXCHANGE_VIEWS = ["channel-writer", "channel-purger", "manager-caller", "session-caller"];
|
|
41
41
|
/** The ONE central view policy table: which ledger capability each view's exchange requires (and
|
|
42
42
|
* the callout re-asserts, defense in depth). `admin` = operator authority (god-view read +
|
|
43
43
|
* destructive space writes); `deployer` is spawn-grade — deploying YOUR OWN team's manifest rides
|
|
@@ -51,6 +51,9 @@ export const VIEW_REQUIRED_SCOPE = {
|
|
|
51
51
|
deployer: "spawn",
|
|
52
52
|
"manager-service": "supervise",
|
|
53
53
|
"manager-caller": undefined, // baseline self calls are allowed; command grants still derive from scope
|
|
54
|
+
// #2312: no ledger scope. The grant itself is the authority: the auth plane verifies the redeemed
|
|
55
|
+
// `session.<id>` row names THIS principal as holder, at the exchange and again at the callout mint.
|
|
56
|
+
"session-caller": undefined,
|
|
54
57
|
};
|
|
55
58
|
/** A KV-safe key segment: the ledger's `cred.` key alphabet. Kept local to the validator (not
|
|
56
59
|
* imported from the credential ledger) so the trust boundary carries no KV dependency. */
|
|
@@ -62,6 +65,23 @@ export function assertCredentialIdClaim(v) {
|
|
|
62
65
|
if (typeof v !== "string" || v.length === 0 || v.length > 256 || !v.split(".").every((s) => CREDENTIAL_ID_SEGMENT.test(s)))
|
|
63
66
|
throw new Error(`user token: act.credentialId ${JSON.stringify(v)} is not a bounded dotted KV-safe credential id`);
|
|
64
67
|
}
|
|
68
|
+
/** Assert a `session` claim is the closed `{endpoint, sessionId, epoch, exp}` shape. Shared by the
|
|
69
|
+
* issuer (mint side) and the validator so the inverse holds. THROWS. */
|
|
70
|
+
export function assertSessionClaim(v) {
|
|
71
|
+
const o = v;
|
|
72
|
+
if (!o || typeof o !== "object" || Array.isArray(o))
|
|
73
|
+
throw new Error("user token: act.session must be an object");
|
|
74
|
+
for (const k of Object.keys(o))
|
|
75
|
+
if (!["endpoint", "sessionId", "epoch", "exp"].includes(k))
|
|
76
|
+
throw new Error(`user token: act.session carries the unknown field "${k}"`);
|
|
77
|
+
if (typeof o.endpoint !== "string" || !/^[A-Za-z0-9_-]{1,64}$/.test(o.endpoint))
|
|
78
|
+
throw new Error("user token: act.session.endpoint is not an endpoint token");
|
|
79
|
+
if (typeof o.sessionId !== "string" || !/^[A-Za-z0-9_-]{22,128}$/.test(o.sessionId))
|
|
80
|
+
throw new Error("user token: act.session.sessionId is not a session id");
|
|
81
|
+
for (const k of ["epoch", "exp"])
|
|
82
|
+
if (typeof o[k] !== "number" || !Number.isSafeInteger(o[k]) || o[k] < 0)
|
|
83
|
+
throw new Error(`user token: act.session.${k} is not an unsigned integer`);
|
|
84
|
+
}
|
|
65
85
|
/** Validate a user bearer token. Returns the reduced, validated claims or THROWS — there is no
|
|
66
86
|
* partially-valid result and no fallback (a validation failure at the callout is a denied
|
|
67
87
|
* connection). */
|
|
@@ -139,6 +159,13 @@ export async function validateUserToken(token, opts) {
|
|
|
139
159
|
throw new Error('user token: view "manager-caller" requires act.managerInstanceId');
|
|
140
160
|
if (act.managerInstanceId !== undefined && act.view !== "manager-caller")
|
|
141
161
|
throw new Error('user token: act.managerInstanceId is valid only with view "manager-caller"');
|
|
162
|
+
if (act.view === "session-caller" && act.session === undefined)
|
|
163
|
+
throw new Error('user token: view "session-caller" requires act.session');
|
|
164
|
+
if (act.session !== undefined) {
|
|
165
|
+
if (act.view !== "session-caller")
|
|
166
|
+
throw new Error('user token: act.session is valid only with view "session-caller"');
|
|
167
|
+
assertSessionClaim(act.session);
|
|
168
|
+
}
|
|
142
169
|
// Lifecycle claim (SPEC 13.1): grammar-asserted when present. Presence/absence POLICY lives at the
|
|
143
170
|
// connect boundary (ledgerAuthorizeConnect requires it on EVERY bearer, views included) and the
|
|
144
171
|
// mint boundary (the idp bridge and the agent exchange stamp it from the grant row); the validator
|
|
@@ -163,7 +190,7 @@ export async function validateUserToken(token, opts) {
|
|
|
163
190
|
owner,
|
|
164
191
|
space: opts.audience,
|
|
165
192
|
scope,
|
|
166
|
-
act: { owner: act.owner, actor: act.actor, scope: act.scope, parent: act.parent, lifecycleUid: act.lifecycleUid, credentialId: act.credentialId, view: act.view, managerInstanceId: act.managerInstanceId },
|
|
193
|
+
act: { owner: act.owner, actor: act.actor, scope: act.scope, parent: act.parent, lifecycleUid: act.lifecycleUid, credentialId: act.credentialId, view: act.view, managerInstanceId: act.managerInstanceId, ...(act.session ? { session: act.session } : {}) },
|
|
167
194
|
credentialId: act.credentialId,
|
|
168
195
|
ver: USER_TOKEN_VER,
|
|
169
196
|
exp: payload.exp,
|
package/dist/token.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token.js","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEtG;4EAC4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;8CAC8C;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AAErC;;;;;;;+FAO+F;AAC/F,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,UAAU,EAAE,iBAAiB,EAAE,gBAAgB,CAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"token.js","sourceRoot":"","sources":["../src/token.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,qBAAqB,EAAE,SAAS,EAAE,MAAM,MAAM,CAAC;AAExD,OAAO,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAEtG;4EAC4E;AAC5E,MAAM,CAAC,MAAM,cAAc,GAAG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validation for the NATS auth-callout cutover (Plane 1 ↔ Plane 2).",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.59.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@cotal-ai/core": "0.
|
|
22
|
-
"@cotal-ai/workspace": "0.
|
|
21
|
+
"@cotal-ai/core": "0.59.0",
|
|
22
|
+
"@cotal-ai/workspace": "0.59.0",
|
|
23
23
|
"@nats-io/jwt": "0.0.10-5",
|
|
24
24
|
"@nats-io/nkeys": "^2.0.3",
|
|
25
25
|
"@nats-io/transport-node": "^3.4.0",
|