nostr-veil 0.21.0 → 0.22.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 +5 -1
- package/dist/profiles/index.d.ts +1 -0
- package/dist/profiles/index.d.ts.map +1 -1
- package/dist/profiles/index.js +1 -0
- package/dist/profiles/index.js.map +1 -1
- package/dist/profiles/report.d.ts +60 -0
- package/dist/profiles/report.d.ts.map +1 -0
- package/dist/profiles/report.js +161 -0
- package/dist/profiles/report.js.map +1 -0
- package/llms-full.txt +16 -1
- package/llms.txt +7 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -172,6 +172,7 @@ The resulting `assertion` is a plain `EventTemplate` you sign and publish like a
|
|
|
172
172
|
| `createSignedDeploymentBundle(policy, options)` | Sign a deployment policy and its manifests as trusted operator configuration |
|
|
173
173
|
| `verifyDeploymentBundle(events, bundle, options?)` | Verify a signed bundle from trusted publishers, then verify the bundled deployment policy |
|
|
174
174
|
| `verifyProductionDeployment(events, bundle, options?)` | One-call production gate that also requires an expiring bundle and signed relay-fetched events by default |
|
|
175
|
+
| `createProductionDecisionReport(result)`, `verifyProductionDeploymentReport(events, bundle, options?)` | Produce an audit/UI-ready decision report with recommended action, issue remediation, and control status |
|
|
175
176
|
| `VerificationIssue`, `VerificationIssueCode` | Stable machine-readable issue codes returned alongside human-readable errors |
|
|
176
177
|
| `explainVerificationIssue(issueOrCode)`, `remediationForIssue(issueOrCode)` | Turn stable issue codes into concrete operator or verifier remediation guidance |
|
|
177
178
|
| `canonicalRelaySubject`, `canonicalServiceSubject`, `canonicalNip05Subject`, `canonicalDomainSubject`, `canonicalLnurlpSubject`, `canonicalNip96Subject`, `canonicalNpmPackageSubject`, `canonicalGitRepositorySubject`, `canonicalGithubRepositorySubject`, `canonicalMaintainerSubject` | Canonical subject helpers for common real-world identifiers |
|
|
@@ -270,7 +271,10 @@ composing lower-level checks. It returns the existing human-readable `errors`
|
|
|
270
271
|
plus stable `issues[].code` values such as `bundle.signer_untrusted`,
|
|
271
272
|
`event.signature_invalid`, `circle.unaccepted`, and `metric.below_min`. Use
|
|
272
273
|
`explainVerificationIssue()` or `remediationForIssue()` to show the exact
|
|
273
|
-
operator action for each failure.
|
|
274
|
+
operator action for each failure. For application UI, audit logs, and support
|
|
275
|
+
runbooks, `verifyProductionDeploymentReport()` returns the same decision with a
|
|
276
|
+
recommended action, expanded issue remediations, and pass/fail/not-checked
|
|
277
|
+
status for the production controls.
|
|
274
278
|
|
|
275
279
|
---
|
|
276
280
|
|
package/dist/profiles/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
|
package/dist/profiles/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAA;AAC1B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,eAAe,CAAA;AAC7B,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,iBAAiB,CAAA;AAC/B,cAAc,aAAa,CAAA"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { EventTemplate } from '../nip85/types.js';
|
|
2
|
+
import type { SignedDeploymentBundle } from './bundle.js';
|
|
3
|
+
import type { VerificationIssue, VerificationIssueAction, VerificationIssueExplanation } from './issues.js';
|
|
4
|
+
import type { ProductionDeploymentVerification, VerifyProductionDeploymentOptions } from './production.js';
|
|
5
|
+
import type { UseCaseProfile } from './types.js';
|
|
6
|
+
export type ProductionDecisionRecommendedAction = VerificationIssueAction | 'accept';
|
|
7
|
+
export type ProductionControlStatus = 'pass' | 'fail' | 'not-checked';
|
|
8
|
+
export type ProductionControlId = 'bundle-publisher' | 'bundle-signature' | 'bundle-freshness' | 'event-signatures' | 'circle-policy' | 'profile-subject' | 'proof-threshold' | 'metric-policy';
|
|
9
|
+
export interface ProductionDecisionIssue extends VerificationIssue, VerificationIssueExplanation {
|
|
10
|
+
}
|
|
11
|
+
export interface ProductionControlReport {
|
|
12
|
+
id: ProductionControlId;
|
|
13
|
+
label: string;
|
|
14
|
+
status: ProductionControlStatus;
|
|
15
|
+
summary: string;
|
|
16
|
+
}
|
|
17
|
+
export interface ProductionDecisionProfileSummary {
|
|
18
|
+
id: string;
|
|
19
|
+
title: string;
|
|
20
|
+
status: UseCaseProfile['status'];
|
|
21
|
+
kind: number;
|
|
22
|
+
subjectTag: UseCaseProfile['subjectTag'];
|
|
23
|
+
subjectTagValue?: string;
|
|
24
|
+
subjectFormats: readonly UseCaseProfile['subjectFormats'][number][];
|
|
25
|
+
proofVersion: UseCaseProfile['proofVersion'];
|
|
26
|
+
}
|
|
27
|
+
export interface ProductionDecisionBundleSummary {
|
|
28
|
+
id: string;
|
|
29
|
+
signer: string;
|
|
30
|
+
issuedAt: number;
|
|
31
|
+
expiresAt?: number;
|
|
32
|
+
publisherTrusted: boolean;
|
|
33
|
+
signatureValid: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface ProductionDecisionReport {
|
|
36
|
+
decision: ProductionDeploymentVerification['decision'];
|
|
37
|
+
valid: boolean;
|
|
38
|
+
recommendedAction: ProductionDecisionRecommendedAction;
|
|
39
|
+
bundle: ProductionDecisionBundleSummary;
|
|
40
|
+
profile: ProductionDecisionProfileSummary;
|
|
41
|
+
policyId: string;
|
|
42
|
+
subject: string;
|
|
43
|
+
metrics: Readonly<Record<string, readonly number[]>>;
|
|
44
|
+
controls: readonly ProductionControlReport[];
|
|
45
|
+
issues: readonly ProductionDecisionIssue[];
|
|
46
|
+
remediations: readonly string[];
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Convert a production verification result into an audit- and UI-ready report.
|
|
50
|
+
*
|
|
51
|
+
* The report preserves the verifier decision, adds stable remediation guidance,
|
|
52
|
+
* and names the production controls that passed, failed, or were explicitly
|
|
53
|
+
* relaxed. It does not change the underlying verification semantics.
|
|
54
|
+
*/
|
|
55
|
+
export declare function createProductionDecisionReport(result: ProductionDeploymentVerification): ProductionDecisionReport;
|
|
56
|
+
/**
|
|
57
|
+
* Verify a production deployment and return the decision report directly.
|
|
58
|
+
*/
|
|
59
|
+
export declare function verifyProductionDeploymentReport(events: EventTemplate | readonly EventTemplate[], bundle: SignedDeploymentBundle, options?: VerifyProductionDeploymentOptions): ProductionDecisionReport;
|
|
60
|
+
//# sourceMappingURL=report.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.d.ts","sourceRoot":"","sources":["../../src/profiles/report.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,KAAK,EACV,iBAAiB,EACjB,uBAAuB,EACvB,4BAA4B,EAC7B,MAAM,aAAa,CAAA;AACpB,OAAO,KAAK,EACV,gCAAgC,EAChC,iCAAiC,EAClC,MAAM,iBAAiB,CAAA;AACxB,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAA;AAEhD,MAAM,MAAM,mCAAmC,GAAG,uBAAuB,GAAG,QAAQ,CAAA;AAEpF,MAAM,MAAM,uBAAuB,GAAG,MAAM,GAAG,MAAM,GAAG,aAAa,CAAA;AAErE,MAAM,MAAM,mBAAmB,GAC3B,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,kBAAkB,GAClB,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,eAAe,CAAA;AAEnB,MAAM,WAAW,uBAAwB,SAAQ,iBAAiB,EAAE,4BAA4B;CAAG;AAEnG,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,mBAAmB,CAAA;IACvB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,uBAAuB,CAAA;IAC/B,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,gCAAgC;IAC/C,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,cAAc,CAAC,QAAQ,CAAC,CAAA;IAChC,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;IACxC,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,cAAc,EAAE,SAAS,cAAc,CAAC,gBAAgB,CAAC,CAAC,MAAM,CAAC,EAAE,CAAA;IACnE,YAAY,EAAE,cAAc,CAAC,cAAc,CAAC,CAAA;CAC7C;AAED,MAAM,WAAW,+BAA+B;IAC9C,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,OAAO,CAAA;IACzB,cAAc,EAAE,OAAO,CAAA;CACxB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,gCAAgC,CAAC,UAAU,CAAC,CAAA;IACtD,KAAK,EAAE,OAAO,CAAA;IACd,iBAAiB,EAAE,mCAAmC,CAAA;IACtD,MAAM,EAAE,+BAA+B,CAAA;IACvC,OAAO,EAAE,gCAAgC,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;IACf,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAA;IACpD,QAAQ,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC5C,MAAM,EAAE,SAAS,uBAAuB,EAAE,CAAA;IAC1C,YAAY,EAAE,SAAS,MAAM,EAAE,CAAA;CAChC;AAmMD;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,gCAAgC,GACvC,wBAAwB,CAgB1B;AAED;;GAEG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,GAAG,SAAS,aAAa,EAAE,EAChD,MAAM,EAAE,sBAAsB,EAC9B,OAAO,GAAE,iCAAsC,GAC9C,wBAAwB,CAE1B"}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { explainVerificationIssue } from './issues.js';
|
|
2
|
+
import { verifyProductionDeployment } from './production.js';
|
|
3
|
+
const ACTION_PRIORITY = {
|
|
4
|
+
accept: 0,
|
|
5
|
+
reject: 1,
|
|
6
|
+
'manual-review': 2,
|
|
7
|
+
'refresh-and-retry': 3,
|
|
8
|
+
'operator-action': 4,
|
|
9
|
+
};
|
|
10
|
+
function decisionIssue(issue) {
|
|
11
|
+
const explanation = explainVerificationIssue(issue);
|
|
12
|
+
return Object.freeze({
|
|
13
|
+
...issue,
|
|
14
|
+
summary: explanation.summary,
|
|
15
|
+
remediation: explanation.remediation,
|
|
16
|
+
action: explanation.action,
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
function recommendedAction(valid, issues) {
|
|
20
|
+
if (valid && issues.length === 0)
|
|
21
|
+
return 'accept';
|
|
22
|
+
if (issues.length === 0)
|
|
23
|
+
return 'reject';
|
|
24
|
+
return issues.reduce((strongest, issue) => {
|
|
25
|
+
return ACTION_PRIORITY[issue.action] > ACTION_PRIORITY[strongest] ? issue.action : strongest;
|
|
26
|
+
}, 'reject');
|
|
27
|
+
}
|
|
28
|
+
function uniqueRemediations(issues) {
|
|
29
|
+
return Object.freeze([...new Set(issues.map(issue => issue.remediation))]);
|
|
30
|
+
}
|
|
31
|
+
function issueCodeSet(issues) {
|
|
32
|
+
return new Set(issues.map(issue => issue.code));
|
|
33
|
+
}
|
|
34
|
+
function hasPrefix(codes, prefix) {
|
|
35
|
+
return [...codes].some(code => code.startsWith(prefix));
|
|
36
|
+
}
|
|
37
|
+
function hasAny(codes, candidates) {
|
|
38
|
+
return candidates.some(code => codes.has(code));
|
|
39
|
+
}
|
|
40
|
+
function control(id, label, status, summary) {
|
|
41
|
+
return Object.freeze({ id, label, status, summary });
|
|
42
|
+
}
|
|
43
|
+
function statusFromIssues(codes, candidates) {
|
|
44
|
+
return hasAny(codes, candidates) ? 'fail' : 'pass';
|
|
45
|
+
}
|
|
46
|
+
function productionControls(result, issues) {
|
|
47
|
+
const codes = issueCodeSet(issues);
|
|
48
|
+
const signatureChecked = result.deployment.nostrSignatures.checked;
|
|
49
|
+
const bundleHasExpiry = result.bundle.bundle.expiresAt !== undefined;
|
|
50
|
+
const bundleFreshnessFailed = hasAny(codes, [
|
|
51
|
+
'bundle.expired',
|
|
52
|
+
'bundle.expires_at_invalid',
|
|
53
|
+
'bundle.expiry_required',
|
|
54
|
+
'bundle.issued_at_future',
|
|
55
|
+
'bundle.issued_at_invalid',
|
|
56
|
+
]);
|
|
57
|
+
const eventSignatureStatus = signatureChecked
|
|
58
|
+
? (result.deployment.nostrSignatures.valid ? 'pass' : 'fail')
|
|
59
|
+
: (codes.has('policy.nostr_signature_not_required') ? 'fail' : 'not-checked');
|
|
60
|
+
const bundleFreshnessStatus = bundleFreshnessFailed
|
|
61
|
+
? 'fail'
|
|
62
|
+
: (bundleHasExpiry ? 'pass' : 'not-checked');
|
|
63
|
+
return Object.freeze([
|
|
64
|
+
control('bundle-publisher', 'Trusted bundle publisher', result.bundle.publisherTrusted ? 'pass' : 'fail', result.bundle.publisherTrusted
|
|
65
|
+
? 'The signed deployment bundle came from a configured trusted publisher key.'
|
|
66
|
+
: 'The verifier cannot tie this bundle to a configured trusted publisher key.'),
|
|
67
|
+
control('bundle-signature', 'Bundle signature', result.bundle.signatureValid ? 'pass' : 'fail', result.bundle.signatureValid
|
|
68
|
+
? 'The deployment bundle signature verifies against the bundle signer.'
|
|
69
|
+
: 'The deployment bundle signature is malformed, invalid, or does not match the payload.'),
|
|
70
|
+
control('bundle-freshness', 'Bundle freshness', bundleFreshnessStatus, bundleFreshnessStatus === 'pass'
|
|
71
|
+
? 'The deployment bundle is time-bounded and valid for this verification time.'
|
|
72
|
+
: bundleFreshnessStatus === 'not-checked'
|
|
73
|
+
? 'Bundle expiry was explicitly relaxed, so this report cannot prove the bundle is time-bounded.'
|
|
74
|
+
: 'The deployment bundle is missing required expiry metadata, expired, or outside its valid time window.'),
|
|
75
|
+
control('event-signatures', 'Relay event signatures', eventSignatureStatus, eventSignatureStatus === 'pass'
|
|
76
|
+
? 'Every checked relay-fetched assertion has a valid Nostr event id and signature.'
|
|
77
|
+
: eventSignatureStatus === 'not-checked'
|
|
78
|
+
? 'Relay event signature verification was explicitly relaxed for this deployment.'
|
|
79
|
+
: 'At least one relay-fetched assertion is unsigned, mutated, or the policy does not require signed events.'),
|
|
80
|
+
control('circle-policy', 'Accepted circle policy', hasPrefix(codes, 'circle.') ? 'fail' : 'pass', hasPrefix(codes, 'circle.')
|
|
81
|
+
? 'The assertion used a circle that is missing, malformed, expired, revoked, superseded, unaccepted, or not allowed for this profile.'
|
|
82
|
+
: 'The assertion was produced by a circle accepted by the deployment policy.'),
|
|
83
|
+
control('profile-subject', 'Profile and subject binding', statusFromIssues(codes, [
|
|
84
|
+
'profile.event_count_invalid',
|
|
85
|
+
'profile.kind_mismatch',
|
|
86
|
+
'profile.subject_format_invalid',
|
|
87
|
+
'profile.subject_hint_mismatch',
|
|
88
|
+
'profile.subject_mismatch',
|
|
89
|
+
'nip85.syntax_invalid',
|
|
90
|
+
]), hasAny(codes, [
|
|
91
|
+
'profile.event_count_invalid',
|
|
92
|
+
'profile.kind_mismatch',
|
|
93
|
+
'profile.subject_format_invalid',
|
|
94
|
+
'profile.subject_hint_mismatch',
|
|
95
|
+
'profile.subject_mismatch',
|
|
96
|
+
'nip85.syntax_invalid',
|
|
97
|
+
])
|
|
98
|
+
? 'The assertion does not match the expected profile shape, subject, subject hint, or NIP-85 syntax.'
|
|
99
|
+
: 'The assertion matches the profile kind, canonical subject, subject hint, and NIP-85 syntax policy.'),
|
|
100
|
+
control('proof-threshold', 'Proof and threshold', hasPrefix(codes, 'proof.') || hasPrefix(codes, 'federation.') || hasPrefix(codes, 'assertion.')
|
|
101
|
+
? 'fail'
|
|
102
|
+
: 'pass', hasPrefix(codes, 'proof.') || hasPrefix(codes, 'federation.') || hasPrefix(codes, 'assertion.')
|
|
103
|
+
? 'The proof, federation, threshold, or assertion freshness check failed.'
|
|
104
|
+
: 'The nostr-veil proof, signer threshold, federation policy, and assertion freshness checks passed.'),
|
|
105
|
+
control('metric-policy', 'Metric policy', hasPrefix(codes, 'metric.') ? 'fail' : 'pass', hasPrefix(codes, 'metric.')
|
|
106
|
+
? 'At least one metric is missing, unexpected, non-numeric, non-integer, or outside the deployment bounds.'
|
|
107
|
+
: 'The published metrics satisfy the deployment metric policy.'),
|
|
108
|
+
]);
|
|
109
|
+
}
|
|
110
|
+
function profileSummary(profile) {
|
|
111
|
+
return Object.freeze({
|
|
112
|
+
id: profile.id,
|
|
113
|
+
title: profile.title,
|
|
114
|
+
status: profile.status,
|
|
115
|
+
kind: profile.kind,
|
|
116
|
+
subjectTag: profile.subjectTag,
|
|
117
|
+
...(profile.subjectTagValue === undefined ? {} : { subjectTagValue: profile.subjectTagValue }),
|
|
118
|
+
subjectFormats: Object.freeze([...profile.subjectFormats]),
|
|
119
|
+
proofVersion: profile.proofVersion,
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
function bundleSummary(result) {
|
|
123
|
+
return Object.freeze({
|
|
124
|
+
id: result.bundle.bundle.id,
|
|
125
|
+
signer: result.bundle.bundle.signer,
|
|
126
|
+
issuedAt: result.bundle.bundle.issuedAt,
|
|
127
|
+
...(result.bundle.bundle.expiresAt === undefined ? {} : { expiresAt: result.bundle.bundle.expiresAt }),
|
|
128
|
+
publisherTrusted: result.bundle.publisherTrusted,
|
|
129
|
+
signatureValid: result.bundle.signatureValid,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Convert a production verification result into an audit- and UI-ready report.
|
|
134
|
+
*
|
|
135
|
+
* The report preserves the verifier decision, adds stable remediation guidance,
|
|
136
|
+
* and names the production controls that passed, failed, or were explicitly
|
|
137
|
+
* relaxed. It does not change the underlying verification semantics.
|
|
138
|
+
*/
|
|
139
|
+
export function createProductionDecisionReport(result) {
|
|
140
|
+
const issues = Object.freeze(result.issues.map(decisionIssue));
|
|
141
|
+
return Object.freeze({
|
|
142
|
+
decision: result.decision,
|
|
143
|
+
valid: result.valid,
|
|
144
|
+
recommendedAction: recommendedAction(result.valid, issues),
|
|
145
|
+
bundle: bundleSummary(result),
|
|
146
|
+
profile: profileSummary(result.deployment.policy.profile),
|
|
147
|
+
policyId: result.deployment.policy.id,
|
|
148
|
+
subject: result.deployment.policy.expectedSubject,
|
|
149
|
+
metrics: result.deployment.metrics,
|
|
150
|
+
controls: productionControls(result, issues),
|
|
151
|
+
issues,
|
|
152
|
+
remediations: uniqueRemediations(issues),
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Verify a production deployment and return the decision report directly.
|
|
157
|
+
*/
|
|
158
|
+
export function verifyProductionDeploymentReport(events, bundle, options = {}) {
|
|
159
|
+
return createProductionDecisionReport(verifyProductionDeployment(events, bundle, options));
|
|
160
|
+
}
|
|
161
|
+
//# sourceMappingURL=report.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/profiles/report.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAuE5D,MAAM,eAAe,GAAwD;IAC3E,MAAM,EAAE,CAAC;IACT,MAAM,EAAE,CAAC;IACT,eAAe,EAAE,CAAC;IAClB,mBAAmB,EAAE,CAAC;IACtB,iBAAiB,EAAE,CAAC;CACrB,CAAA;AAED,SAAS,aAAa,CAAC,KAAwB;IAC7C,MAAM,WAAW,GAAG,wBAAwB,CAAC,KAAK,CAAC,CAAA;IAEnD,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,GAAG,KAAK;QACR,OAAO,EAAE,WAAW,CAAC,OAAO;QAC5B,WAAW,EAAE,WAAW,CAAC,WAAW;QACpC,MAAM,EAAE,WAAW,CAAC,MAAM;KAC3B,CAAC,CAAA;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,KAAc,EACd,MAA0C;IAE1C,IAAI,KAAK,IAAI,MAAM,CAAC,MA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AO;QAClC,QAAQ,EAAE,kBAAkB,CAAC,MAAM,EAAE,MAAM,CAAC;QAC5C,MAAM;QACN,YAAY,EAAE,kBAAkB,CAAC,MAAM,CAAC;KACzC,CAAC,CAAA;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAgD,EAChD,MAA8B,EAC9B,UAA6C,EAAE;IAE/C,OAAO,8BAA8B,CAAC,0BAA0B,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA;AAC5F,CAAC"}
|
package/llms-full.txt
CHANGED
|
@@ -163,7 +163,10 @@ Deployment/profile verifiers keep human-readable `errors` for compatibility and
|
|
|
163
163
|
also return stable `issues[].code` values for application policy, logging, and
|
|
164
164
|
alerts. Use `explainVerificationIssue(issueOrCode)` or
|
|
165
165
|
`remediationForIssue(issueOrCode)` to turn a stable code into the concrete next
|
|
166
|
-
operator or verifier action.
|
|
166
|
+
operator or verifier action. For production UI and audit logs,
|
|
167
|
+
`verifyProductionDeploymentReport()` returns the verifier decision with expanded
|
|
168
|
+
issue remediations, a recommended action, and pass/fail/not-checked status for
|
|
169
|
+
the controls.
|
|
167
170
|
|
|
168
171
|
### `EventTemplate`
|
|
169
172
|
|
|
@@ -683,6 +686,18 @@ For example, `bundle.trusted_publishers_missing` means the verifier has no
|
|
|
683
686
|
pinned publisher keys, while `event.signature_invalid` means the fetched event
|
|
684
687
|
must be rejected and can optionally be retried from another relay.
|
|
685
688
|
|
|
689
|
+
#### `createProductionDecisionReport(result) → ProductionDecisionReport`
|
|
690
|
+
|
|
691
|
+
Convert a `verifyProductionDeployment()` result into an audit- and UI-ready
|
|
692
|
+
report. The report keeps the accept/reject decision, adds `recommendedAction`,
|
|
693
|
+
expands every issue with summary and remediation text, lists unique
|
|
694
|
+
remediations, and reports whether production controls passed, failed, or were
|
|
695
|
+
explicitly relaxed.
|
|
696
|
+
|
|
697
|
+
#### `verifyProductionDeploymentReport(events, bundle, options) → ProductionDecisionReport`
|
|
698
|
+
|
|
699
|
+
Verify a production deployment and return the decision report directly.
|
|
700
|
+
|
|
686
701
|
Canonical subject helpers cover Nostr-native subjects plus relays, service
|
|
687
702
|
endpoints, NIP-05, domains, LNURLp, NIP-96, npm packages, git repositories,
|
|
688
703
|
GitHub repositories, maintainers, vendors, and sources. Prefer them before
|
package/llms.txt
CHANGED
|
@@ -62,11 +62,13 @@ Two subpath exports, plus a root that re-exports everything:
|
|
|
62
62
|
`USE_CASE_PROFILES`, `USE_CASE_PROFILE_BY_ID`, `verifyUseCaseProfile`,
|
|
63
63
|
`createCircleManifest`, `verifyCircleManifest`, `createDeploymentPolicy`,
|
|
64
64
|
`verifyDeploymentPolicy`, `createSignedDeploymentBundle`,
|
|
65
|
-
`verifyDeploymentBundle`, `verifyProductionDeployment`,
|
|
66
|
-
`
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
65
|
+
`verifyDeploymentBundle`, `verifyProductionDeployment`,
|
|
66
|
+
`createProductionDecisionReport`, `verifyProductionDeploymentReport`,
|
|
67
|
+
`VerificationIssue`, `VerificationIssueCode`, `explainVerificationIssue`,
|
|
68
|
+
`remediationForIssue`, and canonical subject helpers. Use
|
|
69
|
+
`verifyProductionDeployment` with pinned trusted publisher pubkeys for
|
|
70
|
+
production relay-fetched assertions; it also requires expiring bundles and
|
|
71
|
+
signed events by default. Use decision reports and issue explanations to turn
|
|
70
72
|
failures into concrete operator actions instead of only showing negative
|
|
71
73
|
results.
|
|
72
74
|
Canonical subject helpers cover Nostr-native subjects plus relays, service
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nostr-veil",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "Privacy layer for Nostr reputation systems. Groups collectively score trustworthiness using ring signatures -- scores are verifiable but contributors are unidentifiable.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|