@astrasyncai/verification-gateway 5.17.0 → 5.17.1

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.
Files changed (94) hide show
  1. package/README.md +94 -18
  2. package/dist/adapters/express.d.mts +1 -1
  3. package/dist/adapters/express.d.ts +1 -1
  4. package/dist/adapters/express.js +33 -5
  5. package/dist/adapters/express.js.map +1 -1
  6. package/dist/adapters/express.mjs +33 -5
  7. package/dist/adapters/express.mjs.map +1 -1
  8. package/dist/adapters/mcp.d.mts +1 -1
  9. package/dist/adapters/mcp.d.ts +1 -1
  10. package/dist/adapters/mcp.js +24 -5
  11. package/dist/adapters/mcp.js.map +1 -1
  12. package/dist/adapters/mcp.mjs +24 -5
  13. package/dist/adapters/mcp.mjs.map +1 -1
  14. package/dist/adapters/nextjs.d.mts +1 -1
  15. package/dist/adapters/nextjs.d.ts +1 -1
  16. package/dist/adapters/nextjs.js +24 -5
  17. package/dist/adapters/nextjs.js.map +1 -1
  18. package/dist/adapters/nextjs.mjs +24 -5
  19. package/dist/adapters/nextjs.mjs.map +1 -1
  20. package/dist/adapters/sdk.d.mts +1 -1
  21. package/dist/adapters/sdk.d.ts +1 -1
  22. package/dist/adapters/sdk.js +5 -1
  23. package/dist/adapters/sdk.js.map +1 -1
  24. package/dist/adapters/sdk.mjs +5 -1
  25. package/dist/adapters/sdk.mjs.map +1 -1
  26. package/dist/agent/index.js +1 -1
  27. package/dist/agent/index.js.map +1 -1
  28. package/dist/agent/index.mjs +1 -1
  29. package/dist/agent/index.mjs.map +1 -1
  30. package/dist/bin/astrasync-claude-hook.js +5 -1
  31. package/dist/bin/astrasync-codex-hook.js +5 -1
  32. package/dist/bin/astrasync-guard.js +32 -7
  33. package/dist/bin/astrasync.js +32 -7
  34. package/dist/browser/background.js +5 -1
  35. package/dist/browser/background.js.map +1 -1
  36. package/dist/browser/background.mjs +5 -1
  37. package/dist/browser/background.mjs.map +1 -1
  38. package/dist/cli/index.js +1 -1
  39. package/dist/cli/index.js.map +1 -1
  40. package/dist/cli/index.mjs +1 -1
  41. package/dist/cli/index.mjs.map +1 -1
  42. package/dist/codex/index.js +5 -1
  43. package/dist/codex/index.js.map +1 -1
  44. package/dist/codex/index.mjs +5 -1
  45. package/dist/codex/index.mjs.map +1 -1
  46. package/dist/cursor/extension.js +5 -1
  47. package/dist/cursor/extension.js.map +1 -1
  48. package/dist/cursor/extension.mjs +5 -1
  49. package/dist/cursor/extension.mjs.map +1 -1
  50. package/dist/edge-config.d.mts +1 -1
  51. package/dist/edge-config.d.ts +1 -1
  52. package/dist/edge-config.js +1 -1
  53. package/dist/edge-config.js.map +1 -1
  54. package/dist/edge-config.mjs +1 -1
  55. package/dist/edge-config.mjs.map +1 -1
  56. package/dist/edge-core/index.d.mts +1 -1
  57. package/dist/edge-core/index.d.ts +1 -1
  58. package/dist/edge-core/index.js +5 -1
  59. package/dist/edge-core/index.js.map +1 -1
  60. package/dist/edge-core/index.mjs +5 -1
  61. package/dist/edge-core/index.mjs.map +1 -1
  62. package/dist/gateway/gateway.js +5 -1
  63. package/dist/gateway/gateway.js.map +1 -1
  64. package/dist/gateway/gateway.mjs +5 -1
  65. package/dist/gateway/gateway.mjs.map +1 -1
  66. package/dist/git-trigger/git-hooks.d.mts +1 -1
  67. package/dist/git-trigger/git-hooks.d.ts +1 -1
  68. package/dist/index.d.mts +16 -2
  69. package/dist/index.d.ts +16 -2
  70. package/dist/index.js +33 -5
  71. package/dist/index.js.map +1 -1
  72. package/dist/index.mjs +33 -5
  73. package/dist/index.mjs.map +1 -1
  74. package/dist/registration/index.js +1 -1
  75. package/dist/registration/index.js.map +1 -1
  76. package/dist/registration/index.mjs +1 -1
  77. package/dist/registration/index.mjs.map +1 -1
  78. package/dist/transport/index.js +1 -1
  79. package/dist/transport/index.js.map +1 -1
  80. package/dist/transport/index.mjs +1 -1
  81. package/dist/transport/index.mjs.map +1 -1
  82. package/dist/{types-Bm1QvGqI.d.ts → types-DA8LzAOB.d.ts} +6 -0
  83. package/dist/{types-Blz520bR.d.mts → types-DRb_plOh.d.mts} +14 -0
  84. package/dist/{types-Blz520bR.d.ts → types-DRb_plOh.d.ts} +14 -0
  85. package/dist/{types-DBe4hgfT.d.mts → types-vNBvYD7Z.d.mts} +6 -0
  86. package/dist/ui/index.d.mts +1 -1
  87. package/dist/ui/index.d.ts +1 -1
  88. package/dist/verify.d.mts +1 -1
  89. package/dist/verify.d.ts +1 -1
  90. package/dist/verify.js +5 -1
  91. package/dist/verify.js.map +1 -1
  92. package/dist/verify.mjs +5 -1
  93. package/dist/verify.mjs.map +1 -1
  94. package/package.json +1 -1
@@ -717,6 +717,12 @@ interface VerificationRequest {
717
717
  enableRuntimeChallenge?: boolean;
718
718
  /** 5.16.0: the matched route's policy for verify-access to enforce. */
719
719
  routePolicy?: RoutePolicy;
720
+ /**
721
+ * 5.17.1: the route itself holds a request that needs the owner's approval
722
+ * (see ExpressMiddlewareOptions.approvalHeldByRoute), so verify-access
723
+ * reports the hold but creates no approval of its own.
724
+ */
725
+ approvalHeldByRoute?: boolean;
720
726
  /** Create a verification session (returns sessionId) */
721
727
  createSession?: boolean;
722
728
  /** Counterparty type */
@@ -775,6 +775,12 @@ interface VerificationRequest {
775
775
  enableRuntimeChallenge?: boolean;
776
776
  /** 5.16.0: the matched route's policy for verify-access to enforce. */
777
777
  routePolicy?: RoutePolicy;
778
+ /**
779
+ * 5.17.1: the route itself holds a request that needs the owner's approval
780
+ * (see ExpressMiddlewareOptions.approvalHeldByRoute), so verify-access
781
+ * reports the hold but creates no approval of its own.
782
+ */
783
+ approvalHeldByRoute?: boolean;
778
784
  /** Create a verification session (returns sessionId) */
779
785
  createSession?: boolean;
780
786
  /** Counterparty type */
@@ -985,6 +991,14 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
985
991
  recordDecisions?: boolean;
986
992
  /** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
987
993
  enableRuntimeChallenge?: boolean;
994
+ /**
995
+ * 5.17.1: return true for requests whose route asks the owner for approval
996
+ * itself (it creates its own hold and answers 202 while it waits). For those
997
+ * requests a result that only needs the owner's approval is passed to the
998
+ * route instead of refused, and verify-access creates no approval, so the
999
+ * owner approves once. Any deny is still refused. Default: none.
1000
+ */
1001
+ approvalHeldByRoute?: (req: unknown) => boolean;
988
1002
  /**
989
1003
  * Refresh interval (ms) for the remote-fetched route policy. Default:
990
1004
  * 5 minutes. Operators can shorten this to test policy edits faster, or
@@ -775,6 +775,12 @@ interface VerificationRequest {
775
775
  enableRuntimeChallenge?: boolean;
776
776
  /** 5.16.0: the matched route's policy for verify-access to enforce. */
777
777
  routePolicy?: RoutePolicy;
778
+ /**
779
+ * 5.17.1: the route itself holds a request that needs the owner's approval
780
+ * (see ExpressMiddlewareOptions.approvalHeldByRoute), so verify-access
781
+ * reports the hold but creates no approval of its own.
782
+ */
783
+ approvalHeldByRoute?: boolean;
778
784
  /** Create a verification session (returns sessionId) */
779
785
  createSession?: boolean;
780
786
  /** Counterparty type */
@@ -985,6 +991,14 @@ interface ExpressMiddlewareOptions extends GatewayConfig {
985
991
  recordDecisions?: boolean;
986
992
  /** Ask for a runtime challenge on every verify-access call (default: false — opt-in, round 27.8) */
987
993
  enableRuntimeChallenge?: boolean;
994
+ /**
995
+ * 5.17.1: return true for requests whose route asks the owner for approval
996
+ * itself (it creates its own hold and answers 202 while it waits). For those
997
+ * requests a result that only needs the owner's approval is passed to the
998
+ * route instead of refused, and verify-access creates no approval, so the
999
+ * owner approves once. Any deny is still refused. Default: none.
1000
+ */
1001
+ approvalHeldByRoute?: (req: unknown) => boolean;
988
1002
  /**
989
1003
  * Refresh interval (ms) for the remote-fetched route policy. Default:
990
1004
  * 5 minutes. Operators can shorten this to test policy edits faster, or
@@ -717,6 +717,12 @@ interface VerificationRequest {
717
717
  enableRuntimeChallenge?: boolean;
718
718
  /** 5.16.0: the matched route's policy for verify-access to enforce. */
719
719
  routePolicy?: RoutePolicy;
720
+ /**
721
+ * 5.17.1: the route itself holds a request that needs the owner's approval
722
+ * (see ExpressMiddlewareOptions.approvalHeldByRoute), so verify-access
723
+ * reports the hold but creates no approval of its own.
724
+ */
725
+ approvalHeldByRoute?: boolean;
720
726
  /** Create a verification session (returns sessionId) */
721
727
  createSession?: boolean;
722
728
  /** Counterparty type */
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-Blz520bR.mjs';
1
+ import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-DRb_plOh.mjs';
2
2
 
3
3
  /**
4
4
  * AstraSync Verification Interstitial Component
@@ -1,4 +1,4 @@
1
- import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-Blz520bR.js';
1
+ import { V as VerificationInterstitialProps, d as VerificationResult, A as AgentCredentials, b as GuidanceInfo, T as TrustLevel } from '../types-DRb_plOh.js';
2
2
 
3
3
  /**
4
4
  * AstraSync Verification Interstitial Component
package/dist/verify.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-DBe4hgfT.mjs';
1
+ import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-vNBvYD7Z.mjs';
2
2
  import { ObservedMetadata } from './metadata-capture.mjs';
3
3
 
4
4
  /**
package/dist/verify.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-Bm1QvGqI.js';
1
+ import { A as AgentCredentials, G as GatewayConfig, a as AttemptReport, V as VerificationRequest, c as VerificationResult } from './types-DA8LzAOB.js';
2
2
  import { ObservedMetadata } from './metadata-capture.js';
3
3
 
4
4
  /**
package/dist/verify.js CHANGED
@@ -37,7 +37,7 @@ __export(verify_exports, {
37
37
  module.exports = __toCommonJS(verify_exports);
38
38
 
39
39
  // src/version.ts
40
- var SDK_VERSION = "5.17.0";
40
+ var SDK_VERSION = "5.17.1";
41
41
 
42
42
  // src/http.ts
43
43
  var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
@@ -202,6 +202,7 @@ function getCacheKey(request, counterpartyId) {
202
202
  request.enableRuntimeChallenge ? "1" : "0",
203
203
  // 5.16.0: route policy changes the verdict (owners / challenge).
204
204
  request.routePolicy ? JSON.stringify(request.routePolicy) : "",
205
+ request.approvalHeldByRoute ? "1" : "0",
205
206
  // callerMetadata fields contribute to risk model; include the ones
206
207
  // backend reads. sourceIp/userAgent/forwardedFor change per-request
207
208
  // so their inclusion effectively forces a re-check for any varying
@@ -415,6 +416,7 @@ async function callVerifyAccessAPI(config, request) {
415
416
  if (requestData.enableRuntimeChallenge)
416
417
  body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
417
418
  if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
419
+ if (requestData.approvalHeldByRoute) body.approvalHeldByRoute = true;
418
420
  if (requestData.createSession) body.createSession = requestData.createSession;
419
421
  if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
420
422
  if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
@@ -746,6 +748,8 @@ async function verify(config, request, options) {
746
748
  } else if (result.recommendation === "step_up_required" && result.identityVerified) {
747
749
  result.requiresStepUp = true;
748
750
  result.denialReasons = serverDenialReasons ?? result.recommendationReasons ?? ["Step-up verification required"];
751
+ const stepUpFailures = apiResponse.access?.failures;
752
+ if (stepUpFailures?.length) result.failures = stepUpFailures;
749
753
  }
750
754
  const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
751
755
  if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {