@astrasyncai/verification-gateway 2.4.8 → 2.4.9

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 (89) hide show
  1. package/dist/adapter-interface/interface.d.mts +2 -2
  2. package/dist/adapter-interface/interface.d.ts +2 -2
  3. package/dist/adapters/express.d.mts +2 -2
  4. package/dist/adapters/express.d.ts +2 -2
  5. package/dist/adapters/express.js +29 -15
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +29 -15
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/mcp.d.mts +1 -1
  10. package/dist/adapters/mcp.d.ts +1 -1
  11. package/dist/adapters/mcp.js +30 -14
  12. package/dist/adapters/mcp.js.map +1 -1
  13. package/dist/adapters/mcp.mjs +30 -14
  14. package/dist/adapters/mcp.mjs.map +1 -1
  15. package/dist/adapters/nextjs.d.mts +2 -2
  16. package/dist/adapters/nextjs.d.ts +2 -2
  17. package/dist/adapters/nextjs.js +37 -16
  18. package/dist/adapters/nextjs.js.map +1 -1
  19. package/dist/adapters/nextjs.mjs +37 -16
  20. package/dist/adapters/nextjs.mjs.map +1 -1
  21. package/dist/adapters/sdk.d.mts +2 -2
  22. package/dist/adapters/sdk.d.ts +2 -2
  23. package/dist/adapters/sdk.js +31 -13
  24. package/dist/adapters/sdk.js.map +1 -1
  25. package/dist/adapters/sdk.mjs +31 -13
  26. package/dist/adapters/sdk.mjs.map +1 -1
  27. package/dist/agent/index.d.mts +2 -2
  28. package/dist/agent/index.d.ts +2 -2
  29. package/dist/browser/background.js +25 -12
  30. package/dist/browser/background.js.map +1 -1
  31. package/dist/browser/background.mjs +25 -12
  32. package/dist/browser/background.mjs.map +1 -1
  33. package/dist/browser/browser-adapter.d.mts +2 -2
  34. package/dist/browser/browser-adapter.d.ts +2 -2
  35. package/dist/cli/index.d.mts +2 -2
  36. package/dist/cli/index.d.ts +2 -2
  37. package/dist/cursor/cursor-adapter.d.mts +2 -2
  38. package/dist/cursor/cursor-adapter.d.ts +2 -2
  39. package/dist/cursor/extension.d.mts +2 -2
  40. package/dist/cursor/extension.d.ts +2 -2
  41. package/dist/cursor/extension.js +25 -12
  42. package/dist/cursor/extension.js.map +1 -1
  43. package/dist/cursor/extension.mjs +25 -12
  44. package/dist/cursor/extension.mjs.map +1 -1
  45. package/dist/{express-DvVjR2H4.d.mts → express-4WStX3PV.d.mts} +1 -1
  46. package/dist/{express-714gJbaW.d.ts → express-C1ePFB7n.d.ts} +1 -1
  47. package/dist/gateway/gateway.d.mts +2 -2
  48. package/dist/gateway/gateway.d.ts +2 -2
  49. package/dist/gateway/gateway.js +25 -12
  50. package/dist/gateway/gateway.js.map +1 -1
  51. package/dist/gateway/gateway.mjs +25 -12
  52. package/dist/gateway/gateway.mjs.map +1 -1
  53. package/dist/git-trigger/git-hooks.d.mts +2 -2
  54. package/dist/git-trigger/git-hooks.d.ts +2 -2
  55. package/dist/{index-DYFS9QVb.d.mts → index-ChPX4WHl.d.mts} +1 -1
  56. package/dist/{index-DO0oG8ED.d.ts → index-Cjm-zBeZ.d.ts} +1 -1
  57. package/dist/{index-2WAlxs2G.d.ts → index-CzJMCgEy.d.ts} +1 -1
  58. package/dist/{index-P9t7M_dJ.d.mts → index-D8IEntil.d.mts} +1 -1
  59. package/dist/index.d.mts +22 -11
  60. package/dist/index.d.ts +22 -11
  61. package/dist/index.js +80 -25
  62. package/dist/index.js.map +1 -1
  63. package/dist/index.mjs +79 -25
  64. package/dist/index.mjs.map +1 -1
  65. package/dist/local-evaluator/evaluator.d.mts +2 -2
  66. package/dist/local-evaluator/evaluator.d.ts +2 -2
  67. package/dist/{nextjs-CZ-MwSOT.d.ts → nextjs-BIORS__0.d.ts} +1 -1
  68. package/dist/{nextjs-BCoH7EqF.d.mts → nextjs-CjzHdaXA.d.mts} +1 -1
  69. package/dist/registration/index.d.mts +76 -1
  70. package/dist/registration/index.d.ts +76 -1
  71. package/dist/registration/index.js +27 -2
  72. package/dist/registration/index.js.map +1 -1
  73. package/dist/registration/index.mjs +25 -1
  74. package/dist/registration/index.mjs.map +1 -1
  75. package/dist/{sdk-wwhFDXWX.d.mts → sdk-Chhz-FcT.d.mts} +9 -4
  76. package/dist/{sdk-kiA49vqJ.d.ts → sdk-CqTEQAc6.d.ts} +9 -4
  77. package/dist/transport/index.d.mts +2 -2
  78. package/dist/transport/index.d.ts +2 -2
  79. package/dist/{types-DOAb89cm.d.mts → types-DNK2BgIf.d.mts} +1 -1
  80. package/dist/{types-aucqzfUa.d.ts → types-DoWIuzfj.d.ts} +1 -1
  81. package/dist/{types-BwDmjIdr.d.mts → types-L15pYd2c.d.mts} +21 -4
  82. package/dist/{types-BwDmjIdr.d.ts → types-L15pYd2c.d.ts} +21 -4
  83. package/dist/ui/index.d.mts +1 -1
  84. package/dist/ui/index.d.ts +1 -1
  85. package/dist/ui/index.js +1 -1
  86. package/dist/ui/index.js.map +1 -1
  87. package/dist/ui/index.mjs +1 -1
  88. package/dist/ui/index.mjs.map +1 -1
  89. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { i as VerificationResult, d as ExpressMiddlewareOptions, b as AstraSyncCredentials } from './types-BwDmjIdr.mjs';
2
+ import { i as VerificationResult, d as ExpressMiddlewareOptions, b as AstraSyncCredentials } from './types-L15pYd2c.mjs';
3
3
 
4
4
  /**
5
5
  * AstraSync Universal Verification Gateway - Express Middleware
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { i as VerificationResult, d as ExpressMiddlewareOptions, b as AstraSyncCredentials } from './types-BwDmjIdr.js';
2
+ import { i as VerificationResult, d as ExpressMiddlewareOptions, b as AstraSyncCredentials } from './types-L15pYd2c.js';
3
3
 
4
4
  /**
5
5
  * AstraSync Universal Verification Gateway - Express Middleware
@@ -1,5 +1,5 @@
1
- import { a as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-DOAb89cm.mjs';
2
- import '../types-BwDmjIdr.mjs';
1
+ import { a as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-DNK2BgIf.mjs';
2
+ import '../types-L15pYd2c.mjs';
3
3
 
4
4
  /**
5
5
  * AstraSyncGateway — Primary API surface for agent verification.
@@ -1,5 +1,5 @@
1
- import { a as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-aucqzfUa.js';
2
- import '../types-BwDmjIdr.js';
1
+ import { a as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-DoWIuzfj.js';
2
+ import '../types-L15pYd2c.js';
3
3
 
4
4
  /**
5
5
  * AstraSyncGateway — Primary API surface for agent verification.
@@ -3055,7 +3055,7 @@ function getTrustLevel(score) {
3055
3055
  }
3056
3056
 
3057
3057
  // src/version.ts
3058
- var SDK_VERSION = "2.4.7";
3058
+ var SDK_VERSION = "2.4.9";
3059
3059
 
3060
3060
  // src/verify.ts
3061
3061
  var DEFAULT_CONFIG = {
@@ -3138,12 +3138,17 @@ function createGuidanceResponse(config, reason, options = {}) {
3138
3138
  ]
3139
3139
  };
3140
3140
  return {
3141
- verified: false,
3141
+ // Round-18 G4: createGuidanceResponse fires for unverified-agent path or
3142
+ // API-error fallback. Identity is not verified (no agent resolved);
3143
+ // policy is not evaluated (we never reached the gate).
3144
+ identityVerified: false,
3145
+ policyAllowed: false,
3142
3146
  // v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
3143
- // Adapters additionally short-circuit on `verified === false` before
3144
- // the gate check, but the access level still has to be honest at the
3145
- // data layer so downstream consumers (SDK adapters in other languages,
3146
- // custom integrations) inherit the correct semantics.
3147
+ // Adapters additionally short-circuit on `!identityVerified ||
3148
+ // !policyAllowed` before the gate check, but the access level still has
3149
+ // to be honest at the data layer so downstream consumers (SDK adapters
3150
+ // in other languages, custom integrations) inherit the correct
3151
+ // semantics.
3147
3152
  accessLevel: "none",
3148
3153
  guidance,
3149
3154
  denialReasons: reason ? [reason] : ["No valid agent credentials provided"],
@@ -3287,15 +3292,17 @@ async function verify(config, request) {
3287
3292
  }
3288
3293
  if (!apiResponse.access?.allowed) {
3289
3294
  const aggregatedFailures = apiResponse.access?.failures;
3295
+ const idVerifiedFromBackend = apiResponse.verificationContext?.idVerified === true;
3290
3296
  const result2 = {
3291
- verified: false,
3297
+ identityVerified: idVerifiedFromBackend,
3298
+ policyAllowed: false,
3292
3299
  // v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
3293
3300
  // Pre-rename this hardcoded `'guidance'`, which conflated with the
3294
3301
  // colocated `guidance: {...}` help-payload object below and let
3295
3302
  // denied requests pass any route gated at `'guidance'` because
3296
3303
  // `hasMinimumAccess('guidance', 'guidance') === true`. Adapters now
3297
- // ALSO short-circuit on `verified === false` before the gate check —
3298
- // belt-and-braces.
3304
+ // ALSO short-circuit on `!identityVerified || !policyAllowed` before
3305
+ // the gate check — belt-and-braces.
3299
3306
  accessLevel: "none",
3300
3307
  denialReasons: aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
3301
3308
  failures: aggregatedFailures,
@@ -3339,7 +3346,13 @@ async function verify(config, request) {
3339
3346
  const verificationContext = apiResponse.verificationContext;
3340
3347
  const accessLevel = apiResponse.access?.accessLevel ?? "standard";
3341
3348
  const result = {
3342
- verified: true,
3349
+ // Round-18 G4: backend allowed access. Identity is verified (we resolved
3350
+ // the caller to an agent) and policy passed all gates. Read idVerified
3351
+ // from verificationContext for symmetry with the deny branch; default true
3352
+ // on success path since `access.allowed === true` implies identity was
3353
+ // resolvable (anonymous-allow paths flow through createGuidanceResponse).
3354
+ identityVerified: apiResponse.verificationContext?.idVerified !== false,
3355
+ policyAllowed: true,
3343
3356
  accessLevel,
3344
3357
  agent,
3345
3358
  developer,
@@ -3362,7 +3375,7 @@ async function verify(config, request) {
3362
3375
  warningHeader: apiResponse.warningHeader
3363
3376
  };
3364
3377
  if (result.recommendation === "deny") {
3365
- result.verified = false;
3378
+ result.policyAllowed = false;
3366
3379
  result.accessLevel = "none";
3367
3380
  result.denialReasons = result.recommendationReasons || [
3368
3381
  "Access denied by AstraSync recommendation"
@@ -3454,7 +3467,7 @@ function toVerificationRequest(context, astraId) {
3454
3467
  };
3455
3468
  }
3456
3469
  function toDecision(result) {
3457
- if (result.verified) {
3470
+ if (result.identityVerified && result.policyAllowed) {
3458
3471
  return {
3459
3472
  recommendation: "ALLOW",
3460
3473
  reason: `Verified with access level: ${result.accessLevel}`,