@astrasyncai/verification-gateway 5.14.0 → 5.16.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/README.md +36 -18
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +492 -240
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +492 -240
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +23 -6
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +23 -6
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +475 -239
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +475 -239
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +18 -10
- package/dist/adapters/sdk.d.ts +18 -10
- package/dist/adapters/sdk.js +83 -23
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +83 -23
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +69 -54
- package/dist/agent/index.d.ts +69 -54
- package/dist/agent/index.js +24 -14
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +24 -14
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +58 -11
- package/dist/bin/astrasync-codex-hook.js +58 -11
- package/dist/bin/astrasync-guard.js +177 -11
- package/dist/bin/astrasync.js +433 -38
- package/dist/browser/background.js +53 -6
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +63 -6
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +58 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +68 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +58 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +68 -11
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +31 -2
- package/dist/edge-config.d.ts +31 -2
- package/dist/edge-config.js +35 -5
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +32 -4
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +11 -2
- package/dist/edge-core/index.d.ts +11 -2
- package/dist/edge-core/index.js +97 -11
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +95 -11
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +53 -6
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +63 -6
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +1407 -88
- package/dist/index.d.ts +1407 -88
- package/dist/index.js +5148 -2616
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5094 -2618
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.d.mts +28 -2
- package/dist/registration/index.d.ts +28 -2
- package/dist/registration/index.js +18 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +15 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +7 -5
- package/dist/transport/index.d.ts +7 -5
- package/dist/transport/index.js +61 -5
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +67 -11
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-BCkwBA84.d.mts → types-Blz520bR.d.mts} +116 -12
- package/dist/{types-BCkwBA84.d.ts → types-Blz520bR.d.ts} +116 -12
- package/dist/{types-C_b4QTyO.d.ts → types-Bm1QvGqI.d.ts} +114 -10
- package/dist/{types-DlshIIR-.d.mts → types-DBe4hgfT.d.mts} +114 -10
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +23 -6
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +23 -6
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -3752,7 +3752,7 @@ function getTrustLevel(score) {
|
|
|
3752
3752
|
}
|
|
3753
3753
|
|
|
3754
3754
|
// src/version.ts
|
|
3755
|
-
var SDK_VERSION = "5.
|
|
3755
|
+
var SDK_VERSION = "5.16.0";
|
|
3756
3756
|
|
|
3757
3757
|
// src/http.ts
|
|
3758
3758
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -3889,6 +3889,8 @@ function getCacheKey(request, counterpartyId) {
|
|
|
3889
3889
|
request.durationRequired ?? "",
|
|
3890
3890
|
request.invocationProtocol || "",
|
|
3891
3891
|
request.enableRuntimeChallenge ? "1" : "0",
|
|
3892
|
+
// 5.16.0: route policy changes the verdict (owners / challenge).
|
|
3893
|
+
request.routePolicy ? JSON.stringify(request.routePolicy) : "",
|
|
3892
3894
|
// callerMetadata fields contribute to risk model; include the ones
|
|
3893
3895
|
// backend reads. sourceIp/userAgent/forwardedFor change per-request
|
|
3894
3896
|
// so their inclusion effectively forces a re-check for any varying
|
|
@@ -4061,6 +4063,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4061
4063
|
if (requestData.subAgentDepth !== void 0) body.subAgentDepth = requestData.subAgentDepth;
|
|
4062
4064
|
if (requestData.enableRuntimeChallenge)
|
|
4063
4065
|
body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
4066
|
+
if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
|
|
4064
4067
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
4065
4068
|
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
4066
4069
|
if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
|
|
@@ -4071,6 +4074,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4071
4074
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
4072
4075
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
4073
4076
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
4077
|
+
if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
|
|
4074
4078
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
4075
4079
|
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
4076
4080
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
@@ -4221,7 +4225,8 @@ async function verify(config, request, options) {
|
|
|
4221
4225
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
4222
4226
|
);
|
|
4223
4227
|
}
|
|
4224
|
-
|
|
4228
|
+
const uncacheable = Boolean(request.commerceArtifacts);
|
|
4229
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
4225
4230
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
4226
4231
|
if (cached) {
|
|
4227
4232
|
if (mergedConfig.debug) {
|
|
@@ -4302,7 +4307,10 @@ async function verify(config, request, options) {
|
|
|
4302
4307
|
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
4303
4308
|
settlementToken: apiResponse.settlementToken,
|
|
4304
4309
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4305
|
-
fulfilment: apiResponse.fulfilment
|
|
4310
|
+
fulfilment: apiResponse.fulfilment,
|
|
4311
|
+
mandates: apiResponse.mandates,
|
|
4312
|
+
kyaToken: apiResponse.kyaToken,
|
|
4313
|
+
aep: apiResponse.aep
|
|
4306
4314
|
};
|
|
4307
4315
|
return result2;
|
|
4308
4316
|
}
|
|
@@ -4312,7 +4320,10 @@ async function verify(config, request, options) {
|
|
|
4312
4320
|
trustScore: apiResponse.agent.trustScore,
|
|
4313
4321
|
trustLevel: getTrustLevel(apiResponse.agent.trustScore),
|
|
4314
4322
|
blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
|
|
4315
|
-
status: apiResponse.agent.agentStatus
|
|
4323
|
+
status: apiResponse.agent.agentStatus,
|
|
4324
|
+
...apiResponse.agent.protocolIdentities && {
|
|
4325
|
+
protocolIdentities: apiResponse.agent.protocolIdentities
|
|
4326
|
+
}
|
|
4316
4327
|
} : void 0;
|
|
4317
4328
|
const developer = apiResponse.developer ? {
|
|
4318
4329
|
astradId: apiResponse.developer.kyaOwnerId,
|
|
@@ -4363,7 +4374,11 @@ async function verify(config, request, options) {
|
|
|
4363
4374
|
settlementOutcome: apiResponse.settlementOutcome,
|
|
4364
4375
|
settlementToken: apiResponse.settlementToken,
|
|
4365
4376
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4366
|
-
fulfilment: apiResponse.fulfilment
|
|
4377
|
+
fulfilment: apiResponse.fulfilment,
|
|
4378
|
+
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
4379
|
+
mandates: apiResponse.mandates,
|
|
4380
|
+
kyaToken: apiResponse.kyaToken,
|
|
4381
|
+
aep: apiResponse.aep
|
|
4367
4382
|
};
|
|
4368
4383
|
if (result.recommendation === "deny") {
|
|
4369
4384
|
result.policyAllowed = false;
|
|
@@ -4383,7 +4398,9 @@ async function verify(config, request, options) {
|
|
|
4383
4398
|
}
|
|
4384
4399
|
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
4385
4400
|
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
4386
|
-
|
|
4401
|
+
if (!uncacheable) {
|
|
4402
|
+
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
4403
|
+
}
|
|
4387
4404
|
}
|
|
4388
4405
|
return result;
|
|
4389
4406
|
}
|
|
@@ -4394,6 +4411,9 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
4394
4411
|
// src/metadata-capture.ts
|
|
4395
4412
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
4396
4413
|
|
|
4414
|
+
// src/adapters/commerce-detect.ts
|
|
4415
|
+
var MAX_BODY_BYTES = 64 * 1024;
|
|
4416
|
+
|
|
4397
4417
|
// src/edge-config.ts
|
|
4398
4418
|
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4399
4419
|
version: 1,
|
|
@@ -4703,6 +4723,33 @@ var import_node_crypto4 = require("crypto");
|
|
|
4703
4723
|
// src/transport/registry/visa.ts
|
|
4704
4724
|
var import_jose = require("jose");
|
|
4705
4725
|
|
|
4726
|
+
// src/ucp/profile.ts
|
|
4727
|
+
var UCP_VERSION = "2026-08-25";
|
|
4728
|
+
var SPEC = `https://ucp.dev/${UCP_VERSION}/specification`;
|
|
4729
|
+
var SCHEMAS = `https://ucp.dev/${UCP_VERSION}/schemas`;
|
|
4730
|
+
|
|
4731
|
+
// src/ucp/signatures.ts
|
|
4732
|
+
var import_http_message_signatures3 = require("http-message-signatures");
|
|
4733
|
+
|
|
4734
|
+
// src/http-signatures/sign.ts
|
|
4735
|
+
var import_http_message_signatures2 = require("http-message-signatures");
|
|
4736
|
+
|
|
4737
|
+
// src/ucp/checkout-kit.ts
|
|
4738
|
+
var import_jose3 = require("jose");
|
|
4739
|
+
|
|
4740
|
+
// src/mandates/sd-jwt.ts
|
|
4741
|
+
var import_jose2 = require("jose");
|
|
4742
|
+
|
|
4743
|
+
// src/idempotency/index.ts
|
|
4744
|
+
var DEFAULT_IDEMPOTENCY_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
4745
|
+
|
|
4746
|
+
// src/payments/kyapay.ts
|
|
4747
|
+
var import_jose4 = require("jose");
|
|
4748
|
+
|
|
4749
|
+
// src/aep/core.ts
|
|
4750
|
+
var ED25519_PKCS8_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
4751
|
+
var ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
4752
|
+
|
|
4706
4753
|
// src/gateway/modes/online.ts
|
|
4707
4754
|
function toGatewayConfig(config) {
|
|
4708
4755
|
return {
|
|
@@ -5693,7 +5740,7 @@ async function sendHeartbeat(enrolment, request, timeoutMs = 1500) {
|
|
|
5693
5740
|
|
|
5694
5741
|
// src/fleet/policy-verify.ts
|
|
5695
5742
|
var import_crypto = require("crypto");
|
|
5696
|
-
var
|
|
5743
|
+
var import_jose5 = require("jose");
|
|
5697
5744
|
|
|
5698
5745
|
// src/fleet/types.ts
|
|
5699
5746
|
var FLEET_POLICY_TYP = "fleet-policy+jwt";
|
|
@@ -5742,8 +5789,8 @@ async function verifyFleetPolicy(jws, jwks, options) {
|
|
|
5742
5789
|
let payloadBytes;
|
|
5743
5790
|
let header;
|
|
5744
5791
|
try {
|
|
5745
|
-
const keySet = (0,
|
|
5746
|
-
const result = await (0,
|
|
5792
|
+
const keySet = (0, import_jose5.createLocalJWKSet)(jwks);
|
|
5793
|
+
const result = await (0, import_jose5.compactVerify)(jws, keySet, { algorithms: ["ES256"] });
|
|
5747
5794
|
payloadBytes = result.payload;
|
|
5748
5795
|
header = result.protectedHeader;
|
|
5749
5796
|
} catch (err) {
|
|
@@ -5789,9 +5836,9 @@ async function resolveFleetJwks(pinned, chain, ownerId) {
|
|
|
5789
5836
|
let lastSeq = 0;
|
|
5790
5837
|
for (const link of chain) {
|
|
5791
5838
|
try {
|
|
5792
|
-
const { payload, protectedHeader } = await (0,
|
|
5839
|
+
const { payload, protectedHeader } = await (0, import_jose5.compactVerify)(
|
|
5793
5840
|
link,
|
|
5794
|
-
(0,
|
|
5841
|
+
(0, import_jose5.createLocalJWKSet)(trusted),
|
|
5795
5842
|
{ algorithms: ["ES256"] }
|
|
5796
5843
|
);
|
|
5797
5844
|
if (protectedHeader.typ !== FLEET_KEYS_TYP) continue;
|
|
@@ -3751,7 +3751,7 @@ function getTrustLevel(score) {
|
|
|
3751
3751
|
}
|
|
3752
3752
|
|
|
3753
3753
|
// src/version.ts
|
|
3754
|
-
var SDK_VERSION = "5.
|
|
3754
|
+
var SDK_VERSION = "5.16.0";
|
|
3755
3755
|
|
|
3756
3756
|
// src/http.ts
|
|
3757
3757
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -3888,6 +3888,8 @@ function getCacheKey(request, counterpartyId) {
|
|
|
3888
3888
|
request.durationRequired ?? "",
|
|
3889
3889
|
request.invocationProtocol || "",
|
|
3890
3890
|
request.enableRuntimeChallenge ? "1" : "0",
|
|
3891
|
+
// 5.16.0: route policy changes the verdict (owners / challenge).
|
|
3892
|
+
request.routePolicy ? JSON.stringify(request.routePolicy) : "",
|
|
3891
3893
|
// callerMetadata fields contribute to risk model; include the ones
|
|
3892
3894
|
// backend reads. sourceIp/userAgent/forwardedFor change per-request
|
|
3893
3895
|
// so their inclusion effectively forces a re-check for any varying
|
|
@@ -4060,6 +4062,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4060
4062
|
if (requestData.subAgentDepth !== void 0) body.subAgentDepth = requestData.subAgentDepth;
|
|
4061
4063
|
if (requestData.enableRuntimeChallenge)
|
|
4062
4064
|
body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
4065
|
+
if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
|
|
4063
4066
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
4064
4067
|
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
4065
4068
|
if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
|
|
@@ -4070,6 +4073,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4070
4073
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
4071
4074
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
4072
4075
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
4076
|
+
if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
|
|
4073
4077
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
4074
4078
|
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
4075
4079
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
@@ -4220,7 +4224,8 @@ async function verify(config, request, options) {
|
|
|
4220
4224
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
4221
4225
|
);
|
|
4222
4226
|
}
|
|
4223
|
-
|
|
4227
|
+
const uncacheable = Boolean(request.commerceArtifacts);
|
|
4228
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
4224
4229
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
4225
4230
|
if (cached) {
|
|
4226
4231
|
if (mergedConfig.debug) {
|
|
@@ -4301,7 +4306,10 @@ async function verify(config, request, options) {
|
|
|
4301
4306
|
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
4302
4307
|
settlementToken: apiResponse.settlementToken,
|
|
4303
4308
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4304
|
-
fulfilment: apiResponse.fulfilment
|
|
4309
|
+
fulfilment: apiResponse.fulfilment,
|
|
4310
|
+
mandates: apiResponse.mandates,
|
|
4311
|
+
kyaToken: apiResponse.kyaToken,
|
|
4312
|
+
aep: apiResponse.aep
|
|
4305
4313
|
};
|
|
4306
4314
|
return result2;
|
|
4307
4315
|
}
|
|
@@ -4311,7 +4319,10 @@ async function verify(config, request, options) {
|
|
|
4311
4319
|
trustScore: apiResponse.agent.trustScore,
|
|
4312
4320
|
trustLevel: getTrustLevel(apiResponse.agent.trustScore),
|
|
4313
4321
|
blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
|
|
4314
|
-
status: apiResponse.agent.agentStatus
|
|
4322
|
+
status: apiResponse.agent.agentStatus,
|
|
4323
|
+
...apiResponse.agent.protocolIdentities && {
|
|
4324
|
+
protocolIdentities: apiResponse.agent.protocolIdentities
|
|
4325
|
+
}
|
|
4315
4326
|
} : void 0;
|
|
4316
4327
|
const developer = apiResponse.developer ? {
|
|
4317
4328
|
astradId: apiResponse.developer.kyaOwnerId,
|
|
@@ -4362,7 +4373,11 @@ async function verify(config, request, options) {
|
|
|
4362
4373
|
settlementOutcome: apiResponse.settlementOutcome,
|
|
4363
4374
|
settlementToken: apiResponse.settlementToken,
|
|
4364
4375
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4365
|
-
fulfilment: apiResponse.fulfilment
|
|
4376
|
+
fulfilment: apiResponse.fulfilment,
|
|
4377
|
+
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
4378
|
+
mandates: apiResponse.mandates,
|
|
4379
|
+
kyaToken: apiResponse.kyaToken,
|
|
4380
|
+
aep: apiResponse.aep
|
|
4366
4381
|
};
|
|
4367
4382
|
if (result.recommendation === "deny") {
|
|
4368
4383
|
result.policyAllowed = false;
|
|
@@ -4382,7 +4397,9 @@ async function verify(config, request, options) {
|
|
|
4382
4397
|
}
|
|
4383
4398
|
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
4384
4399
|
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
4385
|
-
|
|
4400
|
+
if (!uncacheable) {
|
|
4401
|
+
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
4402
|
+
}
|
|
4386
4403
|
}
|
|
4387
4404
|
return result;
|
|
4388
4405
|
}
|
|
@@ -4393,6 +4410,9 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
4393
4410
|
// src/metadata-capture.ts
|
|
4394
4411
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
4395
4412
|
|
|
4413
|
+
// src/adapters/commerce-detect.ts
|
|
4414
|
+
var MAX_BODY_BYTES = 64 * 1024;
|
|
4415
|
+
|
|
4396
4416
|
// src/edge-config.ts
|
|
4397
4417
|
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4398
4418
|
version: 1,
|
|
@@ -4702,6 +4722,33 @@ var import_node_crypto4 = require("crypto");
|
|
|
4702
4722
|
// src/transport/registry/visa.ts
|
|
4703
4723
|
var import_jose = require("jose");
|
|
4704
4724
|
|
|
4725
|
+
// src/ucp/profile.ts
|
|
4726
|
+
var UCP_VERSION = "2026-08-25";
|
|
4727
|
+
var SPEC = `https://ucp.dev/${UCP_VERSION}/specification`;
|
|
4728
|
+
var SCHEMAS = `https://ucp.dev/${UCP_VERSION}/schemas`;
|
|
4729
|
+
|
|
4730
|
+
// src/ucp/signatures.ts
|
|
4731
|
+
var import_http_message_signatures3 = require("http-message-signatures");
|
|
4732
|
+
|
|
4733
|
+
// src/http-signatures/sign.ts
|
|
4734
|
+
var import_http_message_signatures2 = require("http-message-signatures");
|
|
4735
|
+
|
|
4736
|
+
// src/ucp/checkout-kit.ts
|
|
4737
|
+
var import_jose3 = require("jose");
|
|
4738
|
+
|
|
4739
|
+
// src/mandates/sd-jwt.ts
|
|
4740
|
+
var import_jose2 = require("jose");
|
|
4741
|
+
|
|
4742
|
+
// src/idempotency/index.ts
|
|
4743
|
+
var DEFAULT_IDEMPOTENCY_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
4744
|
+
|
|
4745
|
+
// src/payments/kyapay.ts
|
|
4746
|
+
var import_jose4 = require("jose");
|
|
4747
|
+
|
|
4748
|
+
// src/aep/core.ts
|
|
4749
|
+
var ED25519_PKCS8_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
4750
|
+
var ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
4751
|
+
|
|
4705
4752
|
// src/gateway/modes/online.ts
|
|
4706
4753
|
function toGatewayConfig(config) {
|
|
4707
4754
|
return {
|
|
@@ -5439,7 +5486,7 @@ async function sendHeartbeat(enrolment, request, timeoutMs = 1500) {
|
|
|
5439
5486
|
|
|
5440
5487
|
// src/fleet/policy-verify.ts
|
|
5441
5488
|
var import_crypto = require("crypto");
|
|
5442
|
-
var
|
|
5489
|
+
var import_jose5 = require("jose");
|
|
5443
5490
|
|
|
5444
5491
|
// src/fleet/types.ts
|
|
5445
5492
|
var FLEET_POLICY_TYP = "fleet-policy+jwt";
|
|
@@ -5488,8 +5535,8 @@ async function verifyFleetPolicy(jws, jwks, options) {
|
|
|
5488
5535
|
let payloadBytes;
|
|
5489
5536
|
let header;
|
|
5490
5537
|
try {
|
|
5491
|
-
const keySet = (0,
|
|
5492
|
-
const result = await (0,
|
|
5538
|
+
const keySet = (0, import_jose5.createLocalJWKSet)(jwks);
|
|
5539
|
+
const result = await (0, import_jose5.compactVerify)(jws, keySet, { algorithms: ["ES256"] });
|
|
5493
5540
|
payloadBytes = result.payload;
|
|
5494
5541
|
header = result.protectedHeader;
|
|
5495
5542
|
} catch (err) {
|
|
@@ -5535,9 +5582,9 @@ async function resolveFleetJwks(pinned, chain, ownerId) {
|
|
|
5535
5582
|
let lastSeq = 0;
|
|
5536
5583
|
for (const link of chain) {
|
|
5537
5584
|
try {
|
|
5538
|
-
const { payload, protectedHeader } = await (0,
|
|
5585
|
+
const { payload, protectedHeader } = await (0, import_jose5.compactVerify)(
|
|
5539
5586
|
link,
|
|
5540
|
-
(0,
|
|
5587
|
+
(0, import_jose5.createLocalJWKSet)(trusted),
|
|
5541
5588
|
{ algorithms: ["ES256"] }
|
|
5542
5589
|
);
|
|
5543
5590
|
if (protectedHeader.typ !== FLEET_KEYS_TYP) continue;
|
|
@@ -3713,7 +3713,7 @@ Policy saved to ${outputPath}`);
|
|
|
3713
3713
|
};
|
|
3714
3714
|
|
|
3715
3715
|
// src/version.ts
|
|
3716
|
-
var SDK_VERSION = "5.
|
|
3716
|
+
var SDK_VERSION = "5.16.0";
|
|
3717
3717
|
|
|
3718
3718
|
// src/http.ts
|
|
3719
3719
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -4754,6 +4754,8 @@ function getCacheKey(request2, counterpartyId) {
|
|
|
4754
4754
|
request2.durationRequired ?? "",
|
|
4755
4755
|
request2.invocationProtocol || "",
|
|
4756
4756
|
request2.enableRuntimeChallenge ? "1" : "0",
|
|
4757
|
+
// 5.16.0: route policy changes the verdict (owners / challenge).
|
|
4758
|
+
request2.routePolicy ? JSON.stringify(request2.routePolicy) : "",
|
|
4757
4759
|
// callerMetadata fields contribute to risk model; include the ones
|
|
4758
4760
|
// backend reads. sourceIp/userAgent/forwardedFor change per-request
|
|
4759
4761
|
// so their inclusion effectively forces a re-check for any varying
|
|
@@ -4926,6 +4928,7 @@ async function callVerifyAccessAPI(config, request2) {
|
|
|
4926
4928
|
if (requestData.subAgentDepth !== void 0) body.subAgentDepth = requestData.subAgentDepth;
|
|
4927
4929
|
if (requestData.enableRuntimeChallenge)
|
|
4928
4930
|
body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
4931
|
+
if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
|
|
4929
4932
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
4930
4933
|
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
4931
4934
|
if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
|
|
@@ -4936,6 +4939,7 @@ async function callVerifyAccessAPI(config, request2) {
|
|
|
4936
4939
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
4937
4940
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
4938
4941
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
4942
|
+
if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
|
|
4939
4943
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
4940
4944
|
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
4941
4945
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
@@ -5086,7 +5090,8 @@ async function verify(config, request2, options) {
|
|
|
5086
5090
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
5087
5091
|
);
|
|
5088
5092
|
}
|
|
5089
|
-
|
|
5093
|
+
const uncacheable = Boolean(request2.commerceArtifacts);
|
|
5094
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
5090
5095
|
const cached = getCachedResult(request2, mergedConfig.counterpartyId);
|
|
5091
5096
|
if (cached) {
|
|
5092
5097
|
if (mergedConfig.debug) {
|
|
@@ -5167,7 +5172,10 @@ async function verify(config, request2, options) {
|
|
|
5167
5172
|
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
5168
5173
|
settlementToken: apiResponse.settlementToken,
|
|
5169
5174
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
5170
|
-
fulfilment: apiResponse.fulfilment
|
|
5175
|
+
fulfilment: apiResponse.fulfilment,
|
|
5176
|
+
mandates: apiResponse.mandates,
|
|
5177
|
+
kyaToken: apiResponse.kyaToken,
|
|
5178
|
+
aep: apiResponse.aep
|
|
5171
5179
|
};
|
|
5172
5180
|
return result2;
|
|
5173
5181
|
}
|
|
@@ -5177,7 +5185,10 @@ async function verify(config, request2, options) {
|
|
|
5177
5185
|
trustScore: apiResponse.agent.trustScore,
|
|
5178
5186
|
trustLevel: getTrustLevel(apiResponse.agent.trustScore),
|
|
5179
5187
|
blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
|
|
5180
|
-
status: apiResponse.agent.agentStatus
|
|
5188
|
+
status: apiResponse.agent.agentStatus,
|
|
5189
|
+
...apiResponse.agent.protocolIdentities && {
|
|
5190
|
+
protocolIdentities: apiResponse.agent.protocolIdentities
|
|
5191
|
+
}
|
|
5181
5192
|
} : void 0;
|
|
5182
5193
|
const developer = apiResponse.developer ? {
|
|
5183
5194
|
astradId: apiResponse.developer.kyaOwnerId,
|
|
@@ -5228,7 +5239,11 @@ async function verify(config, request2, options) {
|
|
|
5228
5239
|
settlementOutcome: apiResponse.settlementOutcome,
|
|
5229
5240
|
settlementToken: apiResponse.settlementToken,
|
|
5230
5241
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
5231
|
-
fulfilment: apiResponse.fulfilment
|
|
5242
|
+
fulfilment: apiResponse.fulfilment,
|
|
5243
|
+
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
5244
|
+
mandates: apiResponse.mandates,
|
|
5245
|
+
kyaToken: apiResponse.kyaToken,
|
|
5246
|
+
aep: apiResponse.aep
|
|
5232
5247
|
};
|
|
5233
5248
|
if (result.recommendation === "deny") {
|
|
5234
5249
|
result.policyAllowed = false;
|
|
@@ -5248,7 +5263,9 @@ async function verify(config, request2, options) {
|
|
|
5248
5263
|
}
|
|
5249
5264
|
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
5250
5265
|
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
5251
|
-
|
|
5266
|
+
if (!uncacheable) {
|
|
5267
|
+
cacheResult(request2, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
5268
|
+
}
|
|
5252
5269
|
}
|
|
5253
5270
|
return result;
|
|
5254
5271
|
}
|
|
@@ -5259,6 +5276,9 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
5259
5276
|
// src/metadata-capture.ts
|
|
5260
5277
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
5261
5278
|
|
|
5279
|
+
// src/adapters/commerce-detect.ts
|
|
5280
|
+
var MAX_BODY_BYTES = 64 * 1024;
|
|
5281
|
+
|
|
5262
5282
|
// src/edge-config.ts
|
|
5263
5283
|
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
5264
5284
|
version: 1,
|
|
@@ -5568,6 +5588,33 @@ var import_node_crypto4 = require("crypto");
|
|
|
5568
5588
|
// src/transport/registry/visa.ts
|
|
5569
5589
|
var import_jose = require("jose");
|
|
5570
5590
|
|
|
5591
|
+
// src/ucp/profile.ts
|
|
5592
|
+
var UCP_VERSION = "2026-08-25";
|
|
5593
|
+
var SPEC = `https://ucp.dev/${UCP_VERSION}/specification`;
|
|
5594
|
+
var SCHEMAS = `https://ucp.dev/${UCP_VERSION}/schemas`;
|
|
5595
|
+
|
|
5596
|
+
// src/ucp/signatures.ts
|
|
5597
|
+
var import_http_message_signatures3 = require("http-message-signatures");
|
|
5598
|
+
|
|
5599
|
+
// src/http-signatures/sign.ts
|
|
5600
|
+
var import_http_message_signatures2 = require("http-message-signatures");
|
|
5601
|
+
|
|
5602
|
+
// src/ucp/checkout-kit.ts
|
|
5603
|
+
var import_jose3 = require("jose");
|
|
5604
|
+
|
|
5605
|
+
// src/mandates/sd-jwt.ts
|
|
5606
|
+
var import_jose2 = require("jose");
|
|
5607
|
+
|
|
5608
|
+
// src/idempotency/index.ts
|
|
5609
|
+
var DEFAULT_IDEMPOTENCY_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
5610
|
+
|
|
5611
|
+
// src/payments/kyapay.ts
|
|
5612
|
+
var import_jose4 = require("jose");
|
|
5613
|
+
|
|
5614
|
+
// src/aep/core.ts
|
|
5615
|
+
var ED25519_PKCS8_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
5616
|
+
var ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
5617
|
+
|
|
5571
5618
|
// src/gateway/modes/online.ts
|
|
5572
5619
|
function toGatewayConfig(config) {
|
|
5573
5620
|
return {
|
|
@@ -6595,7 +6642,7 @@ function writeState(paths, state) {
|
|
|
6595
6642
|
|
|
6596
6643
|
// src/fleet/policy-verify.ts
|
|
6597
6644
|
var import_crypto = require("crypto");
|
|
6598
|
-
var
|
|
6645
|
+
var import_jose5 = require("jose");
|
|
6599
6646
|
|
|
6600
6647
|
// src/fleet/types.ts
|
|
6601
6648
|
var FLEET_POLICY_TYP = "fleet-policy+jwt";
|
|
@@ -6644,8 +6691,8 @@ async function verifyFleetPolicy(jws, jwks, options) {
|
|
|
6644
6691
|
let payloadBytes;
|
|
6645
6692
|
let header;
|
|
6646
6693
|
try {
|
|
6647
|
-
const keySet = (0,
|
|
6648
|
-
const result = await (0,
|
|
6694
|
+
const keySet = (0, import_jose5.createLocalJWKSet)(jwks);
|
|
6695
|
+
const result = await (0, import_jose5.compactVerify)(jws, keySet, { algorithms: ["ES256"] });
|
|
6649
6696
|
payloadBytes = result.payload;
|
|
6650
6697
|
header = result.protectedHeader;
|
|
6651
6698
|
} catch (err) {
|
|
@@ -6691,9 +6738,9 @@ async function resolveFleetJwks(pinned, chain, ownerId) {
|
|
|
6691
6738
|
let lastSeq = 0;
|
|
6692
6739
|
for (const link of chain) {
|
|
6693
6740
|
try {
|
|
6694
|
-
const { payload, protectedHeader } = await (0,
|
|
6741
|
+
const { payload, protectedHeader } = await (0, import_jose5.compactVerify)(
|
|
6695
6742
|
link,
|
|
6696
|
-
(0,
|
|
6743
|
+
(0, import_jose5.createLocalJWKSet)(trusted),
|
|
6697
6744
|
{ algorithms: ["ES256"] }
|
|
6698
6745
|
);
|
|
6699
6746
|
if (protectedHeader.typ !== FLEET_KEYS_TYP) continue;
|
|
@@ -6937,6 +6984,88 @@ function writeManagedSettings(files, outDir) {
|
|
|
6937
6984
|
});
|
|
6938
6985
|
}
|
|
6939
6986
|
|
|
6987
|
+
// src/fleet/git-route.ts
|
|
6988
|
+
var import_child_process2 = require("child_process");
|
|
6989
|
+
var realGit = (args) => (0, import_child_process2.execFileSync)("git", args, { encoding: "utf-8" });
|
|
6990
|
+
function gitRouteConfig(opts) {
|
|
6991
|
+
const base2 = opts.checkpoint.replace(/\/+$/, "");
|
|
6992
|
+
if (!/^https:\/\//.test(base2) && !/^http:\/\/(localhost|127\.0\.0\.1)(:\d+)?$/.test(base2)) {
|
|
6993
|
+
throw new Error("--checkpoint must be an https:// URL");
|
|
6994
|
+
}
|
|
6995
|
+
if (!/^ASTRA-[A-Za-z0-9_-]{8,64}$/.test(opts.agent))
|
|
6996
|
+
throw new Error("--agent must be an ASTRA-id");
|
|
6997
|
+
if (!/^[A-Za-z0-9_-]{4,120}$/.test(opts.slug))
|
|
6998
|
+
throw new Error("--slug must be the connector slug");
|
|
6999
|
+
const upstream = opts.upstream ?? "github";
|
|
7000
|
+
return [
|
|
7001
|
+
[`url.${base2}/a/${opts.slug}/git/${upstream}/.insteadOf`, opts.host ?? "https://github.com/"],
|
|
7002
|
+
[`credential.${base2}.helper`, "!astrasync guard git-credential"],
|
|
7003
|
+
["astrasync.agent", opts.agent],
|
|
7004
|
+
["astrasync.checkpoint", base2]
|
|
7005
|
+
];
|
|
7006
|
+
}
|
|
7007
|
+
function applyGitRoute(opts, git = realGit) {
|
|
7008
|
+
const entries = gitRouteConfig(opts);
|
|
7009
|
+
for (const [key, value] of entries) git(["config", "--global", key, value]);
|
|
7010
|
+
return entries.map(([k, v]) => `${k} = ${v}`);
|
|
7011
|
+
}
|
|
7012
|
+
function removeGitRoute(git = realGit) {
|
|
7013
|
+
let base2 = "";
|
|
7014
|
+
try {
|
|
7015
|
+
base2 = git(["config", "--global", "--get", "astrasync.checkpoint"]).trim();
|
|
7016
|
+
} catch {
|
|
7017
|
+
return [];
|
|
7018
|
+
}
|
|
7019
|
+
const removed = [];
|
|
7020
|
+
const unset = (args) => {
|
|
7021
|
+
try {
|
|
7022
|
+
git(["config", "--global", ...args]);
|
|
7023
|
+
removed.push(args[args.length - 1]);
|
|
7024
|
+
} catch {
|
|
7025
|
+
}
|
|
7026
|
+
};
|
|
7027
|
+
let urls = "";
|
|
7028
|
+
try {
|
|
7029
|
+
urls = git(["config", "--global", "--get-regexp", "^url\\..*\\.insteadof$"]);
|
|
7030
|
+
} catch {
|
|
7031
|
+
}
|
|
7032
|
+
for (const line of urls.split("\n")) {
|
|
7033
|
+
const key = line.split(" ")[0];
|
|
7034
|
+
if (key && key.toLowerCase().startsWith(`url.${base2}/`.toLowerCase())) unset(["--unset", key]);
|
|
7035
|
+
}
|
|
7036
|
+
unset(["--unset", `credential.${base2}.helper`]);
|
|
7037
|
+
unset(["--unset", "astrasync.agent"]);
|
|
7038
|
+
unset(["--unset", "astrasync.checkpoint"]);
|
|
7039
|
+
return removed;
|
|
7040
|
+
}
|
|
7041
|
+
function gitCredentialAnswer(action, input, deps) {
|
|
7042
|
+
if (action !== "get" || !deps.agent || !deps.checkpoint || !deps.deviceCredential) return "";
|
|
7043
|
+
const fields = Object.fromEntries(
|
|
7044
|
+
input.split("\n").map((l) => l.split("=")).filter((p) => p.length >= 2).map(([k, ...v]) => [k, v.join("=")])
|
|
7045
|
+
);
|
|
7046
|
+
const host = new URL(deps.checkpoint).host;
|
|
7047
|
+
if (fields.host && fields.host !== host) return "";
|
|
7048
|
+
return `username=${deps.agent}
|
|
7049
|
+
password=${deps.deviceCredential}
|
|
7050
|
+
`;
|
|
7051
|
+
}
|
|
7052
|
+
function runGitCredential(action, input, git = realGit) {
|
|
7053
|
+
const read = (key) => {
|
|
7054
|
+
try {
|
|
7055
|
+
return git(["config", "--global", "--get", key]).trim();
|
|
7056
|
+
} catch {
|
|
7057
|
+
return void 0;
|
|
7058
|
+
}
|
|
7059
|
+
};
|
|
7060
|
+
const loaded = loadEnrolment(fleetPaths());
|
|
7061
|
+
const deviceCredential = loaded && "enrolment" in loaded ? loaded.enrolment.credential : void 0;
|
|
7062
|
+
return gitCredentialAnswer(action, input, {
|
|
7063
|
+
agent: read("astrasync.agent"),
|
|
7064
|
+
checkpoint: read("astrasync.checkpoint"),
|
|
7065
|
+
deviceCredential
|
|
7066
|
+
});
|
|
7067
|
+
}
|
|
7068
|
+
|
|
6940
7069
|
// src/cli/guard.ts
|
|
6941
7070
|
var DEFAULT_POLICY_PATH = "./local-policy.yaml";
|
|
6942
7071
|
var DEFAULT_CONFIG_DIR = ".astrasync";
|
|
@@ -7472,6 +7601,32 @@ async function cmdFleetStatus() {
|
|
|
7472
7601
|
const status = await getFleetStatus(fleetPaths());
|
|
7473
7602
|
for (const line of formatFleetStatus(status)) console.log(line);
|
|
7474
7603
|
}
|
|
7604
|
+
async function cmdGitRoute() {
|
|
7605
|
+
try {
|
|
7606
|
+
if (process.argv.includes("--undo")) {
|
|
7607
|
+
const removed = removeGitRoute();
|
|
7608
|
+
console.log(removed.length ? `Removed: ${removed.join(", ")}` : "No git route was set.");
|
|
7609
|
+
return;
|
|
7610
|
+
}
|
|
7611
|
+
const lines = applyGitRoute({
|
|
7612
|
+
checkpoint: flagValue("--checkpoint") ?? "",
|
|
7613
|
+
slug: flagValue("--slug") ?? "",
|
|
7614
|
+
agent: flagValue("--agent") ?? "",
|
|
7615
|
+
upstream: flagValue("--upstream")
|
|
7616
|
+
});
|
|
7617
|
+
console.log("git now fetches and pushes github.com through your Workforce Guard checkpoint:");
|
|
7618
|
+
for (const l of lines) console.log(` ${l}`);
|
|
7619
|
+
console.log("Commits still run your local hooks. Undo with: astrasync guard git-route --undo");
|
|
7620
|
+
} catch (err) {
|
|
7621
|
+
console.error(`git-route failed: ${err instanceof Error ? err.message : String(err)}`);
|
|
7622
|
+
process.exit(1);
|
|
7623
|
+
}
|
|
7624
|
+
}
|
|
7625
|
+
async function cmdGitCredential() {
|
|
7626
|
+
const action = process.argv[process.argv.indexOf("git-credential") + 1] ?? "";
|
|
7627
|
+
const input = fs.readFileSync(0, "utf-8");
|
|
7628
|
+
process.stdout.write(runGitCredential(action, input));
|
|
7629
|
+
}
|
|
7475
7630
|
async function cmdManagedSettings() {
|
|
7476
7631
|
const targets = [];
|
|
7477
7632
|
if (process.argv.includes("--claude")) targets.push("claude");
|
|
@@ -7540,6 +7695,12 @@ async function main() {
|
|
|
7540
7695
|
case "managed-settings":
|
|
7541
7696
|
await cmdManagedSettings();
|
|
7542
7697
|
break;
|
|
7698
|
+
case "git-route":
|
|
7699
|
+
await cmdGitRoute();
|
|
7700
|
+
break;
|
|
7701
|
+
case "git-credential":
|
|
7702
|
+
await cmdGitCredential();
|
|
7703
|
+
break;
|
|
7543
7704
|
default:
|
|
7544
7705
|
console.log("AstraSync Local Guard\n");
|
|
7545
7706
|
console.log("Usage: astrasync guard <command>\n");
|
|
@@ -7564,6 +7725,11 @@ async function main() {
|
|
|
7564
7725
|
console.log(" (--api-base-url <url>, --system for machine scope)");
|
|
7565
7726
|
console.log(" fleet-status Show fleet enrolment, signed policy and heartbeat");
|
|
7566
7727
|
console.log(" managed-settings Print MDM templates (--claude, --codex, --out <dir>)");
|
|
7728
|
+
console.log(" git-route Route git through your Workforce Guard checkpoint");
|
|
7729
|
+
console.log(
|
|
7730
|
+
" (--checkpoint <url> --slug <connector> --agent <ASTRA-id>;"
|
|
7731
|
+
);
|
|
7732
|
+
console.log(" --undo to remove)");
|
|
7567
7733
|
console.log("");
|
|
7568
7734
|
process.exit(command ? 1 : 0);
|
|
7569
7735
|
}
|