@cmmd-center/forge 0.9.11 → 0.9.12
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/bin.cjs +15 -14
- package/dist/bin.mjs +15 -14
- package/dist/runtimeBootstrap.cjs +1 -1
- package/dist/runtimeBootstrap.mjs +1 -1
- package/dist/{runtimeControlAuthority-SNBF5Mjy.cjs → runtimeControlAuthority-45DPznyK.cjs} +6 -7
- package/dist/{runtimeControlAuthority-L85w5RTn.mjs → runtimeControlAuthority-akIBTI-S.mjs} +6 -7
- package/package.json +1 -1
package/dist/bin.cjs
CHANGED
|
@@ -12,7 +12,7 @@ const require_Cache = require("./Cache-U1fkdGvV.cjs");
|
|
|
12
12
|
const require_SqlError = require("./SqlError-CSsHBaKF.cjs");
|
|
13
13
|
const require_Mime = require("./Mime-Bilnh8zE.cjs");
|
|
14
14
|
const require_esm = require("./esm-BZhXwX5p.cjs");
|
|
15
|
-
const require_runtimeControlAuthority = require("./runtimeControlAuthority-
|
|
15
|
+
const require_runtimeControlAuthority = require("./runtimeControlAuthority-45DPznyK.cjs");
|
|
16
16
|
const require_PTY = require("./PTY-CNa0j0w2.cjs");
|
|
17
17
|
let node_child_process = require("node:child_process");
|
|
18
18
|
node_child_process = require_chunk.__toESM(node_child_process);
|
|
@@ -65123,7 +65123,7 @@ function normalizeNumberish(value) {
|
|
|
65123
65123
|
}
|
|
65124
65124
|
//#endregion
|
|
65125
65125
|
//#region package.json
|
|
65126
|
-
var version$1 = "0.9.
|
|
65126
|
+
var version$1 = "0.9.12";
|
|
65127
65127
|
//#endregion
|
|
65128
65128
|
//#region src/sentry.ts
|
|
65129
65129
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -85575,7 +85575,7 @@ function isBrokerScope(scope) {
|
|
|
85575
85575
|
return brokerScopes.has(scope);
|
|
85576
85576
|
}
|
|
85577
85577
|
function hasSameExactIdentity(authority, claims) {
|
|
85578
|
-
return authority.orgId === claims.orgId && authority.userId === claims.userId && authority.
|
|
85578
|
+
return authority.orgId === claims.orgId && authority.userId === claims.userId && authority.runtimeId === claims.runtimeId && authority.machineId === claims.machineId && authority.credentialEpoch === claims.credentialEpoch;
|
|
85579
85579
|
}
|
|
85580
85580
|
function firstSessionAuthority(sessionAuthorities) {
|
|
85581
85581
|
if (!sessionAuthorities) return void 0;
|
|
@@ -85609,7 +85609,6 @@ function recordRuntimeBrokerAuthority(input) {
|
|
|
85609
85609
|
token: input.token,
|
|
85610
85610
|
orgId: claims.orgId,
|
|
85611
85611
|
userId: claims.userId,
|
|
85612
|
-
projectId: claims.projectId,
|
|
85613
85612
|
runtimeId: claims.runtimeId,
|
|
85614
85613
|
machineId: claims.machineId,
|
|
85615
85614
|
credentialEpoch: claims.credentialEpoch,
|
|
@@ -280383,7 +280382,7 @@ function currentGrantClaimsForRefresh(input) {
|
|
|
280383
280382
|
});
|
|
280384
280383
|
}
|
|
280385
280384
|
function sameRuntimeOwnership(currentClaims, refreshedClaims) {
|
|
280386
|
-
return refreshedClaims.orgId === currentClaims.orgId && refreshedClaims.userId === currentClaims.userId
|
|
280385
|
+
return refreshedClaims.orgId === currentClaims.orgId && refreshedClaims.userId === currentClaims.userId;
|
|
280387
280386
|
}
|
|
280388
280387
|
function sameScopeSet(left, right) {
|
|
280389
280388
|
const leftScopes = new Set(left);
|
|
@@ -290138,11 +290137,10 @@ function readCmmdRuntimeAuthConfig(serverConfig) {
|
|
|
290138
290137
|
serverConfig.forgeCmmdRuntimePublicKey,
|
|
290139
290138
|
serverConfig.forgeCmmdRuntimeId,
|
|
290140
290139
|
serverConfig.forgeCmmdRuntimeOrgId,
|
|
290141
|
-
serverConfig.forgeCmmdRuntimeUserId
|
|
290142
|
-
serverConfig.forgeCmmdRuntimeProjectId
|
|
290140
|
+
serverConfig.forgeCmmdRuntimeUserId
|
|
290143
290141
|
].map((value) => value?.trim() ?? "");
|
|
290144
290142
|
if (required.some((value) => value.length === 0)) return null;
|
|
290145
|
-
const [publicKeyPem, runtimeId, orgId, userId
|
|
290143
|
+
const [publicKeyPem, runtimeId, orgId, userId] = required;
|
|
290146
290144
|
const machineId = serverConfig.forgeCmmdRuntimeMachineId?.trim();
|
|
290147
290145
|
const credentialEpoch = serverConfig.forgeCmmdRuntimeCredentialEpoch;
|
|
290148
290146
|
const brokerIdentity = classifyRuntimeBrokerIdentity({
|
|
@@ -290156,7 +290154,6 @@ function readCmmdRuntimeAuthConfig(serverConfig) {
|
|
|
290156
290154
|
runtimeId,
|
|
290157
290155
|
orgId,
|
|
290158
290156
|
userId,
|
|
290159
|
-
projectId,
|
|
290160
290157
|
...brokerIdentity.mode === "exact" ? {
|
|
290161
290158
|
machineId: brokerIdentity.machineId,
|
|
290162
290159
|
credentialEpoch: brokerIdentity.credentialEpoch
|
|
@@ -305298,21 +305295,27 @@ function invalidAuthority(message, cause) {
|
|
|
305298
305295
|
...cause === void 0 ? {} : { cause }
|
|
305299
305296
|
});
|
|
305300
305297
|
}
|
|
305298
|
+
/**
|
|
305299
|
+
* There is no project in a runtime's identity. A runtime serves every project
|
|
305300
|
+
* of one user, so a project id neither identifies it nor narrows it. Everything
|
|
305301
|
+
* here stays required: without a key, org, user, runtime, machine and epoch
|
|
305302
|
+
* there is nothing to verify a provider ticket against, and refusing is the
|
|
305303
|
+
* only safe answer.
|
|
305304
|
+
*/
|
|
305301
305305
|
function resolveExactRuntimeIdentity(config) {
|
|
305302
305306
|
const identity = {
|
|
305303
305307
|
publicKeyPem: config.forgeCmmdRuntimePublicKey?.trim(),
|
|
305304
305308
|
orgId: config.forgeCmmdRuntimeOrgId?.trim(),
|
|
305305
305309
|
userId: config.forgeCmmdRuntimeUserId?.trim(),
|
|
305306
|
-
projectId: config.forgeCmmdRuntimeProjectId?.trim(),
|
|
305307
305310
|
runtimeId: config.forgeCmmdRuntimeId?.trim(),
|
|
305308
305311
|
machineId: config.forgeCmmdRuntimeMachineId?.trim(),
|
|
305309
305312
|
credentialEpoch: config.forgeCmmdRuntimeCredentialEpoch
|
|
305310
305313
|
};
|
|
305311
|
-
if (!identity.publicKeyPem || !identity.orgId || !identity.userId || !identity.
|
|
305314
|
+
if (!identity.publicKeyPem || !identity.orgId || !identity.userId || !identity.runtimeId || !identity.machineId || identity.credentialEpoch === void 0) throw invalidAuthority("The exact CMMD runtime identity is not configured.");
|
|
305312
305315
|
return identity;
|
|
305313
305316
|
}
|
|
305314
305317
|
function assertAutomationAuthorityMatchesRuntime(authority, identity) {
|
|
305315
|
-
if (String(authority.organizationId) !== identity.orgId ||
|
|
305318
|
+
if (String(authority.organizationId) !== identity.orgId || authority.runtimeId !== identity.runtimeId) throw invalidAuthority("The automation authority does not match this runtime.");
|
|
305316
305319
|
}
|
|
305317
305320
|
function verifyProviderAuthority(heartbeat, identity) {
|
|
305318
305321
|
const descriptor = heartbeat.providerAuthority;
|
|
@@ -309516,7 +309519,6 @@ const completeClaudeReadinessExpectations = (config) => {
|
|
|
309516
309519
|
runtimeId: config.forgeCmmdRuntimeId?.trim() ?? "",
|
|
309517
309520
|
orgId: config.forgeCmmdRuntimeOrgId?.trim() ?? "",
|
|
309518
309521
|
userId: config.forgeCmmdRuntimeUserId?.trim() ?? "",
|
|
309519
|
-
projectId: config.forgeCmmdRuntimeProjectId?.trim() ?? "",
|
|
309520
309522
|
machineId: config.forgeCmmdRuntimeMachineId?.trim() ?? "",
|
|
309521
309523
|
credentialEpoch: config.forgeCmmdRuntimeCredentialEpoch
|
|
309522
309524
|
};
|
|
@@ -309545,7 +309547,6 @@ const claudeNativeGenerationProofRouteLayer = add$1("GET", "/api/runtime/provide
|
|
|
309545
309547
|
runtimeId: required.runtimeId,
|
|
309546
309548
|
orgId: required.orgId,
|
|
309547
309549
|
userId: required.userId,
|
|
309548
|
-
projectId: required.projectId,
|
|
309549
309550
|
machineId: required.machineId,
|
|
309550
309551
|
credentialEpoch: required.credentialEpoch
|
|
309551
309552
|
});
|
package/dist/bin.mjs
CHANGED
|
@@ -11,7 +11,7 @@ import { a as make$48, i as keys, n as getOption, o as makeWith$1, r as invalida
|
|
|
11
11
|
import { S as layer$9, _ as defaultEscape, a as DeadlockError, b as makeCompiler$1, c as SqlError, d as UnknownError, g as custom, h as make$49, i as ConstraintError, l as SqlSyntaxError, m as SqlClient, n as AuthorizationError, o as LockTimeoutError, r as ConnectionError, s as SerializationError, t as AuthenticationError, u as StatementTimeoutError, v as defaultTransforms, y as fragment } from "./SqlError-B2g5pJux.mjs";
|
|
12
12
|
import { r as wrapper_default, t as Mime_default } from "./Mime-Dq9IoNiV.mjs";
|
|
13
13
|
import { a as diag, c as SpanKind$1, d as TraceFlags, f as ROOT_CONTEXT, i as propagation, l as isSpanContextValid, m as DiagLogLevel, n as init_esm$1, o as context$1, p as createContextKey, r as trace, s as SpanStatusCode, t as esm_exports$1 } from "./esm-wLIF-u3N.mjs";
|
|
14
|
-
import { a as verifyCmmdAuthRuntimeTicket, c as verifyCmmdRuntimeTicketRefreshProof, d as createReadOnceFileTokenAccessor, i as sendRuntimeControlHeartbeat, l as runtimeGrantToken, n as bootstrapRuntimeControlAuthorityFromNarrowGrant, o as verifyCmmdClaudeReadinessTicket, r as readRuntimeControlAuthority, s as verifyCmmdRuntimeTicket, t as bootstrapRuntimeControlAuthority, u as setRuntimeGrantToken } from "./runtimeControlAuthority-
|
|
14
|
+
import { a as verifyCmmdAuthRuntimeTicket, c as verifyCmmdRuntimeTicketRefreshProof, d as createReadOnceFileTokenAccessor, i as sendRuntimeControlHeartbeat, l as runtimeGrantToken, n as bootstrapRuntimeControlAuthorityFromNarrowGrant, o as verifyCmmdClaudeReadinessTicket, r as readRuntimeControlAuthority, s as verifyCmmdRuntimeTicket, t as bootstrapRuntimeControlAuthority, u as setRuntimeGrantToken } from "./runtimeControlAuthority-akIBTI-S.mjs";
|
|
15
15
|
import { n as PtySpawnError, t as PtyAdapter } from "./PTY-Cx_YKiEO.mjs";
|
|
16
16
|
import { createRequire } from "node:module";
|
|
17
17
|
import * as HE from "node:child_process";
|
|
@@ -64870,7 +64870,7 @@ function normalizeNumberish(value) {
|
|
|
64870
64870
|
}
|
|
64871
64871
|
//#endregion
|
|
64872
64872
|
//#region package.json
|
|
64873
|
-
var version$1 = "0.9.
|
|
64873
|
+
var version$1 = "0.9.12";
|
|
64874
64874
|
//#endregion
|
|
64875
64875
|
//#region src/sentry.ts
|
|
64876
64876
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -85267,7 +85267,7 @@ function isBrokerScope(scope) {
|
|
|
85267
85267
|
return brokerScopes.has(scope);
|
|
85268
85268
|
}
|
|
85269
85269
|
function hasSameExactIdentity(authority, claims) {
|
|
85270
|
-
return authority.orgId === claims.orgId && authority.userId === claims.userId && authority.
|
|
85270
|
+
return authority.orgId === claims.orgId && authority.userId === claims.userId && authority.runtimeId === claims.runtimeId && authority.machineId === claims.machineId && authority.credentialEpoch === claims.credentialEpoch;
|
|
85271
85271
|
}
|
|
85272
85272
|
function firstSessionAuthority(sessionAuthorities) {
|
|
85273
85273
|
if (!sessionAuthorities) return void 0;
|
|
@@ -85301,7 +85301,6 @@ function recordRuntimeBrokerAuthority(input) {
|
|
|
85301
85301
|
token: input.token,
|
|
85302
85302
|
orgId: claims.orgId,
|
|
85303
85303
|
userId: claims.userId,
|
|
85304
|
-
projectId: claims.projectId,
|
|
85305
85304
|
runtimeId: claims.runtimeId,
|
|
85306
85305
|
machineId: claims.machineId,
|
|
85307
85306
|
credentialEpoch: claims.credentialEpoch,
|
|
@@ -279940,7 +279939,7 @@ function currentGrantClaimsForRefresh(input) {
|
|
|
279940
279939
|
});
|
|
279941
279940
|
}
|
|
279942
279941
|
function sameRuntimeOwnership(currentClaims, refreshedClaims) {
|
|
279943
|
-
return refreshedClaims.orgId === currentClaims.orgId && refreshedClaims.userId === currentClaims.userId
|
|
279942
|
+
return refreshedClaims.orgId === currentClaims.orgId && refreshedClaims.userId === currentClaims.userId;
|
|
279944
279943
|
}
|
|
279945
279944
|
function sameScopeSet(left, right) {
|
|
279946
279945
|
const leftScopes = new Set(left);
|
|
@@ -289628,11 +289627,10 @@ function readCmmdRuntimeAuthConfig(serverConfig) {
|
|
|
289628
289627
|
serverConfig.forgeCmmdRuntimePublicKey,
|
|
289629
289628
|
serverConfig.forgeCmmdRuntimeId,
|
|
289630
289629
|
serverConfig.forgeCmmdRuntimeOrgId,
|
|
289631
|
-
serverConfig.forgeCmmdRuntimeUserId
|
|
289632
|
-
serverConfig.forgeCmmdRuntimeProjectId
|
|
289630
|
+
serverConfig.forgeCmmdRuntimeUserId
|
|
289633
289631
|
].map((value) => value?.trim() ?? "");
|
|
289634
289632
|
if (required.some((value) => value.length === 0)) return null;
|
|
289635
|
-
const [publicKeyPem, runtimeId, orgId, userId
|
|
289633
|
+
const [publicKeyPem, runtimeId, orgId, userId] = required;
|
|
289636
289634
|
const machineId = serverConfig.forgeCmmdRuntimeMachineId?.trim();
|
|
289637
289635
|
const credentialEpoch = serverConfig.forgeCmmdRuntimeCredentialEpoch;
|
|
289638
289636
|
const brokerIdentity = classifyRuntimeBrokerIdentity({
|
|
@@ -289646,7 +289644,6 @@ function readCmmdRuntimeAuthConfig(serverConfig) {
|
|
|
289646
289644
|
runtimeId,
|
|
289647
289645
|
orgId,
|
|
289648
289646
|
userId,
|
|
289649
|
-
projectId,
|
|
289650
289647
|
...brokerIdentity.mode === "exact" ? {
|
|
289651
289648
|
machineId: brokerIdentity.machineId,
|
|
289652
289649
|
credentialEpoch: brokerIdentity.credentialEpoch
|
|
@@ -304697,21 +304694,27 @@ function invalidAuthority(message, cause) {
|
|
|
304697
304694
|
...cause === void 0 ? {} : { cause }
|
|
304698
304695
|
});
|
|
304699
304696
|
}
|
|
304697
|
+
/**
|
|
304698
|
+
* There is no project in a runtime's identity. A runtime serves every project
|
|
304699
|
+
* of one user, so a project id neither identifies it nor narrows it. Everything
|
|
304700
|
+
* here stays required: without a key, org, user, runtime, machine and epoch
|
|
304701
|
+
* there is nothing to verify a provider ticket against, and refusing is the
|
|
304702
|
+
* only safe answer.
|
|
304703
|
+
*/
|
|
304700
304704
|
function resolveExactRuntimeIdentity(config) {
|
|
304701
304705
|
const identity = {
|
|
304702
304706
|
publicKeyPem: config.forgeCmmdRuntimePublicKey?.trim(),
|
|
304703
304707
|
orgId: config.forgeCmmdRuntimeOrgId?.trim(),
|
|
304704
304708
|
userId: config.forgeCmmdRuntimeUserId?.trim(),
|
|
304705
|
-
projectId: config.forgeCmmdRuntimeProjectId?.trim(),
|
|
304706
304709
|
runtimeId: config.forgeCmmdRuntimeId?.trim(),
|
|
304707
304710
|
machineId: config.forgeCmmdRuntimeMachineId?.trim(),
|
|
304708
304711
|
credentialEpoch: config.forgeCmmdRuntimeCredentialEpoch
|
|
304709
304712
|
};
|
|
304710
|
-
if (!identity.publicKeyPem || !identity.orgId || !identity.userId || !identity.
|
|
304713
|
+
if (!identity.publicKeyPem || !identity.orgId || !identity.userId || !identity.runtimeId || !identity.machineId || identity.credentialEpoch === void 0) throw invalidAuthority("The exact CMMD runtime identity is not configured.");
|
|
304711
304714
|
return identity;
|
|
304712
304715
|
}
|
|
304713
304716
|
function assertAutomationAuthorityMatchesRuntime(authority, identity) {
|
|
304714
|
-
if (String(authority.organizationId) !== identity.orgId ||
|
|
304717
|
+
if (String(authority.organizationId) !== identity.orgId || authority.runtimeId !== identity.runtimeId) throw invalidAuthority("The automation authority does not match this runtime.");
|
|
304715
304718
|
}
|
|
304716
304719
|
function verifyProviderAuthority(heartbeat, identity) {
|
|
304717
304720
|
const descriptor = heartbeat.providerAuthority;
|
|
@@ -308901,7 +308904,6 @@ const completeClaudeReadinessExpectations = (config) => {
|
|
|
308901
308904
|
runtimeId: config.forgeCmmdRuntimeId?.trim() ?? "",
|
|
308902
308905
|
orgId: config.forgeCmmdRuntimeOrgId?.trim() ?? "",
|
|
308903
308906
|
userId: config.forgeCmmdRuntimeUserId?.trim() ?? "",
|
|
308904
|
-
projectId: config.forgeCmmdRuntimeProjectId?.trim() ?? "",
|
|
308905
308907
|
machineId: config.forgeCmmdRuntimeMachineId?.trim() ?? "",
|
|
308906
308908
|
credentialEpoch: config.forgeCmmdRuntimeCredentialEpoch
|
|
308907
308909
|
};
|
|
@@ -308930,7 +308932,6 @@ const claudeNativeGenerationProofRouteLayer = add$1("GET", "/api/runtime/provide
|
|
|
308930
308932
|
runtimeId: required.runtimeId,
|
|
308931
308933
|
orgId: required.orgId,
|
|
308932
308934
|
userId: required.userId,
|
|
308933
|
-
projectId: required.projectId,
|
|
308934
308935
|
machineId: required.machineId,
|
|
308935
308936
|
credentialEpoch: required.credentialEpoch
|
|
308936
308937
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
4
4
|
require("./chunk-BhaIgcZK.cjs");
|
|
5
|
-
const require_runtimeControlAuthority = require("./runtimeControlAuthority-
|
|
5
|
+
const require_runtimeControlAuthority = require("./runtimeControlAuthority-45DPznyK.cjs");
|
|
6
6
|
exports.bootstrapRuntimeControlAuthorityFromNarrowGrant = require_runtimeControlAuthority.bootstrapRuntimeControlAuthorityFromNarrowGrant;
|
|
7
7
|
exports.setRuntimeGrantToken = require_runtimeControlAuthority.setRuntimeGrantToken;
|
|
8
8
|
exports.verifyCmmdRuntimeTicket = require_runtimeControlAuthority.verifyCmmdRuntimeTicket;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
import { n as bootstrapRuntimeControlAuthorityFromNarrowGrant, s as verifyCmmdRuntimeTicket, u as setRuntimeGrantToken } from "./runtimeControlAuthority-
|
|
3
|
+
import { n as bootstrapRuntimeControlAuthorityFromNarrowGrant, s as verifyCmmdRuntimeTicket, u as setRuntimeGrantToken } from "./runtimeControlAuthority-akIBTI-S.mjs";
|
|
4
4
|
export { bootstrapRuntimeControlAuthorityFromNarrowGrant, setRuntimeGrantToken, verifyCmmdRuntimeTicket };
|
|
@@ -155,13 +155,12 @@ function runtimeTicketExpiration(payload, allowExpired) {
|
|
|
155
155
|
function requiredRuntimeIdentity(payload) {
|
|
156
156
|
const userId = stringClaim(payload, "user_id");
|
|
157
157
|
const orgId = stringClaim(payload, "org_id");
|
|
158
|
-
const projectId = stringClaim(payload, "project_id");
|
|
159
158
|
const runtimeId = stringClaim(payload, "runtime_id");
|
|
160
|
-
if (!userId || !orgId || !
|
|
159
|
+
if (!userId || !orgId || !runtimeId) return null;
|
|
161
160
|
return {
|
|
162
161
|
userId,
|
|
163
162
|
orgId,
|
|
164
|
-
projectId,
|
|
163
|
+
projectId: stringClaim(payload, "project_id"),
|
|
165
164
|
runtimeId
|
|
166
165
|
};
|
|
167
166
|
}
|
|
@@ -188,7 +187,7 @@ function exactMachineExpectationMatches(claims, expectations) {
|
|
|
188
187
|
return expectations.credentialEpoch === void 0 || claims.credentialEpoch === expectations.credentialEpoch;
|
|
189
188
|
}
|
|
190
189
|
function runtimeTicketExpectationsMatch(claims, expectations) {
|
|
191
|
-
return matchesExpected(claims.runtimeId, expectations.runtimeId) && matchesExpected(claims.orgId, expectations.orgId) && matchesExpected(claims.userId, expectations.userId) &&
|
|
190
|
+
return matchesExpected(claims.runtimeId, expectations.runtimeId) && matchesExpected(claims.orgId, expectations.orgId) && matchesExpected(claims.userId, expectations.userId) && exactMachineExpectationMatches(claims, expectations);
|
|
192
191
|
}
|
|
193
192
|
function verifyCmmdRuntimeTicketWithExpirationPolicy(token, expectations, allowExpired) {
|
|
194
193
|
const payload = verifiedRuntimeTicketPayload(token, expectations.publicKeyPem);
|
|
@@ -357,7 +356,7 @@ function storeRuntimeControlAuthority(input) {
|
|
|
357
356
|
const claims = verifyCmmdRuntimeTicket(input.envelope.controlTicket, {
|
|
358
357
|
publicKeyPem: input.identity.publicKeyPem,
|
|
359
358
|
orgId: input.identity.orgId,
|
|
360
|
-
|
|
359
|
+
userId: input.identity.userId,
|
|
361
360
|
runtimeId: input.identity.runtimeId,
|
|
362
361
|
machineId: input.identity.machineId,
|
|
363
362
|
credentialEpoch: input.identity.credentialEpoch
|
|
@@ -453,7 +452,7 @@ function bootstrapRuntimeControlAuthorityFromNarrowGrant(input) {
|
|
|
453
452
|
const claims = verifyCmmdRuntimeTicket(input.grantToken, {
|
|
454
453
|
publicKeyPem: input.identity.publicKeyPem,
|
|
455
454
|
orgId: input.identity.orgId,
|
|
456
|
-
|
|
455
|
+
userId: input.identity.userId,
|
|
457
456
|
runtimeId: input.identity.runtimeId,
|
|
458
457
|
machineId: input.identity.machineId,
|
|
459
458
|
credentialEpoch: input.identity.credentialEpoch
|
|
@@ -598,4 +597,4 @@ Object.defineProperty(exports, "verifyCmmdRuntimeTicketRefreshProof", {
|
|
|
598
597
|
}
|
|
599
598
|
});
|
|
600
599
|
|
|
601
|
-
//# sourceMappingURL=runtimeControlAuthority-
|
|
600
|
+
//# sourceMappingURL=runtimeControlAuthority-45DPznyK.cjs.map
|
|
@@ -154,13 +154,12 @@ function runtimeTicketExpiration(payload, allowExpired) {
|
|
|
154
154
|
function requiredRuntimeIdentity(payload) {
|
|
155
155
|
const userId = stringClaim(payload, "user_id");
|
|
156
156
|
const orgId = stringClaim(payload, "org_id");
|
|
157
|
-
const projectId = stringClaim(payload, "project_id");
|
|
158
157
|
const runtimeId = stringClaim(payload, "runtime_id");
|
|
159
|
-
if (!userId || !orgId || !
|
|
158
|
+
if (!userId || !orgId || !runtimeId) return null;
|
|
160
159
|
return {
|
|
161
160
|
userId,
|
|
162
161
|
orgId,
|
|
163
|
-
projectId,
|
|
162
|
+
projectId: stringClaim(payload, "project_id"),
|
|
164
163
|
runtimeId
|
|
165
164
|
};
|
|
166
165
|
}
|
|
@@ -187,7 +186,7 @@ function exactMachineExpectationMatches(claims, expectations) {
|
|
|
187
186
|
return expectations.credentialEpoch === void 0 || claims.credentialEpoch === expectations.credentialEpoch;
|
|
188
187
|
}
|
|
189
188
|
function runtimeTicketExpectationsMatch(claims, expectations) {
|
|
190
|
-
return matchesExpected(claims.runtimeId, expectations.runtimeId) && matchesExpected(claims.orgId, expectations.orgId) && matchesExpected(claims.userId, expectations.userId) &&
|
|
189
|
+
return matchesExpected(claims.runtimeId, expectations.runtimeId) && matchesExpected(claims.orgId, expectations.orgId) && matchesExpected(claims.userId, expectations.userId) && exactMachineExpectationMatches(claims, expectations);
|
|
191
190
|
}
|
|
192
191
|
function verifyCmmdRuntimeTicketWithExpirationPolicy(token, expectations, allowExpired) {
|
|
193
192
|
const payload = verifiedRuntimeTicketPayload(token, expectations.publicKeyPem);
|
|
@@ -356,7 +355,7 @@ function storeRuntimeControlAuthority(input) {
|
|
|
356
355
|
const claims = verifyCmmdRuntimeTicket(input.envelope.controlTicket, {
|
|
357
356
|
publicKeyPem: input.identity.publicKeyPem,
|
|
358
357
|
orgId: input.identity.orgId,
|
|
359
|
-
|
|
358
|
+
userId: input.identity.userId,
|
|
360
359
|
runtimeId: input.identity.runtimeId,
|
|
361
360
|
machineId: input.identity.machineId,
|
|
362
361
|
credentialEpoch: input.identity.credentialEpoch
|
|
@@ -452,7 +451,7 @@ function bootstrapRuntimeControlAuthorityFromNarrowGrant(input) {
|
|
|
452
451
|
const claims = verifyCmmdRuntimeTicket(input.grantToken, {
|
|
453
452
|
publicKeyPem: input.identity.publicKeyPem,
|
|
454
453
|
orgId: input.identity.orgId,
|
|
455
|
-
|
|
454
|
+
userId: input.identity.userId,
|
|
456
455
|
runtimeId: input.identity.runtimeId,
|
|
457
456
|
machineId: input.identity.machineId,
|
|
458
457
|
credentialEpoch: input.identity.credentialEpoch
|
|
@@ -532,4 +531,4 @@ async function sendRuntimeControlHeartbeat(input) {
|
|
|
532
531
|
//#endregion
|
|
533
532
|
export { verifyCmmdAuthRuntimeTicket as a, verifyCmmdRuntimeTicketRefreshProof as c, createReadOnceFileTokenAccessor as d, sendRuntimeControlHeartbeat as i, runtimeGrantToken as l, bootstrapRuntimeControlAuthorityFromNarrowGrant as n, verifyCmmdClaudeReadinessTicket as o, readRuntimeControlAuthority as r, verifyCmmdRuntimeTicket as s, bootstrapRuntimeControlAuthority as t, setRuntimeGrantToken as u };
|
|
534
533
|
|
|
535
|
-
//# sourceMappingURL=runtimeControlAuthority-
|
|
534
|
+
//# sourceMappingURL=runtimeControlAuthority-akIBTI-S.mjs.map
|