secretless-ai 0.17.1 → 0.18.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 +2 -0
- package/dist/broker/atx.d.ts +168 -0
- package/dist/broker/atx.d.ts.map +1 -0
- package/dist/broker/atx.js +308 -0
- package/dist/broker/atx.js.map +1 -0
- package/dist/broker/cpi/assertion.d.ts +45 -0
- package/dist/broker/cpi/assertion.d.ts.map +1 -0
- package/dist/broker/cpi/assertion.js +96 -0
- package/dist/broker/cpi/assertion.js.map +1 -0
- package/dist/broker/cpi/assume.d.ts +19 -0
- package/dist/broker/cpi/assume.d.ts.map +1 -0
- package/dist/broker/cpi/assume.js +27 -0
- package/dist/broker/cpi/assume.js.map +1 -0
- package/dist/broker/cpi/exchange.d.ts +53 -0
- package/dist/broker/cpi/exchange.d.ts.map +1 -0
- package/dist/broker/cpi/exchange.js +56 -0
- package/dist/broker/cpi/exchange.js.map +1 -0
- package/dist/broker/cpi/http-transport.d.ts +12 -0
- package/dist/broker/cpi/http-transport.d.ts.map +1 -0
- package/dist/broker/cpi/http-transport.js +104 -0
- package/dist/broker/cpi/http-transport.js.map +1 -0
- package/dist/broker/cpi/index.d.ts +14 -0
- package/dist/broker/cpi/index.d.ts.map +1 -0
- package/dist/broker/cpi/index.js +29 -0
- package/dist/broker/cpi/index.js.map +1 -0
- package/dist/broker/cpi/okta-adapter.d.ts +27 -0
- package/dist/broker/cpi/okta-adapter.d.ts.map +1 -0
- package/dist/broker/cpi/okta-adapter.js +32 -0
- package/dist/broker/cpi/okta-adapter.js.map +1 -0
- package/dist/broker/cpi/registry.d.ts +12 -0
- package/dist/broker/cpi/registry.d.ts.map +1 -0
- package/dist/broker/cpi/registry.js +22 -0
- package/dist/broker/cpi/registry.js.map +1 -0
- package/dist/broker/cpi/retrieve.d.ts +21 -0
- package/dist/broker/cpi/retrieve.d.ts.map +1 -0
- package/dist/broker/cpi/retrieve.js +29 -0
- package/dist/broker/cpi/retrieve.js.map +1 -0
- package/dist/broker/cpi/types.d.ts +64 -0
- package/dist/broker/cpi/types.d.ts.map +1 -0
- package/dist/broker/cpi/types.js +19 -0
- package/dist/broker/cpi/types.js.map +1 -0
- package/dist/broker/grant-policy.d.ts +54 -0
- package/dist/broker/grant-policy.d.ts.map +1 -0
- package/dist/broker/grant-policy.js +71 -0
- package/dist/broker/grant-policy.js.map +1 -0
- package/dist/broker/grant-resolver.d.ts +53 -0
- package/dist/broker/grant-resolver.d.ts.map +1 -0
- package/dist/broker/grant-resolver.js +95 -0
- package/dist/broker/grant-resolver.js.map +1 -0
- package/dist/broker/index.d.ts +5 -0
- package/dist/broker/index.d.ts.map +1 -1
- package/dist/broker/index.js +29 -1
- package/dist/broker/index.js.map +1 -1
- package/dist/broker/server.d.ts +13 -1
- package/dist/broker/server.d.ts.map +1 -1
- package/dist/broker/server.js +83 -4
- package/dist/broker/server.js.map +1 -1
- package/dist/broker/types.d.ts +6 -0
- package/dist/broker/types.d.ts.map +1 -1
- package/dist/broker/worker.d.ts +56 -0
- package/dist/broker/worker.d.ts.map +1 -0
- package/dist/broker/worker.js +149 -0
- package/dist/broker/worker.js.map +1 -0
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/core.d.ts +2 -0
- package/dist/commands/core.d.ts.map +1 -1
- package/dist/commands/core.js +60 -8
- package/dist/commands/core.js.map +1 -1
- package/dist/commands/diff.d.ts +2 -0
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +33 -1
- package/dist/commands/diff.js.map +1 -1
- package/dist/confidence.d.ts +21 -0
- package/dist/confidence.d.ts.map +1 -1
- package/dist/confidence.js +98 -2
- package/dist/confidence.js.map +1 -1
- package/dist/grant/index.d.ts +37 -0
- package/dist/grant/index.d.ts.map +1 -0
- package/dist/grant/index.js +66 -0
- package/dist/grant/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +30 -2
- package/dist/index.js.map +1 -1
- package/dist/init.js +53 -27
- package/dist/init.js.map +1 -1
- package/dist/scan.d.ts +19 -2
- package/dist/scan.d.ts.map +1 -1
- package/dist/scan.js +116 -6
- package/dist/scan.js.map +1 -1
- package/dist/verify.d.ts +7 -0
- package/dist/verify.d.ts.map +1 -1
- package/dist/verify.js +18 -3
- package/dist/verify.js.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# secretless-ai
|
|
2
2
|
|
|
3
|
+
[](./STATUS.md)
|
|
4
|
+
|
|
3
5
|
> **[OpenA2A](https://github.com/opena2a-org/opena2a)**: [CLI](https://github.com/opena2a-org/opena2a) · [HackMyAgent](https://github.com/opena2a-org/hackmyagent) · [Secretless](https://github.com/opena2a-org/secretless-ai) · [AIM](https://github.com/opena2a-org/agent-identity-management) · [Browser Guard](https://github.com/opena2a-org/AI-BrowserGuard) · [DVAA](https://github.com/opena2a-org/damn-vulnerable-ai-agent)
|
|
4
6
|
|
|
5
7
|
Keep API keys and other secrets invisible to AI coding tools. Works with Claude Code, Cursor, GitHub Copilot, Windsurf, Cline, and Aider. Apache 2.0.
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ATX (Agent Trust eXtension) verification — the subject-claim check the broker
|
|
3
|
+
* runs before resolving any grant. AAP §6 step 2.
|
|
4
|
+
*
|
|
5
|
+
* The ATX is the signed, portable credential defined by ATP/ATX that states what an
|
|
6
|
+
* agent *is*. AAP does not redefine it; this verifier mirrors the OpenA2A reference
|
|
7
|
+
* verifier (`atx-conformance/verifiers/python/verify.py`, itself a port of
|
|
8
|
+
* `opena2a-registry/pkg/atcverify/verify.go canonicalPayload()`) VERBATIM so a broker
|
|
9
|
+
* accepts exactly the credentials the conformance suite accepts.
|
|
10
|
+
*
|
|
11
|
+
* (ATX is the current name for the credential formerly called ATC; fixtures use the
|
|
12
|
+
* `atcVersion` field. This verifier dual-supports both signing forms.)
|
|
13
|
+
*
|
|
14
|
+
* Scope: Ed25519 is verified fully. ML-DSA-65 presence is recorded but verification is
|
|
15
|
+
* delegated — Node's stdlib has no ML-DSA, exactly as the Python reference verifier
|
|
16
|
+
* skips it. Production wires the post-quantum half + the live trusted-issuer/CRL anchors
|
|
17
|
+
* to AIM's verification path (see AtxVerifier / RegistryAtxVerifier seam below).
|
|
18
|
+
*
|
|
19
|
+
* SECURITY — signature coverage depends on atcVersion:
|
|
20
|
+
* - v1.0 (canonicalPayload): the pipe-delimited string covers identity, issuer,
|
|
21
|
+
* trustLevel, trustScore, contentHash, buildAttestation, and the validity window.
|
|
22
|
+
* It does NOT cover `capabilities`, `scanSummary.oasbLevel`, `issuerChain`, or
|
|
23
|
+
* `jurisdiction`. A holder of any validly-signed v1.0 ATX can edit those without
|
|
24
|
+
* invalidating the signature, so they MUST NOT be trusted for authorization.
|
|
25
|
+
* - v1.1 (canonicalPayloadV11): the signature covers JCS(TBS), which includes
|
|
26
|
+
* `capabilities`, `scanSummary`, `issuerChain`, and `publisher`. Those fields are
|
|
27
|
+
* integrity-protected and safe to authorize on.
|
|
28
|
+
*
|
|
29
|
+
* The verified context exposes `signedCapabilities` (true iff v1.1) so callers can tell
|
|
30
|
+
* the two apart. Phase 3 of the ATX v1.1 rollout adds a `requireSignedCapabilities`
|
|
31
|
+
* grant-policy flag that refuses capability-gated grants whose context has
|
|
32
|
+
* `signedCapabilities === false`. Until then a production verifier still SHOULD source
|
|
33
|
+
* authorization attributes for v1.0 credentials from the issuing Registry/AIM for the
|
|
34
|
+
* verified `agentId` rather than the presented blob.
|
|
35
|
+
*/
|
|
36
|
+
/** Legacy schema version: signs the 11-field pipe string (Go quirk, replicated). */
|
|
37
|
+
export declare const SUPPORTED_ATX_VERSION = "1.0";
|
|
38
|
+
/**
|
|
39
|
+
* ATX v1.1: signs JCS(TBS) (RFC 8785) per atx-spec core.md §1.3a.2, bringing
|
|
40
|
+
* capabilities, scanSummary, issuerChain, publisher, and behavioralProfile under
|
|
41
|
+
* the signature. Verified here using the same canonicalizer (erdtman/canonicalize)
|
|
42
|
+
* and the same TBS projection the registry and conformance verifiers use; byte
|
|
43
|
+
* agreement is proven by atx-conformance/jcs-vectors.
|
|
44
|
+
*/
|
|
45
|
+
export declare const SUPPORTED_ATX_VERSION_V11 = "1.1";
|
|
46
|
+
/** A signature reference on an ATX. */
|
|
47
|
+
export interface AtxSignature {
|
|
48
|
+
keyId?: string;
|
|
49
|
+
algorithm: 'Ed25519' | 'ML-DSA-65' | string;
|
|
50
|
+
/** base64-encoded signature value. */
|
|
51
|
+
value: string;
|
|
52
|
+
}
|
|
53
|
+
/** The ATX credential (subset used for verification + context derivation). */
|
|
54
|
+
export interface Atx {
|
|
55
|
+
atcVersion?: string;
|
|
56
|
+
agentId: string;
|
|
57
|
+
agentDid: string;
|
|
58
|
+
/** Publisher identity. Unsigned under v1.0; covered by the v1.1 signature. */
|
|
59
|
+
publisher?: string;
|
|
60
|
+
publisherDid?: string;
|
|
61
|
+
version: string;
|
|
62
|
+
contentHash: string;
|
|
63
|
+
buildAttestation?: string;
|
|
64
|
+
issuerDid: string;
|
|
65
|
+
issuerChain?: string[];
|
|
66
|
+
trustLevel: number;
|
|
67
|
+
trustScore: number;
|
|
68
|
+
issuedAt: string;
|
|
69
|
+
expiresAt: string;
|
|
70
|
+
capabilities?: string[];
|
|
71
|
+
/** Observed-behavior summary. Covered by the v1.1 signature. */
|
|
72
|
+
behavioralProfile?: {
|
|
73
|
+
checksum?: string;
|
|
74
|
+
generatedAt?: string;
|
|
75
|
+
observationDays?: number;
|
|
76
|
+
} | null;
|
|
77
|
+
scanSummary?: {
|
|
78
|
+
oasbLevel?: string;
|
|
79
|
+
[k: string]: unknown;
|
|
80
|
+
};
|
|
81
|
+
/** Optional, optional-to-ignore jurisdiction claim (AAP §9). */
|
|
82
|
+
jurisdiction?: string[];
|
|
83
|
+
revoked?: boolean;
|
|
84
|
+
signatures: AtxSignature[];
|
|
85
|
+
}
|
|
86
|
+
/** A public key the verifier trusts, keyed by algorithm. */
|
|
87
|
+
export interface AtxPublicKey {
|
|
88
|
+
algorithm: 'Ed25519' | 'ML-DSA-65' | string;
|
|
89
|
+
/** hex-encoded raw public key (32 bytes for Ed25519). */
|
|
90
|
+
publicKeyHex: string;
|
|
91
|
+
}
|
|
92
|
+
/** Trust anchors the verifier evaluates against (in production: fetched from AIM/Registry). */
|
|
93
|
+
export interface AtxTrustAnchors {
|
|
94
|
+
trustedIssuers: string[];
|
|
95
|
+
publicKeys: AtxPublicKey[];
|
|
96
|
+
/** Cached, federated CRL. Revocation rides entirely on the ATX + CRL (AAP §6). */
|
|
97
|
+
crl?: {
|
|
98
|
+
entries: Array<{
|
|
99
|
+
agentId: string;
|
|
100
|
+
reason?: string;
|
|
101
|
+
}>;
|
|
102
|
+
};
|
|
103
|
+
/** Clock source (injectable for tests). Defaults to wall clock. */
|
|
104
|
+
now?: () => Date;
|
|
105
|
+
}
|
|
106
|
+
export type RejectCategory = 'UNSUPPORTED_VERSION' | 'EXPIRED' | 'REVOKED' | 'UNTRUSTED_ISSUER' | 'SIGNATURE_INVALID' | 'MALFORMED';
|
|
107
|
+
/** Context the broker derives from a *verified* ATX. Contains no backend information. */
|
|
108
|
+
export interface ResolutionContext {
|
|
109
|
+
agentId: string;
|
|
110
|
+
agentDid: string;
|
|
111
|
+
issuerDid: string;
|
|
112
|
+
issuerChain: string[];
|
|
113
|
+
trustLevel: number;
|
|
114
|
+
trustScore: number;
|
|
115
|
+
capabilities: string[];
|
|
116
|
+
oasbLevel?: string;
|
|
117
|
+
jurisdiction?: string[];
|
|
118
|
+
/**
|
|
119
|
+
* True when the credential is v1.1+, i.e. capabilities/scanSummary/issuerChain
|
|
120
|
+
* are covered by the signature and may be trusted for authorization. False for
|
|
121
|
+
* v1.0, where those fields are forgeable by the holder. Phase 3 of the ATX v1.1
|
|
122
|
+
* rollout gates capability-based grants on this.
|
|
123
|
+
*/
|
|
124
|
+
signedCapabilities: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface AtxVerificationResult {
|
|
127
|
+
valid: boolean;
|
|
128
|
+
/** Present when valid: the context the broker resolves against. */
|
|
129
|
+
context?: ResolutionContext;
|
|
130
|
+
/** Present when invalid. */
|
|
131
|
+
rejectCategory?: RejectCategory;
|
|
132
|
+
reason?: string;
|
|
133
|
+
/** Whether an ML-DSA-65 signature was present (and therefore delegated, not skipped silently). */
|
|
134
|
+
mldsaPresent?: boolean;
|
|
135
|
+
}
|
|
136
|
+
/** The verification interface. Lets the broker swap a local verifier for an AIM-backed one. */
|
|
137
|
+
export interface AtxVerifier {
|
|
138
|
+
verify(atx: Atx): AtxVerificationResult;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Local ATX verifier. Cryptographically real (Ed25519) and interoperable with the
|
|
142
|
+
* conformance fixtures; trust anchors are injected. The production counterpart
|
|
143
|
+
* (`RegistryAtxVerifier`, a seam for a later pass) fetches `trustedIssuers`,
|
|
144
|
+
* `publicKeys`, and the `crl` from AIM's verification endpoint and adds ML-DSA-65.
|
|
145
|
+
*/
|
|
146
|
+
export declare class LocalAtxVerifier implements AtxVerifier {
|
|
147
|
+
private readonly anchors;
|
|
148
|
+
constructor(anchors: AtxTrustAnchors);
|
|
149
|
+
verify(atx: Atx): AtxVerificationResult;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Mirror of `opena2a-registry/pkg/atcverify/verify.go canonicalPayload()`:
|
|
153
|
+
* fmt.Sprintf("%s|%s|%s|%s|%s|%s|%d|%.6f|%s|%s|%s", ...)
|
|
154
|
+
* with atxVersion hardcoded to "1.0".
|
|
155
|
+
*/
|
|
156
|
+
export declare function canonicalPayload(atx: Atx): Buffer;
|
|
157
|
+
/**
|
|
158
|
+
* Project an ATX into the v1.1 TBS and return JCS(TBS) (RFC 8785). Unlike
|
|
159
|
+
* canonicalPayload, this covers capabilities, scanSummary, issuerChain,
|
|
160
|
+
* publisher, and behavioralProfile. The projection (canonical empties,
|
|
161
|
+
* always-full scanSummary, %.6f string trustScore, root-first issuerChain) and
|
|
162
|
+
* the canonicalizer match opena2a-registry/pkg/atcverify and the conformance
|
|
163
|
+
* verifiers exactly; byte agreement is pinned by atx-conformance/jcs-vectors.
|
|
164
|
+
*/
|
|
165
|
+
export declare function canonicalPayloadV11(atx: Atx): Buffer;
|
|
166
|
+
/** Normalize an RFC 3339 timestamp to UTC "YYYY-MM-DDTHH:MM:SSZ" (Go time.RFC3339 for UTC). */
|
|
167
|
+
export declare function normalizeRfc3339(s: string): string;
|
|
168
|
+
//# sourceMappingURL=atx.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atx.d.ts","sourceRoot":"","sources":["../../src/broker/atx.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAKH,oFAAoF;AACpF,eAAO,MAAM,qBAAqB,QAAQ,CAAC;AAE3C;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,QAAQ,CAAC;AAE/C,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,SAAS,GAAG,WAAW,GAAG,MAAM,CAAC;IAC5C,sCAAsC;IACtC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8EAA8E;AAC9E,MAAM,WAAW,GAAG;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,UAAU,E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
|
+
* runs before resolving any grant. AAP §6 step 2.
|
|
5
|
+
*
|
|
6
|
+
* The ATX is the signed, portable credential defined by ATP/ATX that states what an
|
|
7
|
+
* agent *is*. AAP does not redefine it; this verifier mirrors the OpenA2A reference
|
|
8
|
+
* verifier (`atx-conformance/verifiers/python/verify.py`, itself a port of
|
|
9
|
+
* `opena2a-registry/pkg/atcverify/verify.go canonicalPayload()`) VERBATIM so a broker
|
|
10
|
+
* accepts exactly the credentials the conformance suite accepts.
|
|
11
|
+
*
|
|
12
|
+
* (ATX is the current name for the credential formerly called ATC; fixtures use the
|
|
13
|
+
* `atcVersion` field. This verifier dual-supports both signing forms.)
|
|
14
|
+
*
|
|
15
|
+
* Scope: Ed25519 is verified fully. ML-DSA-65 presence is recorded but verification is
|
|
16
|
+
* delegated — Node's stdlib has no ML-DSA, exactly as the Python reference verifier
|
|
17
|
+
* skips it. Production wires the post-quantum half + the live trusted-issuer/CRL anchors
|
|
18
|
+
* to AIM's verification path (see AtxVerifier / RegistryAtxVerifier seam below).
|
|
19
|
+
*
|
|
20
|
+
* SECURITY — signature coverage depends on atcVersion:
|
|
21
|
+
* - v1.0 (canonicalPayload): the pipe-delimited string covers identity, issuer,
|
|
22
|
+
* trustLevel, trustScore, contentHash, buildAttestation, and the validity window.
|
|
23
|
+
* It does NOT cover `capabilities`, `scanSummary.oasbLevel`, `issuerChain`, or
|
|
24
|
+
* `jurisdiction`. A holder of any validly-signed v1.0 ATX can edit those without
|
|
25
|
+
* invalidating the signature, so they MUST NOT be trusted for authorization.
|
|
26
|
+
* - v1.1 (canonicalPayloadV11): the signature covers JCS(TBS), which includes
|
|
27
|
+
* `capabilities`, `scanSummary`, `issuerChain`, and `publisher`. Those fields are
|
|
28
|
+
* integrity-protected and safe to authorize on.
|
|
29
|
+
*
|
|
30
|
+
* The verified context exposes `signedCapabilities` (true iff v1.1) so callers can tell
|
|
31
|
+
* the two apart. Phase 3 of the ATX v1.1 rollout adds a `requireSignedCapabilities`
|
|
32
|
+
* grant-policy flag that refuses capability-gated grants whose context has
|
|
33
|
+
* `signedCapabilities === false`. Until then a production verifier still SHOULD source
|
|
34
|
+
* authorization attributes for v1.0 credentials from the issuing Registry/AIM for the
|
|
35
|
+
* verified `agentId` rather than the presented blob.
|
|
36
|
+
*/
|
|
37
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
38
|
+
if (k2 === undefined) k2 = k;
|
|
39
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
40
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
41
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
42
|
+
}
|
|
43
|
+
Object.defineProperty(o, k2, desc);
|
|
44
|
+
}) : (function(o, m, k, k2) {
|
|
45
|
+
if (k2 === undefined) k2 = k;
|
|
46
|
+
o[k2] = m[k];
|
|
47
|
+
}));
|
|
48
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
49
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
50
|
+
}) : function(o, v) {
|
|
51
|
+
o["default"] = v;
|
|
52
|
+
});
|
|
53
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
54
|
+
var ownKeys = function(o) {
|
|
55
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
56
|
+
var ar = [];
|
|
57
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
58
|
+
return ar;
|
|
59
|
+
};
|
|
60
|
+
return ownKeys(o);
|
|
61
|
+
};
|
|
62
|
+
return function (mod) {
|
|
63
|
+
if (mod && mod.__esModule) return mod;
|
|
64
|
+
var result = {};
|
|
65
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
66
|
+
__setModuleDefault(result, mod);
|
|
67
|
+
return result;
|
|
68
|
+
};
|
|
69
|
+
})();
|
|
70
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
71
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
72
|
+
};
|
|
73
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
74
|
+
exports.LocalAtxVerifier = exports.SUPPORTED_ATX_VERSION_V11 = exports.SUPPORTED_ATX_VERSION = void 0;
|
|
75
|
+
exports.canonicalPayload = canonicalPayload;
|
|
76
|
+
exports.canonicalPayloadV11 = canonicalPayloadV11;
|
|
77
|
+
exports.normalizeRfc3339 = normalizeRfc3339;
|
|
78
|
+
const crypto = __importStar(require("crypto"));
|
|
79
|
+
const canonicalize_1 = __importDefault(require("canonicalize"));
|
|
80
|
+
/** Legacy schema version: signs the 11-field pipe string (Go quirk, replicated). */
|
|
81
|
+
exports.SUPPORTED_ATX_VERSION = '1.0';
|
|
82
|
+
/**
|
|
83
|
+
* ATX v1.1: signs JCS(TBS) (RFC 8785) per atx-spec core.md §1.3a.2, bringing
|
|
84
|
+
* capabilities, scanSummary, issuerChain, publisher, and behavioralProfile under
|
|
85
|
+
* the signature. Verified here using the same canonicalizer (erdtman/canonicalize)
|
|
86
|
+
* and the same TBS projection the registry and conformance verifiers use; byte
|
|
87
|
+
* agreement is proven by atx-conformance/jcs-vectors.
|
|
88
|
+
*/
|
|
89
|
+
exports.SUPPORTED_ATX_VERSION_V11 = '1.1';
|
|
90
|
+
/**
|
|
91
|
+
* Local ATX verifier. Cryptographically real (Ed25519) and interoperable with the
|
|
92
|
+
* conformance fixtures; trust anchors are injected. The production counterpart
|
|
93
|
+
* (`RegistryAtxVerifier`, a seam for a later pass) fetches `trustedIssuers`,
|
|
94
|
+
* `publicKeys`, and the `crl` from AIM's verification endpoint and adds ML-DSA-65.
|
|
95
|
+
*/
|
|
96
|
+
class LocalAtxVerifier {
|
|
97
|
+
constructor(anchors) {
|
|
98
|
+
this.anchors = anchors;
|
|
99
|
+
}
|
|
100
|
+
verify(atx) {
|
|
101
|
+
const now = (this.anchors.now ?? (() => new Date()))();
|
|
102
|
+
// Step 1: schema version. Dispatch on atcVersion: "1.0" verifies the legacy
|
|
103
|
+
// pipe form, "1.1" verifies JCS(TBS) (atx-spec §1.3a).
|
|
104
|
+
if (atx.atcVersion !== exports.SUPPORTED_ATX_VERSION && atx.atcVersion !== exports.SUPPORTED_ATX_VERSION_V11) {
|
|
105
|
+
return reject('UNSUPPORTED_VERSION', `unsupported atxVersion ${String(atx.atcVersion)}`);
|
|
106
|
+
}
|
|
107
|
+
const isV11 = atx.atcVersion === exports.SUPPORTED_ATX_VERSION_V11;
|
|
108
|
+
// Step 2: expiry.
|
|
109
|
+
const expires = new Date(atx.expiresAt);
|
|
110
|
+
if (Number.isNaN(expires.getTime())) {
|
|
111
|
+
return reject('MALFORMED', 'expiresAt is not a valid timestamp');
|
|
112
|
+
}
|
|
113
|
+
if (now.getTime() > expires.getTime()) {
|
|
114
|
+
return reject('EXPIRED', `expired at ${normalizeRfc3339(atx.expiresAt)}`);
|
|
115
|
+
}
|
|
116
|
+
// Step 3: revocation (ATX field + federated CRL).
|
|
117
|
+
if (atx.revoked) {
|
|
118
|
+
return reject('REVOKED', 'credential revoked field is true');
|
|
119
|
+
}
|
|
120
|
+
for (const entry of this.anchors.crl?.entries ?? []) {
|
|
121
|
+
if (entry.agentId === atx.agentId) {
|
|
122
|
+
return reject('REVOKED', `agent appears on CRL: ${entry.reason ?? ''}`);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Step 4: issuer trust.
|
|
126
|
+
if (!this.anchors.trustedIssuers.includes(atx.issuerDid)) {
|
|
127
|
+
return reject('UNTRUSTED_ISSUER', `issuer DID ${atx.issuerDid} is not trusted`);
|
|
128
|
+
}
|
|
129
|
+
// Step 5: signature verification (Ed25519 fully; ML-DSA-65 presence recorded).
|
|
130
|
+
// A v1.1 TBS that fails to canonicalize is a malformed credential, not a
|
|
131
|
+
// verifier error: reject closed rather than throwing.
|
|
132
|
+
let payload;
|
|
133
|
+
if (isV11) {
|
|
134
|
+
try {
|
|
135
|
+
payload = canonicalPayloadV11(atx);
|
|
136
|
+
}
|
|
137
|
+
catch (err) {
|
|
138
|
+
return reject('MALFORMED', `v1.1 canonicalization failed: ${err.message}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
else {
|
|
142
|
+
payload = canonicalPayload(atx);
|
|
143
|
+
}
|
|
144
|
+
const edKeys = this.anchors.publicKeys
|
|
145
|
+
.filter((k) => k.algorithm === 'Ed25519')
|
|
146
|
+
.map((k) => ed25519FromRawHex(k.publicKeyHex))
|
|
147
|
+
.filter((k) => k !== null);
|
|
148
|
+
let edVerified = false;
|
|
149
|
+
let mldsaPresent = false;
|
|
150
|
+
for (const sig of atx.signatures ?? []) {
|
|
151
|
+
if (sig.algorithm === 'Ed25519') {
|
|
152
|
+
let sigBytes;
|
|
153
|
+
try {
|
|
154
|
+
sigBytes = Buffer.from(sig.value, 'base64');
|
|
155
|
+
}
|
|
156
|
+
catch {
|
|
157
|
+
return reject('SIGNATURE_INVALID', `signature ${sig.keyId ?? ''} has invalid base64`);
|
|
158
|
+
}
|
|
159
|
+
const ok = edKeys.some((key) => {
|
|
160
|
+
try {
|
|
161
|
+
return crypto.verify(null, payload, key, sigBytes);
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
return false;
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
if (!ok) {
|
|
168
|
+
return reject('SIGNATURE_INVALID', `Ed25519 signature ${sig.keyId ?? ''} did not verify`);
|
|
169
|
+
}
|
|
170
|
+
edVerified = true;
|
|
171
|
+
}
|
|
172
|
+
else if (sig.algorithm === 'ML-DSA-65') {
|
|
173
|
+
// Presence recorded; PQC verification delegated (see module docstring). Not silently skipped.
|
|
174
|
+
mldsaPresent = true;
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
if (!edVerified) {
|
|
178
|
+
return reject('SIGNATURE_INVALID', 'no Ed25519 signature verified');
|
|
179
|
+
}
|
|
180
|
+
return {
|
|
181
|
+
valid: true,
|
|
182
|
+
mldsaPresent,
|
|
183
|
+
context: {
|
|
184
|
+
agentId: atx.agentId,
|
|
185
|
+
agentDid: atx.agentDid,
|
|
186
|
+
issuerDid: atx.issuerDid,
|
|
187
|
+
issuerChain: atx.issuerChain ?? [atx.issuerDid],
|
|
188
|
+
trustLevel: atx.trustLevel,
|
|
189
|
+
trustScore: atx.trustScore,
|
|
190
|
+
capabilities: atx.capabilities ?? [],
|
|
191
|
+
oasbLevel: atx.scanSummary?.oasbLevel,
|
|
192
|
+
jurisdiction: atx.jurisdiction,
|
|
193
|
+
signedCapabilities: isV11,
|
|
194
|
+
},
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
exports.LocalAtxVerifier = LocalAtxVerifier;
|
|
199
|
+
function reject(rejectCategory, reason) {
|
|
200
|
+
return { valid: false, rejectCategory, reason };
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Mirror of `opena2a-registry/pkg/atcverify/verify.go canonicalPayload()`:
|
|
204
|
+
* fmt.Sprintf("%s|%s|%s|%s|%s|%s|%d|%.6f|%s|%s|%s", ...)
|
|
205
|
+
* with atxVersion hardcoded to "1.0".
|
|
206
|
+
*/
|
|
207
|
+
function canonicalPayload(atx) {
|
|
208
|
+
const fields = [
|
|
209
|
+
atx.agentId,
|
|
210
|
+
atx.agentDid,
|
|
211
|
+
atx.version,
|
|
212
|
+
atx.contentHash,
|
|
213
|
+
atx.buildAttestation ?? '',
|
|
214
|
+
atx.issuerDid,
|
|
215
|
+
String(Math.trunc(atx.trustLevel)),
|
|
216
|
+
Number(atx.trustScore).toFixed(6),
|
|
217
|
+
normalizeRfc3339(atx.issuedAt),
|
|
218
|
+
normalizeRfc3339(atx.expiresAt),
|
|
219
|
+
exports.SUPPORTED_ATX_VERSION,
|
|
220
|
+
];
|
|
221
|
+
return Buffer.from(fields.join('|'), 'utf-8');
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* Project an ATX into the v1.1 TBS and return JCS(TBS) (RFC 8785). Unlike
|
|
225
|
+
* canonicalPayload, this covers capabilities, scanSummary, issuerChain,
|
|
226
|
+
* publisher, and behavioralProfile. The projection (canonical empties,
|
|
227
|
+
* always-full scanSummary, %.6f string trustScore, root-first issuerChain) and
|
|
228
|
+
* the canonicalizer match opena2a-registry/pkg/atcverify and the conformance
|
|
229
|
+
* verifiers exactly; byte agreement is pinned by atx-conformance/jcs-vectors.
|
|
230
|
+
*/
|
|
231
|
+
function canonicalPayloadV11(atx) {
|
|
232
|
+
const scan = (atx.scanSummary ?? {});
|
|
233
|
+
const tbs = {
|
|
234
|
+
atcVersion: atx.atcVersion,
|
|
235
|
+
agentId: atx.agentId,
|
|
236
|
+
agentDid: atx.agentDid,
|
|
237
|
+
publisher: atx.publisher ?? '',
|
|
238
|
+
publisherDid: atx.publisherDid ?? '',
|
|
239
|
+
version: atx.version,
|
|
240
|
+
contentHash: atx.contentHash,
|
|
241
|
+
buildAttestation: atx.buildAttestation ?? '',
|
|
242
|
+
capabilities: atx.capabilities ?? [],
|
|
243
|
+
behavioralProfile: projectBehavioralProfile(atx.behavioralProfile),
|
|
244
|
+
scanSummary: {
|
|
245
|
+
hma: asString(scan.hma),
|
|
246
|
+
criticalFindings: asInt(scan.criticalFindings),
|
|
247
|
+
highFindings: asInt(scan.highFindings),
|
|
248
|
+
secretless: asString(scan.secretless),
|
|
249
|
+
cryptoServe: asString(scan.cryptoServe),
|
|
250
|
+
oasbLevel: asString(scan.oasbLevel),
|
|
251
|
+
},
|
|
252
|
+
// trustScore is the %.6f string form so trustLevel is the only JSON number.
|
|
253
|
+
trustScore: Number(atx.trustScore).toFixed(6),
|
|
254
|
+
trustLevel: Math.trunc(atx.trustLevel),
|
|
255
|
+
issuedAt: normalizeRfc3339(atx.issuedAt),
|
|
256
|
+
expiresAt: normalizeRfc3339(atx.expiresAt),
|
|
257
|
+
issuerDid: atx.issuerDid,
|
|
258
|
+
issuerChain: atx.issuerChain ?? [],
|
|
259
|
+
};
|
|
260
|
+
const canonical = (0, canonicalize_1.default)(tbs);
|
|
261
|
+
if (typeof canonical !== 'string') {
|
|
262
|
+
throw new Error('canonicalize returned non-string');
|
|
263
|
+
}
|
|
264
|
+
return Buffer.from(canonical, 'utf-8');
|
|
265
|
+
}
|
|
266
|
+
/** behavioralProfile -> null when absent, else the canonical three-field object. */
|
|
267
|
+
function projectBehavioralProfile(bp) {
|
|
268
|
+
if (bp === null || bp === undefined) {
|
|
269
|
+
return null;
|
|
270
|
+
}
|
|
271
|
+
return {
|
|
272
|
+
checksum: asString(bp.checksum),
|
|
273
|
+
generatedAt: bp.generatedAt ? normalizeRfc3339(bp.generatedAt) : '',
|
|
274
|
+
observationDays: asInt(bp.observationDays),
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function asString(v) {
|
|
278
|
+
return typeof v === 'string' ? v : '';
|
|
279
|
+
}
|
|
280
|
+
function asInt(v) {
|
|
281
|
+
return typeof v === 'number' && Number.isFinite(v) ? Math.trunc(v) : 0;
|
|
282
|
+
}
|
|
283
|
+
/** Normalize an RFC 3339 timestamp to UTC "YYYY-MM-DDTHH:MM:SSZ" (Go time.RFC3339 for UTC). */
|
|
284
|
+
function normalizeRfc3339(s) {
|
|
285
|
+
const dt = new Date(s);
|
|
286
|
+
if (Number.isNaN(dt.getTime())) {
|
|
287
|
+
throw new Error(`invalid RFC 3339 timestamp: ${s}`);
|
|
288
|
+
}
|
|
289
|
+
return dt.toISOString().replace(/\.\d{3}Z$/, 'Z');
|
|
290
|
+
}
|
|
291
|
+
const ED25519_SPKI_PREFIX = Buffer.from('302a300506032b6570032100', 'hex');
|
|
292
|
+
/** Build a Node KeyObject from a raw 32-byte Ed25519 public key (hex). */
|
|
293
|
+
function ed25519FromRawHex(hex) {
|
|
294
|
+
const raw = Buffer.from(hex, 'hex');
|
|
295
|
+
if (raw.length !== 32)
|
|
296
|
+
return null;
|
|
297
|
+
try {
|
|
298
|
+
return crypto.createPublicKey({
|
|
299
|
+
key: Buffer.concat([ED25519_SPKI_PREFIX, raw]),
|
|
300
|
+
format: 'der',
|
|
301
|
+
type: 'spki',
|
|
302
|
+
});
|
|
303
|
+
}
|
|
304
|
+
catch {
|
|
305
|
+
return null;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
//# sourceMappingURL=atx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"atx.js","sourceRoot":"","sources":["../../src/broker/atx.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0OH,4CAeC;AAUD,kDAkCC;AAyBD,4CAMC;AAlUD,+CAAiC;AACjC,gEAAwC;AAExC,oFAAoF;AACvE,QAAA,qBAAqB,GAAG,KAAK,CAAC;AAE3C;;;;;;GAMG;AACU,QAAA,yBAAyB,GAAG,KAAK,CAAC;AAkG/C;;;;;GAKG;AACH,MAAa,gBAAgB;IAC3B,YAA6B,OAAwB;QAAxB,YAAO,GAAP,OAAO,CAAiB;IAAG,CAAC;IAEzD,MAAM,CAAC,GAAQ;QACb,MAAM,GAAG,GAAG,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;QAEvD,4EAA4E;QAC5E,uDAAuD;QACvD,IAAI,GAAG,CAAC,UAAU,KAAK,6BAAqB,IAAI,GAAG,CAAC,UAAU,KAAK,iCAAyB,EAAE,CAAC;YAC7F,OAAO,MAAM,CAAC,qBAAqB,EAAE,0BAA0B,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;QAC3F,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,UAAU,KAAK,iCAAyB,CAAC;QAE3D,kBAAkB;QAClB,MAAM,OAAO,GAA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@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Broker assertion minting — the broker as its own identity provider (AAP Broker Profile §11).
|
|
3
|
+
*
|
|
4
|
+
* In AAP token-model terms (AAP-SPEC.md), the assertion minted here IS a Capability Grant Token
|
|
5
|
+
* (CGT) / Delegation Assertion (DA): a short-lived, scoped authorization derived from the verified
|
|
6
|
+
* ATX (which the Agent Identity Token references) and used as the RFC 8693 subject token.
|
|
7
|
+
*
|
|
8
|
+
* For Assume and Exchange, the broker mints a short-lived assertion whose claims derive
|
|
9
|
+
* from the *verified* ATX, signed with the broker's own signing key. The downstream
|
|
10
|
+
* (STS for Assume, authorization server for Exchange) is configured once to trust the
|
|
11
|
+
* broker's IdP via its published public key — the broker holds no standing secret to any
|
|
12
|
+
* backend, only this one rotating key.
|
|
13
|
+
*
|
|
14
|
+
* The assertion is a compact EdDSA JWT. The SAME assertion a broker mints for its own
|
|
15
|
+
* agents is what a peer broker will verify for a foreign agent in v2 federation — which
|
|
16
|
+
* is why the claims carry the ATX issuer chain and trust level, not just a subject.
|
|
17
|
+
*/
|
|
18
|
+
import * as crypto from 'crypto';
|
|
19
|
+
import type { ResolutionContext } from '../atx';
|
|
20
|
+
import type { ResourceBinding } from './types';
|
|
21
|
+
/**
|
|
22
|
+
* The broker's IdP signing key. In production this is the existing short-lived delegated
|
|
23
|
+
* signing key (30-day default) and it ROTATES; only the public half is published on the
|
|
24
|
+
* operator's own domain. Here it is an Ed25519 key pair the broker holds in memory.
|
|
25
|
+
*/
|
|
26
|
+
export interface BrokerSigningKey {
|
|
27
|
+
/** Key id published in the broker's discovery document; lands in the JWT header `kid`. */
|
|
28
|
+
kid: string;
|
|
29
|
+
/** Ed25519 private key (Node KeyObject). */
|
|
30
|
+
privateKey: crypto.KeyObject;
|
|
31
|
+
/** Issuer identifier for the broker IdP (e.g. the operator's broker URL). */
|
|
32
|
+
issuer: string;
|
|
33
|
+
}
|
|
34
|
+
/** Generate a fresh Ed25519 broker signing key (rotation produces a new one). */
|
|
35
|
+
export declare function generateBrokerSigningKey(issuer: string, kid: string): BrokerSigningKey;
|
|
36
|
+
/**
|
|
37
|
+
* Mint a broker assertion (compact EdDSA JWT) from a verified-ATX context and a binding.
|
|
38
|
+
*
|
|
39
|
+
* Claims are derived ONLY from the verified ATX and the local binding — never from
|
|
40
|
+
* agent-supplied input. `nowSeconds` is injectable for deterministic tests.
|
|
41
|
+
*/
|
|
42
|
+
export declare function mintBrokerAssertion(ctx: ResolutionContext, binding: ResourceBinding, key: BrokerSigningKey, nowSeconds?: number): string;
|
|
43
|
+
/** Export the public half as a JWK for the broker's discovery document (operator's domain). */
|
|
44
|
+
export declare function brokerPublicJwk(key: BrokerSigningKey): Record<string, unknown>;
|
|
45
|
+
//# sourceMappingURL=assertion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion.d.ts","sourceRoot":"","sources":["../../../src/broker/cpi/assertion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AACjC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,0FAA0F;IAC1F,GAAG,EAAE,MAAM,CAAC;IACZ,4CAA4C;IAC5C,UAAU,EAAE,MAAM,CAAC,SAAS,CAAC;IAC7B,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,iFAAiF;AACjF,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAGtF;AAMD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,iBAAiB,EACtB,OAAO,EAAE,eAAe,EACxB,GAAG,EAAE,gBAAgB,EACrB,UAAU,GAAE,MAAsC,GACjD,MAAM,CAkBR;AAED,+FAA+F;AAC/F,wBAAgB,eAAe,CAAC,GAAG,EAAE,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAI9E"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Broker assertion minting — the broker as its own identity provider (AAP Broker Profile §11).
|
|
4
|
+
*
|
|
5
|
+
* In AAP token-model terms (AAP-SPEC.md), the assertion minted here IS a Capability Grant Token
|
|
6
|
+
* (CGT) / Delegation Assertion (DA): a short-lived, scoped authorization derived from the verified
|
|
7
|
+
* ATX (which the Agent Identity Token references) and used as the RFC 8693 subject token.
|
|
8
|
+
*
|
|
9
|
+
* For Assume and Exchange, the broker mints a short-lived assertion whose claims derive
|
|
10
|
+
* from the *verified* ATX, signed with the broker's own signing key. The downstream
|
|
11
|
+
* (STS for Assume, authorization server for Exchange) is configured once to trust the
|
|
12
|
+
* broker's IdP via its published public key — the broker holds no standing secret to any
|
|
13
|
+
* backend, only this one rotating key.
|
|
14
|
+
*
|
|
15
|
+
* The assertion is a compact EdDSA JWT. The SAME assertion a broker mints for its own
|
|
16
|
+
* agents is what a peer broker will verify for a foreign agent in v2 federation — which
|
|
17
|
+
* is why the claims carry the ATX issuer chain and trust level, not just a subject.
|
|
18
|
+
*/
|
|
19
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
20
|
+
if (k2 === undefined) k2 = k;
|
|
21
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
22
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
23
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
24
|
+
}
|
|
25
|
+
Object.defineProperty(o, k2, desc);
|
|
26
|
+
}) : (function(o, m, k, k2) {
|
|
27
|
+
if (k2 === undefined) k2 = k;
|
|
28
|
+
o[k2] = m[k];
|
|
29
|
+
}));
|
|
30
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
31
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
32
|
+
}) : function(o, v) {
|
|
33
|
+
o["default"] = v;
|
|
34
|
+
});
|
|
35
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
36
|
+
var ownKeys = function(o) {
|
|
37
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
38
|
+
var ar = [];
|
|
39
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
40
|
+
return ar;
|
|
41
|
+
};
|
|
42
|
+
return ownKeys(o);
|
|
43
|
+
};
|
|
44
|
+
return function (mod) {
|
|
45
|
+
if (mod && mod.__esModule) return mod;
|
|
46
|
+
var result = {};
|
|
47
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
48
|
+
__setModuleDefault(result, mod);
|
|
49
|
+
return result;
|
|
50
|
+
};
|
|
51
|
+
})();
|
|
52
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
+
exports.generateBrokerSigningKey = generateBrokerSigningKey;
|
|
54
|
+
exports.mintBrokerAssertion = mintBrokerAssertion;
|
|
55
|
+
exports.brokerPublicJwk = brokerPublicJwk;
|
|
56
|
+
const crypto = __importStar(require("crypto"));
|
|
57
|
+
/** Generate a fresh Ed25519 broker signing key (rotation produces a new one). */
|
|
58
|
+
function generateBrokerSigningKey(issuer, kid) {
|
|
59
|
+
const { privateKey } = crypto.generateKeyPairSync('ed25519');
|
|
60
|
+
return { kid, privateKey, issuer };
|
|
61
|
+
}
|
|
62
|
+
function base64url(input) {
|
|
63
|
+
return Buffer.from(input).toString('base64url');
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Mint a broker assertion (compact EdDSA JWT) from a verified-ATX context and a binding.
|
|
67
|
+
*
|
|
68
|
+
* Claims are derived ONLY from the verified ATX and the local binding — never from
|
|
69
|
+
* agent-supplied input. `nowSeconds` is injectable for deterministic tests.
|
|
70
|
+
*/
|
|
71
|
+
function mintBrokerAssertion(ctx, binding, key, nowSeconds = Math.floor(Date.now() / 1000)) {
|
|
72
|
+
const header = { alg: 'EdDSA', typ: 'JWT', kid: key.kid };
|
|
73
|
+
const claims = {
|
|
74
|
+
iss: key.issuer,
|
|
75
|
+
sub: ctx.agentDid,
|
|
76
|
+
aud: binding.audience,
|
|
77
|
+
scope: binding.scope,
|
|
78
|
+
// Federation attributes carried for v2 cross-broker verification (AAP §7, §11).
|
|
79
|
+
trust_class: binding.scope,
|
|
80
|
+
issuer_chain: ctx.issuerChain,
|
|
81
|
+
trust_level: ctx.trustLevel,
|
|
82
|
+
iat: nowSeconds,
|
|
83
|
+
exp: nowSeconds + binding.ttlSeconds,
|
|
84
|
+
jti: crypto.randomBytes(16).toString('hex'),
|
|
85
|
+
};
|
|
86
|
+
const signingInput = `${base64url(JSON.stringify(header))}.${base64url(JSON.stringify(claims))}`;
|
|
87
|
+
const signature = crypto.sign(null, Buffer.from(signingInput), key.privateKey);
|
|
88
|
+
return `${signingInput}.${base64url(signature)}`;
|
|
89
|
+
}
|
|
90
|
+
/** Export the public half as a JWK for the broker's discovery document (operator's domain). */
|
|
91
|
+
function brokerPublicJwk(key) {
|
|
92
|
+
const pub = crypto.createPublicKey(key.privateKey);
|
|
93
|
+
const jwk = pub.export({ format: 'jwk' });
|
|
94
|
+
return { ...jwk, kid: key.kid, use: 'sig', alg: 'EdDSA' };
|
|
95
|
+
}
|
|
96
|
+
//# sourceMappingURL=assertion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assertion.js","sourceRoot":"","sources":["../../../src/broker/cpi/assertion.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBH,4DAGC;AAYD,kDAuBC;A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