@astrasyncai/verification-gateway 5.7.0 → 5.8.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 -0
- package/dist/adapters/express.js +4 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +4 -1
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.js +1 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.js +4 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +4 -1
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.js +1 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -1
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +1 -1
- package/dist/bin/astrasync-codex-hook.js +1 -1
- package/dist/bin/astrasync-guard.js +1 -1
- package/dist/bin/astrasync.js +1 -1
- package/dist/browser/background.js +1 -1
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +1 -1
- 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 +1 -1
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +1 -1
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +1 -1
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +1 -1
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.js +1 -1
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +1 -1
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +1 -1
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +1 -1
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/index.d.mts +9 -2
- package/dist/index.d.ts +9 -2
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -1
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/verify.js +1 -1
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +1 -1
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -474,6 +474,42 @@ interface StepUpApprovalInfo {
|
|
|
474
474
|
|
|
475
475
|
Poll the `pollUrl` (unauthenticated, rate-limited 60 req/min) to check if the owner approved. The `getApprovalPollingInfo(result)` helper extracts it from a `VerificationResult`.
|
|
476
476
|
|
|
477
|
+
### Attempt chain (`X-Astra-Attempt-Id`, 5.8.0)
|
|
478
|
+
|
|
479
|
+
Every interaction chain carries an attempt id of the form `att_<32 hex>`. The
|
|
480
|
+
AstraSync bridge stamps it on each call it delivers to your endpoint as the
|
|
481
|
+
`X-Astra-Attempt-Id` request header, and the express / Next.js middleware
|
|
482
|
+
automatically read the header and thread the id into verify-access (invalid
|
|
483
|
+
values are dropped). Two effects:
|
|
484
|
+
|
|
485
|
+
- **One intent = one approval.** A step-up the owner already approved for
|
|
486
|
+
this chain passes every later verify-access hop that carries the same
|
|
487
|
+
attempt id (the bridge pre-verify, your middleware's re-verify, and any
|
|
488
|
+
re-drive after a delivery failure) — it is never asked for twice.
|
|
489
|
+
- **Idempotency key.** Key your own idempotency/dedupe on the header value:
|
|
490
|
+
a re-drive of the same chain arrives with the SAME id, so replays of an
|
|
491
|
+
already-executed action can be detected venue-side.
|
|
492
|
+
|
|
493
|
+
No configuration is needed; direct (non-bridge) callers simply don't send the
|
|
494
|
+
header and behaviour is unchanged.
|
|
495
|
+
|
|
496
|
+
### Bridge-fronted endpoints: hold budgets
|
|
497
|
+
|
|
498
|
+
The bridge delivers your endpoint's response within an HTTP budget of **30 s
|
|
499
|
+
by default (60 s maximum, configurable per route via `responseBudgetMs` in
|
|
500
|
+
your registration's `routes[]`)**. `stepUpMaxWaitMs: 0` (hold in-request
|
|
501
|
+
until the approval decides) is designed for direct integrations and will
|
|
502
|
+
outlive that budget — behind the bridge, either:
|
|
503
|
+
|
|
504
|
+
- leave `stepUpMaxWaitMs` unset and return the 403 with `stepUpApproval`
|
|
505
|
+
in-band (the bridge renders the approval card and re-drives after
|
|
506
|
+
approval), or
|
|
507
|
+
- bound the hold to well under the budget (~20 s) so the deny still reaches
|
|
508
|
+
the bridge in time.
|
|
509
|
+
|
|
510
|
+
Either way the attempt chain above guarantees the post-approval re-drive
|
|
511
|
+
passes without a second approval.
|
|
512
|
+
|
|
477
513
|
## Checkout & settlement (astra-pay)
|
|
478
514
|
|
|
479
515
|
The first-party commerce rail: an agent shops under its ASTRA-id, holds NO
|
package/dist/adapters/express.js
CHANGED
|
@@ -26,7 +26,7 @@ __export(express_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(express_exports);
|
|
27
27
|
|
|
28
28
|
// src/version.ts
|
|
29
|
-
var SDK_VERSION = "5.
|
|
29
|
+
var SDK_VERSION = "5.8.0";
|
|
30
30
|
|
|
31
31
|
// src/http.ts
|
|
32
32
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -1834,6 +1834,8 @@ function createMiddleware(options) {
|
|
|
1834
1834
|
}
|
|
1835
1835
|
}
|
|
1836
1836
|
}
|
|
1837
|
+
const attemptHeader = req.headers["x-astra-attempt-id"];
|
|
1838
|
+
const inboundAttemptId = typeof attemptHeader === "string" && /^att_[0-9a-f]{32}$/.test(attemptHeader) ? attemptHeader : void 0;
|
|
1837
1839
|
const verificationRequest = {
|
|
1838
1840
|
credentials,
|
|
1839
1841
|
purpose,
|
|
@@ -1846,6 +1848,7 @@ function createMiddleware(options) {
|
|
|
1846
1848
|
durationRequired: astraCreds?.pdlss?.duration?.maxSessionDuration,
|
|
1847
1849
|
...txValue !== void 0 && { transactionValue: txValue },
|
|
1848
1850
|
...txCurrency && { currency: txCurrency },
|
|
1851
|
+
...inboundAttemptId && { attemptId: inboundAttemptId },
|
|
1849
1852
|
callerMetadata: {
|
|
1850
1853
|
sourceIp: originalClientIp,
|
|
1851
1854
|
userAgent: req.headers["user-agent"],
|