@atrib/verify 0.7.10 → 0.8.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.
- package/LICENSE +1 -1
- package/README.md +72 -5
- package/dist/anchor-plurality.d.ts +142 -0
- package/dist/anchor-plurality.d.ts.map +1 -0
- package/dist/anchor-plurality.js +473 -0
- package/dist/anchor-plurality.js.map +1 -0
- package/dist/authorization-evidence.d.ts +6 -2
- package/dist/authorization-evidence.d.ts.map +1 -1
- package/dist/authorization-evidence.js +21 -0
- package/dist/authorization-evidence.js.map +1 -1
- package/dist/delegation.d.ts +186 -0
- package/dist/delegation.d.ts.map +1 -0
- package/dist/delegation.js +319 -0
- package/dist/delegation.js.map +1 -0
- package/dist/evidence-envelope.d.ts +205 -0
- package/dist/evidence-envelope.d.ts.map +1 -0
- package/dist/evidence-envelope.js +378 -0
- package/dist/evidence-envelope.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/session-checkpoint.d.ts +200 -0
- package/dist/session-checkpoint.d.ts.map +1 -0
- package/dist/session-checkpoint.js +421 -0
- package/dist/session-checkpoint.js.map +1 -0
- package/dist/verify-record.d.ts +43 -0
- package/dist/verify-record.d.ts.map +1 -1
- package/dist/verify-record.js +25 -1
- package/dist/verify-record.js.map +1 -1
- package/dist/x401-evidence.d.ts +94 -0
- package/dist/x401-evidence.d.ts.map +1 -0
- package/dist/x401-evidence.js +560 -0
- package/dist/x401-evidence.js.map +1 -0
- package/package.json +6 -3
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import type { EvidenceConstraintCheck, EvidenceVerificationBlock } from './authorization-evidence.js';
|
|
2
|
+
/** Tier ladder, ordered by independent reproducibility. Closed at four. */
|
|
3
|
+
export declare const EVIDENCE_TIERS: readonly ["declared", "shape", "attested", "verified"];
|
|
4
|
+
export type EvidenceTier = (typeof EVIDENCE_TIERS)[number];
|
|
5
|
+
/** Where the payload bytes are retrievable. Closed at five. */
|
|
6
|
+
export declare const EVIDENCE_REF_KINDS: readonly ["inline", "mirror", "archive", "external", "withheld"];
|
|
7
|
+
export type EvidenceRefKind = (typeof EVIDENCE_REF_KINDS)[number];
|
|
8
|
+
/** Constraint status, reused unchanged from the §5.5.6 block shape. */
|
|
9
|
+
export declare const EVIDENCE_CONSTRAINT_STATUSES: readonly ["passed", "failed", "unresolved", "not_checked"];
|
|
10
|
+
export type EvidenceConstraintStatus = (typeof EVIDENCE_CONSTRAINT_STATUSES)[number];
|
|
11
|
+
/** `payload.hash` / `ref.record_hash` format: `sha256:` + 64 lowercase hex. */
|
|
12
|
+
export declare const SHA256_REF_PATTERN: RegExp;
|
|
13
|
+
/** atrib-maintained profiles live under this base URI. */
|
|
14
|
+
export declare const ATRIB_PROFILE_BASE = "https://atrib.dev/v1/evidence/";
|
|
15
|
+
/**
|
|
16
|
+
* The atrib-maintained registry: the eight-name initial set plus
|
|
17
|
+
* post-initial registrations (continuation-packet, per D142). Profile
|
|
18
|
+
* identity is the FULL URI; a bare name here is only the trailing path
|
|
19
|
+
* component under {@link ATRIB_PROFILE_BASE}. Third parties register their
|
|
20
|
+
* own absolute HTTPS URIs on domains they control and never appear in
|
|
21
|
+
* this list.
|
|
22
|
+
*/
|
|
23
|
+
export declare const ATRIB_PROFILE_REGISTRY: readonly ["oauth2", "mcp-oauth", "aauth", "x401", "ap2-vi", "human-approval", "counterparty-attestation", "delegation-certificate", "continuation-packet"];
|
|
24
|
+
export type AtribProfileName = (typeof ATRIB_PROFILE_REGISTRY)[number];
|
|
25
|
+
/** Full type URI for an atrib-maintained profile name. */
|
|
26
|
+
export declare function atribProfileUri(name: AtribProfileName): string;
|
|
27
|
+
/** Convenience map from atrib profile name to its full type URI. */
|
|
28
|
+
export declare const ATRIB_PROFILE_URIS: Readonly<Record<AtribProfileName, string>>;
|
|
29
|
+
/**
|
|
30
|
+
* The pre-envelope §5.5.6 `protocol` string set, frozen at exactly five
|
|
31
|
+
* values. No new legacy protocol string may be introduced anywhere in the
|
|
32
|
+
* substrate; every new evidence type registers as an envelope profile.
|
|
33
|
+
*/
|
|
34
|
+
export declare const FROZEN_LEGACY_PROTOCOLS: readonly ["oauth2", "mcp_oauth", "aauth", "x401", "ap2_vi"];
|
|
35
|
+
export type FrozenLegacyProtocol = (typeof FROZEN_LEGACY_PROTOCOLS)[number];
|
|
36
|
+
/** The fixed five-row legacy-protocol → profile-URI table. Complete and final. */
|
|
37
|
+
export declare const LEGACY_PROTOCOL_TO_PROFILE: Readonly<Record<FrozenLegacyProtocol, string>>;
|
|
38
|
+
/** Retrievability reference. `record_hash` is a sibling of `kind`, never a kind value. */
|
|
39
|
+
export interface EvidenceEnvelopeRef {
|
|
40
|
+
kind: EvidenceRefKind;
|
|
41
|
+
uri?: string | null;
|
|
42
|
+
/**
|
|
43
|
+
* When set, declares the payload is itself a signed atrib record;
|
|
44
|
+
* `payload.hash` commits to that record's canonical JCS bytes. MAY
|
|
45
|
+
* accompany any `kind` except `inline`.
|
|
46
|
+
*/
|
|
47
|
+
record_hash?: string | null;
|
|
48
|
+
}
|
|
49
|
+
export interface EvidenceEnvelopePayload {
|
|
50
|
+
hash: string;
|
|
51
|
+
media_type?: string;
|
|
52
|
+
ref: EvidenceEnvelopeRef;
|
|
53
|
+
/** Raw payload, local-only, never public. Permitted ONLY under ref.kind 'inline'. */
|
|
54
|
+
inline?: unknown;
|
|
55
|
+
}
|
|
56
|
+
export interface EvidenceEnvelopeResult {
|
|
57
|
+
valid: boolean;
|
|
58
|
+
constraints: EvidenceConstraintCheck[];
|
|
59
|
+
errors: string[];
|
|
60
|
+
warnings: string[];
|
|
61
|
+
}
|
|
62
|
+
export interface EvidenceEnvelopeVerifier {
|
|
63
|
+
name: string;
|
|
64
|
+
version?: string;
|
|
65
|
+
checked_at_ms?: number;
|
|
66
|
+
}
|
|
67
|
+
/** The one schema, versioned by the integer `envelope` field. */
|
|
68
|
+
export interface EvidenceEnvelope {
|
|
69
|
+
envelope: 1;
|
|
70
|
+
profile: string;
|
|
71
|
+
profile_version: string;
|
|
72
|
+
tier: EvidenceTier;
|
|
73
|
+
payload: EvidenceEnvelopePayload;
|
|
74
|
+
facts?: Record<string, unknown>;
|
|
75
|
+
result: EvidenceEnvelopeResult;
|
|
76
|
+
verifier?: EvidenceEnvelopeVerifier;
|
|
77
|
+
}
|
|
78
|
+
export interface EnvelopeValidation {
|
|
79
|
+
valid: boolean;
|
|
80
|
+
/** Machine-readable reject reason codes; empty iff accepted. */
|
|
81
|
+
reasons: string[];
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Validate an envelope against the normative §5.5.7 shape rules. Returns a
|
|
85
|
+
* closed set of reason codes; an empty `reasons` array (and `valid: true`)
|
|
86
|
+
* means the envelope is well-formed. Rejecting an envelope never rejects the
|
|
87
|
+
* record it attaches to. This function does not throw.
|
|
88
|
+
*
|
|
89
|
+
* Reason codes: `envelope_version`, `profile_uri`, `profile_version`, `tier`,
|
|
90
|
+
* `payload`, `payload_hash`, `ref`, `ref_kind`, `inline_without_inline_kind`,
|
|
91
|
+
* `record_hash_format`, `record_hash_with_inline_kind`, `result`,
|
|
92
|
+
* `result_valid`, `result_constraints`, `constraint_status`, `result_errors`,
|
|
93
|
+
* `result_warnings`, `verifier`.
|
|
94
|
+
*/
|
|
95
|
+
export declare function validateEnvelope(envelope: unknown): EnvelopeValidation;
|
|
96
|
+
/** True iff the envelope is well-formed per {@link validateEnvelope}. */
|
|
97
|
+
export declare function isValidEnvelope(envelope: unknown): envelope is EvidenceEnvelope;
|
|
98
|
+
export interface ProfileClassification {
|
|
99
|
+
uri_valid: boolean;
|
|
100
|
+
atrib_maintained: boolean;
|
|
101
|
+
registered: boolean;
|
|
102
|
+
treat_as: 'registered' | 'unknown-preserve';
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Classify a profile URI against the atrib registry. Identity is the full
|
|
106
|
+
* URI: a foreign domain reusing an atrib profile name (e.g.
|
|
107
|
+
* `https://example.com/v1/evidence/oauth2`) is a valid third-party profile
|
|
108
|
+
* and MUST NOT be treated as the atrib profile of the same name.
|
|
109
|
+
*
|
|
110
|
+
* @param registry trailing-name registry to check against; defaults to the
|
|
111
|
+
* atrib-maintained set. Only consulted for URIs under
|
|
112
|
+
* {@link ATRIB_PROFILE_BASE}.
|
|
113
|
+
*/
|
|
114
|
+
export declare function classifyProfile(uri: string, registry?: readonly string[]): ProfileClassification;
|
|
115
|
+
export interface OpaqueEnvelopeRender {
|
|
116
|
+
profile: string;
|
|
117
|
+
tier: string;
|
|
118
|
+
payload_hash: string;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* The opaque rendering surface for any envelope (known or unknown profile):
|
|
122
|
+
* profile URI, tier, and payload hash. Consumers MUST render unknown-profile
|
|
123
|
+
* envelopes this way; they MUST NOT drop them and MUST NOT let them affect
|
|
124
|
+
* record validity. Preservation itself is the identity function — this
|
|
125
|
+
* helper only extracts the safe-to-surface fields.
|
|
126
|
+
*/
|
|
127
|
+
export declare function renderEnvelopeOpaque(envelope: EvidenceEnvelope): OpaqueEnvelopeRender;
|
|
128
|
+
/** `sha256:` + hex(SHA-256(JCS(value))). The JSON-media-type hash rule. */
|
|
129
|
+
export declare function jcsSha256(value: unknown): string;
|
|
130
|
+
/** `sha256:` + hex(SHA-256(UTF-8(text))). The raw-bytes hash rule. */
|
|
131
|
+
export declare function rawSha256(text: string): string;
|
|
132
|
+
/**
|
|
133
|
+
* The legacy §5.5.6 evidence block shape as consumed by the mapping. This is
|
|
134
|
+
* structurally the {@link EvidenceVerificationBlock} plus its required
|
|
135
|
+
* fields; the mapping reads only the fields listed here.
|
|
136
|
+
*/
|
|
137
|
+
export interface LegacyEvidenceBlock {
|
|
138
|
+
protocol: string;
|
|
139
|
+
valid: boolean;
|
|
140
|
+
issuer: string | null;
|
|
141
|
+
subject: string | null;
|
|
142
|
+
scope: string[];
|
|
143
|
+
attenuation_ok: boolean | null;
|
|
144
|
+
delegation_ok: boolean | null;
|
|
145
|
+
constraints: EvidenceConstraintCheck[];
|
|
146
|
+
errors: string[];
|
|
147
|
+
warnings: string[];
|
|
148
|
+
details?: unknown;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Deterministically map a legacy §5.5.6 evidence block into envelope form.
|
|
152
|
+
* Two implementations given the same block MUST produce identical envelopes.
|
|
153
|
+
*
|
|
154
|
+
* - `protocol` maps through the fixed five-row table; any other string throws
|
|
155
|
+
* (`unknown legacy evidence protocol '<protocol>'`). The mapping never
|
|
156
|
+
* invents a profile URI. Producer-side callers wrap this per §5.8.
|
|
157
|
+
* - The mapped envelope carries `envelope: 1`, `profile_version: "1.0.0"`,
|
|
158
|
+
* and `tier: "attested"` (a legacy block records what a caller-owned path
|
|
159
|
+
* accepted; it carries no trust roots, so it never claims `"verified"`).
|
|
160
|
+
* - `payload.hash` commits to the legacy block itself (JCS), with
|
|
161
|
+
* `media_type: "application/json"` and `ref.kind: "withheld"`.
|
|
162
|
+
* - `issuer` / `subject` / `scope` / `attenuation_ok` / `delegation_ok` copy
|
|
163
|
+
* into `facts` unchanged (nulls preserved); `details`, when present, is
|
|
164
|
+
* committed as `facts.details_hash` (never inlined).
|
|
165
|
+
* - `valid` / `constraints` / `errors` / `warnings` copy into `result`.
|
|
166
|
+
* - No `verifier` block: the mapping is mechanical, not a re-verification.
|
|
167
|
+
*/
|
|
168
|
+
export declare function mapLegacyEvidenceBlock(block: LegacyEvidenceBlock): EvidenceEnvelope;
|
|
169
|
+
/**
|
|
170
|
+
* Spec-named alias for {@link mapLegacyEvidenceBlock}. §5.5.7 refers to the
|
|
171
|
+
* mapping as `fromLegacyEvidenceBlock`; both names are the same function.
|
|
172
|
+
*/
|
|
173
|
+
export declare const fromLegacyEvidenceBlock: typeof mapLegacyEvidenceBlock;
|
|
174
|
+
/** Map a verifier {@link EvidenceVerificationBlock} whose protocol is frozen-legacy. */
|
|
175
|
+
export declare function envelopeFromEvidenceBlock(block: EvidenceVerificationBlock): EvidenceEnvelope;
|
|
176
|
+
/** Numeric rank of a tier (higher = more independently reproducible). */
|
|
177
|
+
export declare function tierRank(tier: EvidenceTier): number;
|
|
178
|
+
/** The dedup identity key for an envelope instance: `(profile, payload.hash)`. */
|
|
179
|
+
export declare function envelopeIdentityKey(envelope: EvidenceEnvelope): string;
|
|
180
|
+
/**
|
|
181
|
+
* Order envelope instances the way consumers MUST: tier descending, then
|
|
182
|
+
* `verifier.checked_at_ms` descending, then verifier name ascending. Stable;
|
|
183
|
+
* does not mutate the input.
|
|
184
|
+
*/
|
|
185
|
+
export declare function orderEnvelopeInstances<T extends EvidenceEnvelope>(instances: readonly T[]): T[];
|
|
186
|
+
/**
|
|
187
|
+
* Relay-swap detector. A consumer MUST NOT relay another party's envelope
|
|
188
|
+
* with its own identity in `verifier` or with a raised tier; re-verification
|
|
189
|
+
* produces a new instance with its own checks. An instance that differs from
|
|
190
|
+
* another ONLY in its `verifier` block — same tier, facts, result, payload —
|
|
191
|
+
* is a relay under a swapped identity, not a re-verification, and is flagged.
|
|
192
|
+
*/
|
|
193
|
+
export declare function isRelayIdentitySwap(original: Record<string, unknown>, relayed: Record<string, unknown>): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Reproducibility of a well-formed envelope. A `tier: "verified"` envelope
|
|
196
|
+
* whose payload cannot be retrieved (`ref.kind: "withheld"`) is still
|
|
197
|
+
* well-formed; consumers MUST report it as claimed-but-not-reproducible,
|
|
198
|
+
* mirroring the §2.12.7 tiered record-verifiability ladder.
|
|
199
|
+
*/
|
|
200
|
+
export interface EnvelopeReproducibility {
|
|
201
|
+
reproducible: boolean;
|
|
202
|
+
report: 'reproducible' | 'claimed-not-reproducible';
|
|
203
|
+
}
|
|
204
|
+
export declare function assessReproducibility(envelope: EvidenceEnvelope): EnvelopeReproducibility;
|
|
205
|
+
//# sourceMappingURL=evidence-envelope.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
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D;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CAAC,KAAK,EAAE,mBAAmB,GAAG,gBAAgB,CAmCnF;AAED;;;GAGG;AACH,eAAO,MAAM,uBAAuB,+BAAyB,CAAA;AAE7D,wFAAwF;AACxF,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,yBAAyB,GAAG,gBAAgB,CAE5F;AAWD,yEAAyE;AACzE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,YAAY,GAAG,MAAM,CAEnD;AAED,kFAAkF;AAClF,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,MAAM,CAEtE;AAED;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,SAAS,gBAAgB,EAAE,SAAS,EAAE,SAAS,CAAC,EAAE,GAAG,CAAC,EAAE,CAS/F;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC/B,OAAO,CAUT;AAED;;;;;GAKG;AACH,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,OAAO,CAAA;IACrB,MAAM,EAAE,cAAc,GAAG,0BAA0B,CAAA;CACpD;AAED,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,gBAAgB,GAAG,uBAAuB,CAMzF"}
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
2
|
+
/**
|
|
3
|
+
* Universal evidence envelope (spec §5.5.7, D137).
|
|
4
|
+
*
|
|
5
|
+
* The single protocol-level attachment model for all externally verifiable
|
|
6
|
+
* material: OAuth / MCP authorization results, AAuth tokens, x401 proofs,
|
|
7
|
+
* AP2 / Verifiable Intent receipts, human approvals, counterparty
|
|
8
|
+
* co-signature receipts, delegation certificates, and every future evidence
|
|
9
|
+
* type. Each evidence type is a *profile* of the envelope, identified by an
|
|
10
|
+
* absolute HTTPS type URI and versioned independently of the specification.
|
|
11
|
+
*
|
|
12
|
+
* Envelopes are verifier-layer objects. They never touch signed bytes, never
|
|
13
|
+
* enter the 90-byte log entry or a propagation token, and never alter record
|
|
14
|
+
* signature verification, graph derivation, settlement calculation, or
|
|
15
|
+
* `verifyRecord().valid`. Consumers apply their own policy over tiers.
|
|
16
|
+
*
|
|
17
|
+
* This module is the real library surface that the §5.5.7 conformance corpus
|
|
18
|
+
* (`spec/conformance/evidence-envelope/`) exercises through the reference
|
|
19
|
+
* consumer at `packages/verify/test/conformance-evidence-envelope.test.ts`.
|
|
20
|
+
*
|
|
21
|
+
* Producer-side writers of these envelopes follow the §5.8 degradation
|
|
22
|
+
* contract: catch-all, silent-failure, `atrib:`-prefixed logging. A failed
|
|
23
|
+
* envelope construction drops the envelope, never the record or the primary
|
|
24
|
+
* tool response. The pure functions here throw only for the one normative
|
|
25
|
+
* MUST-reject case in the legacy mapping (an unknown legacy protocol string);
|
|
26
|
+
* callers running producer-side wrap that call per §5.8.
|
|
27
|
+
*/
|
|
28
|
+
import canonicalize from 'canonicalize';
|
|
29
|
+
import { hexEncode, sha256 } from '@atrib/mcp';
|
|
30
|
+
// ─── Closed enums (normative, spec §5.5.7) ─────────────────────────────
|
|
31
|
+
/** Tier ladder, ordered by independent reproducibility. Closed at four. */
|
|
32
|
+
export const EVIDENCE_TIERS = ['declared', 'shape', 'attested', 'verified'];
|
|
33
|
+
/** Where the payload bytes are retrievable. Closed at five. */
|
|
34
|
+
export const EVIDENCE_REF_KINDS = ['inline', 'mirror', 'archive', 'external', 'withheld'];
|
|
35
|
+
/** Constraint status, reused unchanged from the §5.5.6 block shape. */
|
|
36
|
+
export const EVIDENCE_CONSTRAINT_STATUSES = [
|
|
37
|
+
'passed',
|
|
38
|
+
'failed',
|
|
39
|
+
'unresolved',
|
|
40
|
+
'not_checked',
|
|
41
|
+
];
|
|
42
|
+
/** `payload.hash` / `ref.record_hash` format: `sha256:` + 64 lowercase hex. */
|
|
43
|
+
export const SHA256_REF_PATTERN = /^sha256:[0-9a-f]{64}$/;
|
|
44
|
+
/** atrib-maintained profiles live under this base URI. */
|
|
45
|
+
export const ATRIB_PROFILE_BASE = 'https://atrib.dev/v1/evidence/';
|
|
46
|
+
// ─── atrib-maintained profile registry (spec §5.5.7) ───────────────────
|
|
47
|
+
/**
|
|
48
|
+
* The atrib-maintained registry: the eight-name initial set plus
|
|
49
|
+
* post-initial registrations (continuation-packet, per D142). Profile
|
|
50
|
+
* identity is the FULL URI; a bare name here is only the trailing path
|
|
51
|
+
* component under {@link ATRIB_PROFILE_BASE}. Third parties register their
|
|
52
|
+
* own absolute HTTPS URIs on domains they control and never appear in
|
|
53
|
+
* this list.
|
|
54
|
+
*/
|
|
55
|
+
export const ATRIB_PROFILE_REGISTRY = [
|
|
56
|
+
'oauth2',
|
|
57
|
+
'mcp-oauth',
|
|
58
|
+
'aauth',
|
|
59
|
+
'x401',
|
|
60
|
+
'ap2-vi',
|
|
61
|
+
'human-approval',
|
|
62
|
+
'counterparty-attestation',
|
|
63
|
+
'delegation-certificate',
|
|
64
|
+
'continuation-packet',
|
|
65
|
+
];
|
|
66
|
+
/** Full type URI for an atrib-maintained profile name. */
|
|
67
|
+
export function atribProfileUri(name) {
|
|
68
|
+
return `${ATRIB_PROFILE_BASE}${name}`;
|
|
69
|
+
}
|
|
70
|
+
/** Convenience map from atrib profile name to its full type URI. */
|
|
71
|
+
export const ATRIB_PROFILE_URIS = Object.freeze(Object.fromEntries(ATRIB_PROFILE_REGISTRY.map((name) => [name, `${ATRIB_PROFILE_BASE}${name}`])));
|
|
72
|
+
// ─── Frozen legacy protocol set (spec §5.5.7) ──────────────────────────
|
|
73
|
+
/**
|
|
74
|
+
* The pre-envelope §5.5.6 `protocol` string set, frozen at exactly five
|
|
75
|
+
* values. No new legacy protocol string may be introduced anywhere in the
|
|
76
|
+
* substrate; every new evidence type registers as an envelope profile.
|
|
77
|
+
*/
|
|
78
|
+
export const FROZEN_LEGACY_PROTOCOLS = ['oauth2', 'mcp_oauth', 'aauth', 'x401', 'ap2_vi'];
|
|
79
|
+
/** The fixed five-row legacy-protocol → profile-URI table. Complete and final. */
|
|
80
|
+
export const LEGACY_PROTOCOL_TO_PROFILE = Object.freeze({
|
|
81
|
+
oauth2: `${ATRIB_PROFILE_BASE}oauth2`,
|
|
82
|
+
mcp_oauth: `${ATRIB_PROFILE_BASE}mcp-oauth`,
|
|
83
|
+
aauth: `${ATRIB_PROFILE_BASE}aauth`,
|
|
84
|
+
x401: `${ATRIB_PROFILE_BASE}x401`,
|
|
85
|
+
ap2_vi: `${ATRIB_PROFILE_BASE}ap2-vi`,
|
|
86
|
+
});
|
|
87
|
+
function isHttpsUri(value) {
|
|
88
|
+
if (typeof value !== 'string')
|
|
89
|
+
return false;
|
|
90
|
+
let url;
|
|
91
|
+
try {
|
|
92
|
+
url = new URL(value);
|
|
93
|
+
}
|
|
94
|
+
catch {
|
|
95
|
+
return false;
|
|
96
|
+
}
|
|
97
|
+
return url.protocol === 'https:';
|
|
98
|
+
}
|
|
99
|
+
function isPlainObject(value) {
|
|
100
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Validate an envelope against the normative §5.5.7 shape rules. Returns a
|
|
104
|
+
* closed set of reason codes; an empty `reasons` array (and `valid: true`)
|
|
105
|
+
* means the envelope is well-formed. Rejecting an envelope never rejects the
|
|
106
|
+
* record it attaches to. This function does not throw.
|
|
107
|
+
*
|
|
108
|
+
* Reason codes: `envelope_version`, `profile_uri`, `profile_version`, `tier`,
|
|
109
|
+
* `payload`, `payload_hash`, `ref`, `ref_kind`, `inline_without_inline_kind`,
|
|
110
|
+
* `record_hash_format`, `record_hash_with_inline_kind`, `result`,
|
|
111
|
+
* `result_valid`, `result_constraints`, `constraint_status`, `result_errors`,
|
|
112
|
+
* `result_warnings`, `verifier`.
|
|
113
|
+
*/
|
|
114
|
+
export function validateEnvelope(envelope) {
|
|
115
|
+
const reasons = [];
|
|
116
|
+
if (!isPlainObject(envelope)) {
|
|
117
|
+
return { valid: false, reasons: ['envelope'] };
|
|
118
|
+
}
|
|
119
|
+
if (envelope['envelope'] !== 1)
|
|
120
|
+
reasons.push('envelope_version');
|
|
121
|
+
if (!isHttpsUri(envelope['profile']))
|
|
122
|
+
reasons.push('profile_uri');
|
|
123
|
+
const profileVersion = envelope['profile_version'];
|
|
124
|
+
if (typeof profileVersion !== 'string' || profileVersion.length === 0) {
|
|
125
|
+
reasons.push('profile_version');
|
|
126
|
+
}
|
|
127
|
+
const tier = envelope['tier'];
|
|
128
|
+
if (typeof tier !== 'string' || !EVIDENCE_TIERS.includes(tier)) {
|
|
129
|
+
reasons.push('tier');
|
|
130
|
+
}
|
|
131
|
+
const payload = envelope['payload'];
|
|
132
|
+
if (!isPlainObject(payload)) {
|
|
133
|
+
reasons.push('payload');
|
|
134
|
+
}
|
|
135
|
+
else {
|
|
136
|
+
const hash = payload['hash'];
|
|
137
|
+
if (typeof hash !== 'string' || !SHA256_REF_PATTERN.test(hash)) {
|
|
138
|
+
reasons.push('payload_hash');
|
|
139
|
+
}
|
|
140
|
+
const ref = payload['ref'];
|
|
141
|
+
if (!isPlainObject(ref)) {
|
|
142
|
+
reasons.push('ref');
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
const kind = ref['kind'];
|
|
146
|
+
if (typeof kind !== 'string' || !EVIDENCE_REF_KINDS.includes(kind)) {
|
|
147
|
+
reasons.push('ref_kind');
|
|
148
|
+
}
|
|
149
|
+
// inline is permitted ONLY when ref.kind is 'inline'.
|
|
150
|
+
if (payload['inline'] !== undefined && kind !== 'inline') {
|
|
151
|
+
reasons.push('inline_without_inline_kind');
|
|
152
|
+
}
|
|
153
|
+
const recordHash = ref['record_hash'];
|
|
154
|
+
if (recordHash !== undefined && recordHash !== null) {
|
|
155
|
+
if (typeof recordHash !== 'string' || !SHA256_REF_PATTERN.test(recordHash)) {
|
|
156
|
+
reasons.push('record_hash_format');
|
|
157
|
+
}
|
|
158
|
+
// record_hash is redundant with an inline body.
|
|
159
|
+
if (kind === 'inline')
|
|
160
|
+
reasons.push('record_hash_with_inline_kind');
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const result = envelope['result'];
|
|
165
|
+
if (!isPlainObject(result)) {
|
|
166
|
+
reasons.push('result');
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
if (typeof result['valid'] !== 'boolean')
|
|
170
|
+
reasons.push('result_valid');
|
|
171
|
+
const constraints = result['constraints'];
|
|
172
|
+
if (!Array.isArray(constraints)) {
|
|
173
|
+
reasons.push('result_constraints');
|
|
174
|
+
}
|
|
175
|
+
else {
|
|
176
|
+
for (const entry of constraints) {
|
|
177
|
+
const status = isPlainObject(entry) ? entry['status'] : undefined;
|
|
178
|
+
if (typeof status !== 'string' ||
|
|
179
|
+
!EVIDENCE_CONSTRAINT_STATUSES.includes(status)) {
|
|
180
|
+
reasons.push('constraint_status');
|
|
181
|
+
break;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (!Array.isArray(result['errors']))
|
|
186
|
+
reasons.push('result_errors');
|
|
187
|
+
if (!Array.isArray(result['warnings']))
|
|
188
|
+
reasons.push('result_warnings');
|
|
189
|
+
}
|
|
190
|
+
const verifier = envelope['verifier'];
|
|
191
|
+
if (verifier !== undefined) {
|
|
192
|
+
if (!isPlainObject(verifier) ||
|
|
193
|
+
typeof verifier['name'] !== 'string' ||
|
|
194
|
+
verifier['name'].length === 0) {
|
|
195
|
+
reasons.push('verifier');
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
return { valid: reasons.length === 0, reasons };
|
|
199
|
+
}
|
|
200
|
+
/** True iff the envelope is well-formed per {@link validateEnvelope}. */
|
|
201
|
+
export function isValidEnvelope(envelope) {
|
|
202
|
+
return validateEnvelope(envelope).valid;
|
|
203
|
+
}
|
|
204
|
+
/**
|
|
205
|
+
* Classify a profile URI against the atrib registry. Identity is the full
|
|
206
|
+
* URI: a foreign domain reusing an atrib profile name (e.g.
|
|
207
|
+
* `https://example.com/v1/evidence/oauth2`) is a valid third-party profile
|
|
208
|
+
* and MUST NOT be treated as the atrib profile of the same name.
|
|
209
|
+
*
|
|
210
|
+
* @param registry trailing-name registry to check against; defaults to the
|
|
211
|
+
* atrib-maintained set. Only consulted for URIs under
|
|
212
|
+
* {@link ATRIB_PROFILE_BASE}.
|
|
213
|
+
*/
|
|
214
|
+
export function classifyProfile(uri, registry = ATRIB_PROFILE_REGISTRY) {
|
|
215
|
+
const uriValid = isHttpsUri(uri);
|
|
216
|
+
const atribMaintained = uriValid && uri.startsWith(ATRIB_PROFILE_BASE);
|
|
217
|
+
const name = atribMaintained ? uri.slice(ATRIB_PROFILE_BASE.length) : '';
|
|
218
|
+
// A nested atrib-shaped path (e.g. .../oauth2/extra) is not a bare
|
|
219
|
+
// registered name; require an exact trailing-name match.
|
|
220
|
+
const registered = atribMaintained && name.length > 0 && registry.includes(name);
|
|
221
|
+
return {
|
|
222
|
+
uri_valid: uriValid,
|
|
223
|
+
atrib_maintained: atribMaintained,
|
|
224
|
+
registered,
|
|
225
|
+
treat_as: registered ? 'registered' : 'unknown-preserve',
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* The opaque rendering surface for any envelope (known or unknown profile):
|
|
230
|
+
* profile URI, tier, and payload hash. Consumers MUST render unknown-profile
|
|
231
|
+
* envelopes this way; they MUST NOT drop them and MUST NOT let them affect
|
|
232
|
+
* record validity. Preservation itself is the identity function — this
|
|
233
|
+
* helper only extracts the safe-to-surface fields.
|
|
234
|
+
*/
|
|
235
|
+
export function renderEnvelopeOpaque(envelope) {
|
|
236
|
+
return {
|
|
237
|
+
profile: envelope.profile,
|
|
238
|
+
tier: envelope.tier,
|
|
239
|
+
payload_hash: envelope.payload.hash,
|
|
240
|
+
};
|
|
241
|
+
}
|
|
242
|
+
// ─── Hashing helpers (spec §5.5.7 payload hash rule) ───────────────────
|
|
243
|
+
const utf8 = new TextEncoder();
|
|
244
|
+
function jcsBytes(value) {
|
|
245
|
+
const json = canonicalize(value);
|
|
246
|
+
if (json === undefined)
|
|
247
|
+
throw new Error('canonicalize returned undefined');
|
|
248
|
+
return utf8.encode(json);
|
|
249
|
+
}
|
|
250
|
+
/** `sha256:` + hex(SHA-256(JCS(value))). The JSON-media-type hash rule. */
|
|
251
|
+
export function jcsSha256(value) {
|
|
252
|
+
return 'sha256:' + hexEncode(sha256(jcsBytes(value)));
|
|
253
|
+
}
|
|
254
|
+
/** `sha256:` + hex(SHA-256(UTF-8(text))). The raw-bytes hash rule. */
|
|
255
|
+
export function rawSha256(text) {
|
|
256
|
+
return 'sha256:' + hexEncode(sha256(utf8.encode(text)));
|
|
257
|
+
}
|
|
258
|
+
function isFrozenLegacyProtocol(value) {
|
|
259
|
+
return FROZEN_LEGACY_PROTOCOLS.includes(value);
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* Deterministically map a legacy §5.5.6 evidence block into envelope form.
|
|
263
|
+
* Two implementations given the same block MUST produce identical envelopes.
|
|
264
|
+
*
|
|
265
|
+
* - `protocol` maps through the fixed five-row table; any other string throws
|
|
266
|
+
* (`unknown legacy evidence protocol '<protocol>'`). The mapping never
|
|
267
|
+
* invents a profile URI. Producer-side callers wrap this per §5.8.
|
|
268
|
+
* - The mapped envelope carries `envelope: 1`, `profile_version: "1.0.0"`,
|
|
269
|
+
* and `tier: "attested"` (a legacy block records what a caller-owned path
|
|
270
|
+
* accepted; it carries no trust roots, so it never claims `"verified"`).
|
|
271
|
+
* - `payload.hash` commits to the legacy block itself (JCS), with
|
|
272
|
+
* `media_type: "application/json"` and `ref.kind: "withheld"`.
|
|
273
|
+
* - `issuer` / `subject` / `scope` / `attenuation_ok` / `delegation_ok` copy
|
|
274
|
+
* into `facts` unchanged (nulls preserved); `details`, when present, is
|
|
275
|
+
* committed as `facts.details_hash` (never inlined).
|
|
276
|
+
* - `valid` / `constraints` / `errors` / `warnings` copy into `result`.
|
|
277
|
+
* - No `verifier` block: the mapping is mechanical, not a re-verification.
|
|
278
|
+
*/
|
|
279
|
+
export function mapLegacyEvidenceBlock(block) {
|
|
280
|
+
if (!isFrozenLegacyProtocol(block.protocol)) {
|
|
281
|
+
throw new Error(`unknown legacy evidence protocol '${block.protocol}'`);
|
|
282
|
+
}
|
|
283
|
+
const profile = LEGACY_PROTOCOL_TO_PROFILE[block.protocol];
|
|
284
|
+
const facts = {
|
|
285
|
+
issuer: block.issuer,
|
|
286
|
+
subject: block.subject,
|
|
287
|
+
scope: block.scope,
|
|
288
|
+
attenuation_ok: block.attenuation_ok,
|
|
289
|
+
delegation_ok: block.delegation_ok,
|
|
290
|
+
};
|
|
291
|
+
if (block.details !== undefined) {
|
|
292
|
+
facts['details_hash'] = jcsSha256(block.details);
|
|
293
|
+
}
|
|
294
|
+
return {
|
|
295
|
+
envelope: 1,
|
|
296
|
+
profile,
|
|
297
|
+
profile_version: '1.0.0',
|
|
298
|
+
tier: 'attested',
|
|
299
|
+
payload: {
|
|
300
|
+
hash: jcsSha256(block),
|
|
301
|
+
media_type: 'application/json',
|
|
302
|
+
ref: { kind: 'withheld' },
|
|
303
|
+
},
|
|
304
|
+
facts,
|
|
305
|
+
result: {
|
|
306
|
+
valid: block.valid,
|
|
307
|
+
constraints: block.constraints,
|
|
308
|
+
errors: block.errors,
|
|
309
|
+
warnings: block.warnings,
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
/**
|
|
314
|
+
* Spec-named alias for {@link mapLegacyEvidenceBlock}. §5.5.7 refers to the
|
|
315
|
+
* mapping as `fromLegacyEvidenceBlock`; both names are the same function.
|
|
316
|
+
*/
|
|
317
|
+
export const fromLegacyEvidenceBlock = mapLegacyEvidenceBlock;
|
|
318
|
+
/** Map a verifier {@link EvidenceVerificationBlock} whose protocol is frozen-legacy. */
|
|
319
|
+
export function envelopeFromEvidenceBlock(block) {
|
|
320
|
+
return mapLegacyEvidenceBlock(block);
|
|
321
|
+
}
|
|
322
|
+
// ─── Tier semantics (spec §5.5.7 tier rules) ───────────────────────────
|
|
323
|
+
const TIER_RANK = {
|
|
324
|
+
declared: 0,
|
|
325
|
+
shape: 1,
|
|
326
|
+
attested: 2,
|
|
327
|
+
verified: 3,
|
|
328
|
+
};
|
|
329
|
+
/** Numeric rank of a tier (higher = more independently reproducible). */
|
|
330
|
+
export function tierRank(tier) {
|
|
331
|
+
return TIER_RANK[tier];
|
|
332
|
+
}
|
|
333
|
+
/** The dedup identity key for an envelope instance: `(profile, payload.hash)`. */
|
|
334
|
+
export function envelopeIdentityKey(envelope) {
|
|
335
|
+
return `${envelope.profile} ${envelope.payload.hash}`;
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Order envelope instances the way consumers MUST: tier descending, then
|
|
339
|
+
* `verifier.checked_at_ms` descending, then verifier name ascending. Stable;
|
|
340
|
+
* does not mutate the input.
|
|
341
|
+
*/
|
|
342
|
+
export function orderEnvelopeInstances(instances) {
|
|
343
|
+
return [...instances].sort((a, b) => {
|
|
344
|
+
const tierDelta = TIER_RANK[b.tier] - TIER_RANK[a.tier];
|
|
345
|
+
if (tierDelta !== 0)
|
|
346
|
+
return tierDelta;
|
|
347
|
+
const aChecked = a.verifier?.checked_at_ms ?? 0;
|
|
348
|
+
const bChecked = b.verifier?.checked_at_ms ?? 0;
|
|
349
|
+
if (bChecked !== aChecked)
|
|
350
|
+
return bChecked - aChecked;
|
|
351
|
+
return (a.verifier?.name ?? '').localeCompare(b.verifier?.name ?? '');
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Relay-swap detector. A consumer MUST NOT relay another party's envelope
|
|
356
|
+
* with its own identity in `verifier` or with a raised tier; re-verification
|
|
357
|
+
* produces a new instance with its own checks. An instance that differs from
|
|
358
|
+
* another ONLY in its `verifier` block — same tier, facts, result, payload —
|
|
359
|
+
* is a relay under a swapped identity, not a re-verification, and is flagged.
|
|
360
|
+
*/
|
|
361
|
+
export function isRelayIdentitySwap(original, relayed) {
|
|
362
|
+
const strip = (envelope) => {
|
|
363
|
+
const clone = { ...envelope };
|
|
364
|
+
delete clone['verifier'];
|
|
365
|
+
return clone;
|
|
366
|
+
};
|
|
367
|
+
const bodiesIdentical = canonicalize(strip(original)) === canonicalize(strip(relayed));
|
|
368
|
+
const verifierChanged = canonicalize(original['verifier'] ?? null) !== canonicalize(relayed['verifier'] ?? null);
|
|
369
|
+
return bodiesIdentical && verifierChanged;
|
|
370
|
+
}
|
|
371
|
+
export function assessReproducibility(envelope) {
|
|
372
|
+
const reproducible = envelope.payload.ref.kind !== 'withheld';
|
|
373
|
+
return {
|
|
374
|
+
reproducible,
|
|
375
|
+
report: reproducible ? 'reproducible' : 'claimed-not-reproducible',
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=evidence-envelope.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evidence-envelope.js","sourceRoot":"","sources":["../src/evidence-envelope.ts"],"names":[],"mappings":"AAAA,sCAAsC;AAEtC;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,YAAY,MAAM,cAAc,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,YAAY,CAAA;AAG9C,0EAA0E;AAE1E,2EAA2E;AAC3E,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAGpF,+DAA+D;AAC/D,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,CAAU,CAAA;AAGlG,uEAAuE;AACvE,MAAM,CAAC,MAAM,4BAA4B,GAAG;IAC1C,QAAQ;IACR,QAAQ;IACR,YA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C,KAAK,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAA;IACtF,MAAM,eAAe,GACnB,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,KAAK,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,IAAI,IAAI,CAAC,CAAA;IAC1F,OAAO,eAAe,IAAI,eAAe,CAAA;AAC3C,CAAC;AAaD,MAAM,UAAU,qBAAqB,CAAC,QAA0B;IAC9D,MAAM,YAAY,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,KAAK,UAAU,CAAA;IAC7D,OAAO;QACL,YAAY;QACZ,MAAM,EAAE,YAAY,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,0BAA0B;KACnE,CAAA;AACH,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,6 +4,8 @@ export { verifyRecord } from './verify-record.js';
|
|
|
4
4
|
export type { RecordVerificationResult, ProvenanceAnnotation, VerifyRecordOptions, ResolvedCapabilityFacts, CrossAttestationAnnotation, } from './verify-record.js';
|
|
5
5
|
export { verifyAuthorizationEvidence, verifyOAuthAuthorizationEvidence, } from './authorization-evidence.js';
|
|
6
6
|
export type { AuthorizationEvidenceInput, EvidenceCheckStatus, EvidenceConstraintCheck, EvidenceVerificationBlock, OAuthAccessTokenClaims, OAuthAuthorizationDetailConstraint, OAuthAuthorizationEvidenceInput, OAuthAuthorizationEvidenceVerification, OAuthDpopCheck, OAuthDpopProofInput, OAuthEvidenceProtocol, OAuthProtectedResourceMetadata, OAuthSignaturePolicy, OAuthTokenIntrospectionResponse, OAuthTokenCheck, } from './authorization-evidence.js';
|
|
7
|
+
export { decodeX401HeaderObject, encodeX401HeaderObject, verifyX401AuthorizationEvidence, } from './x401-evidence.js';
|
|
8
|
+
export type { X401AuthorizationEvidenceDetails, X401AuthorizationEvidenceInput, X401AuthorizationEvidenceVerification, X401EvidenceProtocol, X401HeaderSet, X401HeaderSource, X401HeaderValue, X401ProofGateStatus, X401ResponseKind, X401VerificationPolicy, } from './x401-evidence.js';
|
|
7
9
|
export { verifyAAuthAuthorizationEvidence } from './aauth-evidence.js';
|
|
8
10
|
export type { AAuthAccessMode, AAuthActClaim, AAuthAuthorizationEvidenceInput, AAuthAuthorizationEvidenceVerification, AAuthEvidenceProtocol, AAuthHttpSignatureCheck, AAuthHttpSignatureEvidence, AAuthMissionClaim, AAuthR3Check, AAuthR3Evidence, AAuthResourceMetadataEvidence, AAuthSignaturePolicy, AAuthTokenCheck, AAuthTokenClaims, AAuthTokenKind, } from './aauth-evidence.js';
|
|
9
11
|
export { FetchDpopReplayCache, MemoryDpopReplayCache, createFetchDpopReplayCache, dpopReplayCacheKeyId, } from './dpop-replay-cache.js';
|
|
@@ -12,6 +14,8 @@ export { introspectOAuthToken, oauthEvidenceFromIntrospectionResult, } from './o
|
|
|
12
14
|
export type { OAuthIntrospectionClientAuthentication, OAuthIntrospectionOptions, OAuthIntrospectionResult, } from './oauth-introspection.js';
|
|
13
15
|
export { handoffClaimsFromEvidencePacket, verifyHandoffClaims } from './handoff.js';
|
|
14
16
|
export type { HandoffBodyVerification, HandoffClaimsFromEvidenceOptions, HandoffClaimInput, HandoffClaimVerification, HandoffEvidenceEntry, HandoffEvidencePacket, HandoffProofVerification, HandoffRejectionReason, HandoffVerificationResult, VerifyHandoffClaimsOptions, } from './handoff.js';
|
|
17
|
+
export { ATRIB_PROFILE_BASE, ATRIB_PROFILE_REGISTRY, ATRIB_PROFILE_URIS, EVIDENCE_CONSTRAINT_STATUSES, EVIDENCE_REF_KINDS, EVIDENCE_TIERS, FROZEN_LEGACY_PROTOCOLS, LEGACY_PROTOCOL_TO_PROFILE, SHA256_REF_PATTERN, assessReproducibility, atribProfileUri, classifyProfile, envelopeFromEvidenceBlock, envelopeIdentityKey, fromLegacyEvidenceBlock, isRelayIdentitySwap, isValidEnvelope, jcsSha256, mapLegacyEvidenceBlock, orderEnvelopeInstances, rawSha256, renderEnvelopeOpaque, tierRank, validateEnvelope, } from './evidence-envelope.js';
|
|
18
|
+
export type { AtribProfileName, EnvelopeReproducibility, EnvelopeValidation, EvidenceEnvelope, EvidenceEnvelopePayload, EvidenceEnvelopeRef, EvidenceEnvelopeResult, EvidenceEnvelopeVerifier, EvidenceConstraintStatus, EvidenceRefKind, EvidenceTier, FrozenLegacyProtocol, LegacyEvidenceBlock, OpaqueEnvelopeRender, ProfileClassification, } from './evidence-envelope.js';
|
|
15
19
|
export { calculate, DEFAULT_POLICY, isValidPolicy } from './calculate.js';
|
|
16
20
|
export { signRecommendation, verifyRecommendationSignature, recommendationSigningInput, distributionsMatch, } from './recommendation.js';
|
|
17
21
|
export { buildPolicy, policyFrom } from './policy-builder.js';
|
|
@@ -24,4 +28,10 @@ export { resolveIdentity } from './resolve-identity.js';
|
|
|
24
28
|
export type { IdentityResolution, IdentityResolutionMethod, KeyRevocationStatus, ResolveIdentityOptions, IdentityClaim, CapabilityEnvelope, } from './resolve-identity.js';
|
|
25
29
|
export type { GraphNode, GraphEdge, GraphResponse, EventType, EdgeType, GapNode, VerificationState, ReferenceStatus, PolicyDocument, PolicyConstraints, EdgeWeights, Modifier, DistributionMethod, CreatorPolicySnapshot, CreatorPolicyEntry, SessionPolicyRecord, Distribution, RecommendationDocument, VerificationResult, } from './types.js';
|
|
26
30
|
export { graphLabelFromEventTypeUri } from './types.js';
|
|
31
|
+
export { checkDelegationScope, delegationCertErrors, delegationCertHash, delegationCertSignatureVerifies, delegationCertSigningInput, evaluateDelegation, evaluateRevokerAuthorization, } from './delegation.js';
|
|
32
|
+
export type { DelegatedRecord, DelegationCandidate, DelegationCertificate, DelegationOutcome, DelegationScope, DelegationScopeCheck, EvaluateDelegationOptions, KeyRevocationRecordLike, RevokerAuthorization, } from './delegation.js';
|
|
33
|
+
export { ANCHOR_CLAIM_PREFIX, REGISTERED_NON_LOG_ANCHOR_TYPES, anchorOperatorGroup, verifyAnchorPlurality, verifyAnchorProofElement, } from './anchor-plurality.js';
|
|
34
|
+
export type { AnchorDisagreeingPair, AnchorElementResult, AnchorElementStatus, AnchorNotFoundResponse, AnchorOperatorGroup, AnchorPluralityAnnotation, AnchorPluralityVerdict, AnchorProofBundle, AnchorProofElement, AnchorTrustConfig, AnchorTrustEntry, } from './anchor-plurality.js';
|
|
35
|
+
export { DEFAULT_SESSION_CHECKPOINT_STALENESS_BOUND_MS, SESSION_CHECKPOINT_EVENT_TYPE_URI, checkConsecutiveSessionCheckpoints, detectSessionCheckpointEquivocation, recomputeSessionRoot, recomputeSessionRootFromLeafBytes, sessionCheckpointArgsHash, sessionCheckpointFreshness, sessionCheckpointRecordHash, sessionLeafBytes, validateSessionCheckpointStructural, verifySessionCheckpointRecord, verifySessionConsistencyProof, verifySessionInclusionProof, } from './session-checkpoint.js';
|
|
36
|
+
export type { CheckConsecutiveSessionCheckpointsOptions, ConsecutiveSessionCheckpointCheck, SessionCheckpointBody, SessionCheckpointEquivocationEvidence, SessionCheckpointFreshness, SessionCheckpointRecord, SessionCheckpointVerification, VerifySessionCheckpointRecordOptions, VerifySessionConsistencyProofOptions, VerifySessionInclusionProofOptions, } from './session-checkpoint.js';
|
|
27
37
|
//# sourceMappingURL=index.d.ts.map
|