nostr-veil 0.36.0 → 0.37.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/README.md +30 -12
- package/bin/cli.js +77 -16
- package/dist/nip85/shape.d.ts +53 -0
- package/dist/nip85/shape.d.ts.map +1 -0
- package/dist/nip85/shape.js +75 -0
- package/dist/nip85/shape.js.map +1 -0
- package/dist/nip85/validators.d.ts.map +1 -1
- package/dist/nip85/validators.js +27 -13
- package/dist/nip85/validators.js.map +1 -1
- package/dist/profiles/admission.d.ts +1 -1
- package/dist/profiles/admission.d.ts.map +1 -1
- package/dist/profiles/admission.js +57 -18
- package/dist/profiles/admission.js.map +1 -1
- package/dist/profiles/authentic.d.ts +13 -0
- package/dist/profiles/authentic.d.ts.map +1 -0
- package/dist/profiles/authentic.js +12 -0
- package/dist/profiles/authentic.js.map +1 -0
- package/dist/profiles/bundle.d.ts +1 -1
- package/dist/profiles/bundle.d.ts.map +1 -1
- package/dist/profiles/bundle.js +72 -14
- package/dist/profiles/bundle.js.map +1 -1
- package/dist/profiles/issues.d.ts +1 -1
- package/dist/profiles/issues.d.ts.map +1 -1
- package/dist/profiles/issues.js +11 -1
- package/dist/profiles/issues.js.map +1 -1
- package/dist/profiles/policy.d.ts +27 -0
- package/dist/profiles/policy.d.ts.map +1 -1
- package/dist/profiles/policy.js +88 -14
- package/dist/profiles/policy.js.map +1 -1
- package/dist/profiles/production.d.ts.map +1 -1
- package/dist/profiles/production.js +7 -3
- package/dist/profiles/production.js.map +1 -1
- package/dist/profiles/profiles.d.ts.map +1 -1
- package/dist/profiles/profiles.js +3 -2
- package/dist/profiles/profiles.js.map +1 -1
- package/dist/profiles/report.d.ts +1 -1
- package/dist/profiles/report.d.ts.map +1 -1
- package/dist/profiles/report.js +146 -31
- package/dist/profiles/report.js.map +1 -1
- package/dist/profiles/verify.d.ts.map +1 -1
- package/dist/profiles/verify.js +17 -8
- package/dist/profiles/verify.js.map +1 -1
- package/dist/proof/verify.d.ts.map +1 -1
- package/dist/proof/verify.js +16 -2
- package/dist/proof/verify.js.map +1 -1
- package/dist/signing.d.ts.map +1 -1
- package/dist/signing.js +11 -1
- package/dist/signing.js.map +1 -1
- package/llms-full.txt +61 -6
- package/llms.txt +12 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -302,7 +302,7 @@ It returns `{ valid, circleSize, threshold, distinctSigners, subjectInRing, inde
|
|
|
302
302
|
|----------|---------|
|
|
303
303
|
| `createCircleManifest(options)` | Required: `issuedAt`, `members`, `name`, `profileIds`, `purpose`. Optional: `expiresAt`, `status` (`'active' \| 'revoked' \| 'superseded'`), `supersedes`, `revokedCircleIds`, `contact`, `evidenceProcess`, `policyUri` |
|
|
304
304
|
| `verifyCircleManifest(manifest, options?)` | `allowSuperseded`, `now`, `profileId`, `revokedCircleIds` |
|
|
305
|
-
| `createDeploymentPolicy(profile, options)` | Required: `expectedSubject`, plus at least one active circle from `acceptedCircleIds` or `circleManifests`. Optional: `expectedSubjectTagValue`, `id` (default: the profile id), `maxAgeSeconds` and `minDistinctSigners` (default: the profile's), `metricPolicies` (`{ [metric]: { required?, min?, max?, integer? } }`, bounds on the published aggregate), `aggregate` (default: the profile's), `contributionBounds` (`{ [metric]: { min?, max?, integer?, required? } }`, bounds on each contribution, replacing the profile's for that metric), `rejectUnknownMetrics` (default `false`), `requireNostrSignature` (default `false`), `companionEvidence`, `allowSupersededCircleIds` (default `false`), `now` |
|
|
305
|
+
| `createDeploymentPolicy(profile, options)` | Required: `expectedSubject`, plus at least one active circle from `acceptedCircleIds` or `circleManifests`. Optional: `expectedSubjectTagValue`, `id` (default: the profile id), `maxAgeSeconds` and `minDistinctSigners` (default: the profile's), `metricPolicies` (`{ [metric]: { required?, min?, max?, integer? } }`, bounds on the published aggregate), `aggregate` (default: the profile's), `contributionBounds` (`{ [metric]: { min?, max?, integer?, required? } }`, bounds on each contribution, replacing the profile's for that metric), `rejectUnknownMetrics` (default `false`), `requireNostrSignature` (default `false`), `acceptedPublishers` (hex pubkeys that may sign the assertion events; naming any turns `requireNostrSignature` on), `companionEvidence`, `allowSupersededCircleIds` (default `false`), `now` |
|
|
306
306
|
| `createSignedDeploymentBundle(policy, options)` | Required: `id`, `issuedAt`, `privateKey` (hex). Optional: `expiresAt` (must be greater than `issuedAt`). Returns a frozen bundle carrying the `signer` pubkey and `signature` |
|
|
307
307
|
| `verifyUseCaseProfile(events, profile, options?)` | `acceptedCircleIds`, `aggregate`, `aggregateFn`, `contributionBounds`, `expectedSubject`, `expectedSubjectTagValue`, `maxAgeSeconds`, `minDistinctSigners`, `now`, `requireKnownCircle` (fails when no accepted circle is supplied unless set to `false`) |
|
|
308
308
|
| `verifyDeploymentPolicy(events, policy, options?)` | `aggregateFn`, `companionEvidence` (the supplied `CompanionEvidence[]`), `now` |
|
|
@@ -314,6 +314,8 @@ It returns `{ valid, circleSize, threshold, distinctSigners, subjectInRing, inde
|
|
|
314
314
|
|
|
315
315
|
Every built-in profile pins the aggregate function: `median`, and `sum` for `anonymous-group-decisions`, which also bounds each ballot to 0 or 1. The profile verifiers reject an event published under any other function (issue code `proof.aggregate_mismatch`) or holding a contribution outside the bounds (`proof.contribution_out_of_bounds`). To publish under another function, say so in the policy (`aggregate: 'mean'`) and bound each contribution. A custom profile sets `aggregate` and, per metric, `contribution: { min, max, integer }`; `validateUseCaseProfileDefinition` warns when either is missing. A signed bundle embeds the profile it was issued with, so a bundle issued by an earlier release does not carry these checks: re-issue it.
|
|
316
316
|
|
|
317
|
+
A proof does not say who published it, or when. The ring signatures are public and carry no time, so anyone can republish a favourable subset of them, or an old proof under a new `created_at`, with their own key; `maxAgeSeconds` reads the timestamp that key set. Where the circle has a designated publisher, name it: `acceptedPublishers: [aggregator.pubkey]` in `createDeploymentPolicy`. The policy then checks every event's Nostr signature and rejects an event signed by any other key (issue code `event.publisher_unaccepted`). `createDeploymentPolicy` throws on an empty or malformed list, and a policy read from a bundle with one rejects every event (`policy.accepted_publishers_invalid`). A named publisher is still trusted to include every signature it was given, and a relay can still serve that publisher's earlier event for as long as the freshness window allows. The list is not `trustedPublishers`, which names who may sign a deployment bundle. A verifier on an earlier release ignores the field in a bundle.
|
|
318
|
+
|
|
317
319
|
### Profiles example
|
|
318
320
|
|
|
319
321
|
A production verifier pins the operator's publisher pubkey, loads a signed deployment bundle, and checks fetched assertions against it. This continues from the quick start (`alice`, `bob`, `carol`, `circle`, `subjectPubkey`, `aggregator`). The built-in `USER_REPUTATION_ABUSE_REPORTING_PROFILE` (id `user-reputation-abuse-reporting`) requires proof v2, the median aggregate, at least three distinct signers, and an assertion no older than 300 seconds, so the contributions below are v2 and all three members sign.
|
|
@@ -341,7 +343,8 @@ const event = signEvent(
|
|
|
341
343
|
const policy = createDeploymentPolicy(USER_REPUTATION_ABUSE_REPORTING_PROFILE, {
|
|
342
344
|
acceptedCircleIds: [circle.circleId],
|
|
343
345
|
expectedSubject: subjectPubkey,
|
|
344
|
-
|
|
346
|
+
acceptedPublishers: [aggregator.pubkey], // nobody else may republish the circle's signatures
|
|
347
|
+
requireNostrSignature: true, // verifyProductionDeployment needs this; naming acceptedPublishers also turns it on
|
|
345
348
|
})
|
|
346
349
|
const now = Math.floor(Date.now() / 1000)
|
|
347
350
|
const bundle = createSignedDeploymentBundle(policy, {
|
|
@@ -356,7 +359,7 @@ const verdict = verifyProductionDeployment([event], bundle, { trustedPublishers:
|
|
|
356
359
|
// verdict.decision === 'accept', verdict.valid === true, verdict.errors === []
|
|
357
360
|
```
|
|
358
361
|
|
|
359
|
-
A bundle signed by any other key fails with the issue code `bundle.signer_untrusted`. For the other built-in profiles, companion evidence and the report helpers, see [examples/production-recipes.ts](./examples/production-recipes.ts), which runs six production-shaped gates (`npm run test:production-recipes`).
|
|
362
|
+
A bundle signed by any other key fails with the issue code `bundle.signer_untrusted`, and an event signed by any key but the aggregator's fails with `event.publisher_unaccepted`. For the other built-in profiles, companion evidence and the report helpers, see [examples/production-recipes.ts](./examples/production-recipes.ts), which runs six production-shaped gates (`npm run test:production-recipes`).
|
|
360
363
|
|
|
361
364
|
---
|
|
362
365
|
|
|
@@ -370,14 +373,14 @@ nostr-veil assert event <event-id> [--json '<metrics>']
|
|
|
370
373
|
nostr-veil assert address <address> [--json '<metrics>']
|
|
371
374
|
nostr-veil assert identifier <id> <k-tag> [--json '<metrics>']
|
|
372
375
|
nostr-veil provider-declare [--json '<entries>']
|
|
373
|
-
nostr-veil verify '<event-json>' [--kind <n>]
|
|
376
|
+
nostr-veil verify '<event-json>' [--kind <n>] [--aggregate <fn>]
|
|
374
377
|
nostr-veil --help
|
|
375
378
|
```
|
|
376
379
|
|
|
377
380
|
- `assert` builds a plain NIP-85 assertion (kind 30382, 30383, 30384 or 30385 respectively) and signs it with one key. It does not make ring signatures; use the library for that. `--json` takes a JSON object of metrics, for example `--json '{"rank":74}'`. Without it the metrics are empty.
|
|
378
381
|
- `provider-declare` builds and signs a kind 10040 provider declaration. `--json` takes a JSON array of `{ kind, metric, servicePubkey, relayHint }` entries.
|
|
379
382
|
- `assert` and `provider-declare` read the signing key from `NOSTR_SECRET_KEY` (64-char hex) or from the file named by `NOSTR_SECRET_KEY_FILE`, which takes precedence. They print the signed event as JSON on stdout, ready to pipe to a relay publisher.
|
|
380
|
-
- `verify` needs no key. `<event-json>` is the event itself as an inline JSON string, not a file path
|
|
383
|
+
- `verify` needs no key. `<event-json>` is the event itself as an inline JSON string, not a file path (for a file use `nostr-veil verify "$(cat event.json)" --kind 30382`). The event must be a JSON object with a `tags` array. `--kind <n>` takes a non-negative integer and applies the `expectedKind` check; it is recommended for v1 proofs. `--aggregate <fn>` takes `median`, `mean`, `sum`, `min` or `max` and applies the `requireAggregate` check. Without it `verify` accepts whichever function the event names, and the publisher chooses that, so the same signatures also verify as a `max` or a `min`. An option may come before or after the event, written `--kind 30382` or `--kind=30382`. An option `verify` does not know, or one given twice, is an error: both options make the check stricter, so a mistyped one is never dropped in silence.
|
|
381
384
|
- `verify` prints the `verifyProof` result as JSON. It exits 0 even when `valid` is `false`, and exits 1 only for bad arguments or unparseable JSON, so read the `valid` field rather than the exit code.
|
|
382
385
|
|
|
383
386
|
---
|
|
@@ -477,12 +480,16 @@ application control:
|
|
|
477
480
|
conflict rules for circles that drive real decisions.
|
|
478
481
|
- A shared federation `scope` intentionally reveals cross-circle overlap by key
|
|
479
482
|
image; use scoped federation only when deduplication is worth that signal.
|
|
480
|
-
- The publisher chooses the aggregate function
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
`
|
|
484
|
-
|
|
485
|
-
|
|
483
|
+
- The publisher chooses the aggregate function, which signatures to include and
|
|
484
|
+
the event's `created_at`. The circle signs none of the three, and the
|
|
485
|
+
signatures are public. Anyone can republish a subset of them, the same set as
|
|
486
|
+
a `max` or a `min`, or an old proof under a new timestamp, with their own key.
|
|
487
|
+
Pin the function with `requireAggregate` (the built-in profiles do), set the
|
|
488
|
+
signer threshold to a turnout that matters for the circle, and where the
|
|
489
|
+
circle has a designated publisher name its key in the deployment policy
|
|
490
|
+
(`acceptedPublishers`). A named publisher is still trusted to include every
|
|
491
|
+
signature, and a relay can still serve its earlier event for as long as the
|
|
492
|
+
freshness window allows.
|
|
486
493
|
- A key image stops a member contributing twice, not contributing one large
|
|
487
494
|
value. Under `sum`, `mean`, `min` or `max`, bound each contribution with
|
|
488
495
|
`contributionBounds`.
|
|
@@ -505,13 +512,24 @@ and rotated.
|
|
|
505
512
|
Production verifiers should prefer `verifyProductionDeployment()` over manually
|
|
506
513
|
composing lower-level checks. It returns the existing human-readable `errors`
|
|
507
514
|
plus stable `issues[].code` values such as `bundle.signer_untrusted`,
|
|
508
|
-
`event.signature_invalid`, `
|
|
515
|
+
`event.signature_invalid`, `event.publisher_unaccepted`, `circle.unaccepted`,
|
|
516
|
+
and `metric.below_min`. Use
|
|
509
517
|
`explainVerificationIssue()` or `remediationForIssue()` to show the exact
|
|
510
518
|
operator action for each failure. For application UI, audit logs, and support
|
|
511
519
|
runbooks, `verifyProductionDeploymentReport()` returns the same decision with a
|
|
512
520
|
recommended action, expanded issue remediations, and pass/fail/not-checked
|
|
513
521
|
status for the production controls.
|
|
514
522
|
|
|
523
|
+
A bundle's policy is applied only when the bundle is authentic: validly signed
|
|
524
|
+
by a key in `trustedPublishers`. For any other bundle the decision is `reject`,
|
|
525
|
+
no assertion is verified against its policy, and the report shows the policy
|
|
526
|
+
controls as `not-checked` and leaves the profile, the policy id and the subject
|
|
527
|
+
blank. Events, bundles and admission presentations can come
|
|
528
|
+
from anyone. A malformed event, or a malformed bundle that is not authentic, is
|
|
529
|
+
rejected with an issue code, and a malformed presentation is denied with an
|
|
530
|
+
error. No verifier throws on any of them. That does not cover a bundle you
|
|
531
|
+
signed yourself with a malformed policy inside: check what you sign.
|
|
532
|
+
|
|
515
533
|
---
|
|
516
534
|
|
|
517
535
|
## Use cases
|
package/bin/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
buildProviderDeclaration,
|
|
11
11
|
} from '../dist/nip85/builders.js'
|
|
12
12
|
import { verifyProof } from '../dist/proof/verify.js'
|
|
13
|
+
import { AGGREGATES, isAggregateName } from '../dist/proof/aggregate.js'
|
|
13
14
|
|
|
14
15
|
const USAGE = `nostr-veil — anonymous trust assertions for Nostr
|
|
15
16
|
|
|
@@ -19,9 +20,14 @@ Usage:
|
|
|
19
20
|
nostr-veil assert address <address> [--json metrics] Build kind 30384 addressable assertion
|
|
20
21
|
nostr-veil assert identifier <id> <k-tag> [--json metrics] Build kind 30385 identifier assertion
|
|
21
22
|
nostr-veil provider-declare [--json entries] Build kind 10040 provider declaration
|
|
22
|
-
nostr-veil verify <event-json> [--kind n]
|
|
23
|
+
nostr-veil verify <event-json> [--kind n] [--aggregate fn]
|
|
24
|
+
Verify veil ring proof, print result
|
|
23
25
|
(--kind binds the expected NIP-85 kind; recommended
|
|
24
|
-
for v1 proofs, which are not kind-bound
|
|
26
|
+
for v1 proofs, which are not kind-bound.
|
|
27
|
+
--aggregate requires that aggregate function: median,
|
|
28
|
+
mean, sum, min or max. The publisher chooses it and
|
|
29
|
+
the circle does not sign it, so without the flag the
|
|
30
|
+
same signatures also verify as a max or a min)
|
|
25
31
|
nostr-veil --help Show this message
|
|
26
32
|
|
|
27
33
|
Environment:
|
|
@@ -105,29 +111,79 @@ function cmdProviderDeclare(args) {
|
|
|
105
111
|
console.log(JSON.stringify(signed, null, 2))
|
|
106
112
|
}
|
|
107
113
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
114
|
+
const VERIFY_OPTIONS = new Set(['--kind', '--aggregate'])
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Split verify's arguments into the event JSON and its options. Every argument
|
|
118
|
+
* has to be accounted for: both options make the check stricter, so one that
|
|
119
|
+
* was mistyped and dropped in silence would let the proof verify without the
|
|
120
|
+
* check the caller asked for. An option is `--name value` or `--name=value`,
|
|
121
|
+
* before or after the event.
|
|
122
|
+
*/
|
|
123
|
+
function parseVerifyArgs(args) {
|
|
124
|
+
const options = new Map()
|
|
125
|
+
const positionals = []
|
|
126
|
+
for (let i = 0; i < args.length; i++) {
|
|
127
|
+
const arg = args[i]
|
|
128
|
+
// An event is a JSON object, so nothing that starts with a dash is one
|
|
129
|
+
if (!arg.startsWith('-')) {
|
|
130
|
+
positionals.push(arg)
|
|
131
|
+
continue
|
|
132
|
+
}
|
|
133
|
+
const equals = arg.indexOf('=')
|
|
134
|
+
const name = equals === -1 ? arg : arg.slice(0, equals)
|
|
135
|
+
if (!VERIFY_OPTIONS.has(name)) {
|
|
136
|
+
console.error(`Error: unknown option ${name}. Run nostr-veil --help for usage.`)
|
|
137
|
+
process.exit(1)
|
|
138
|
+
}
|
|
139
|
+
if (options.has(name)) {
|
|
140
|
+
console.error(`Error: ${name} given more than once`)
|
|
141
|
+
process.exit(1)
|
|
142
|
+
}
|
|
143
|
+
// The value is undefined when the option came last with no value
|
|
144
|
+
options.set(name, equals === -1 ? args[++i] : arg.slice(equals + 1))
|
|
115
145
|
}
|
|
116
|
-
|
|
117
|
-
if (
|
|
118
|
-
console.error(
|
|
146
|
+
|
|
147
|
+
if (positionals.length > 1) {
|
|
148
|
+
console.error(`Error: verify takes one <event-json>, not ${positionals.length}`)
|
|
119
149
|
process.exit(1)
|
|
120
150
|
}
|
|
121
|
-
|
|
151
|
+
|
|
152
|
+
let expectedKind
|
|
153
|
+
if (options.has('--kind')) {
|
|
154
|
+
const value = options.get('--kind')
|
|
155
|
+
if (value === undefined) {
|
|
156
|
+
console.error('Error: --kind requires a value')
|
|
157
|
+
process.exit(1)
|
|
158
|
+
}
|
|
159
|
+
// Decimal digits only: Number() also reads '', ' ', '0x10' and '3e4' as integers
|
|
160
|
+
if (!/^(0|[1-9]\d*)$/.test(value) || !Number.isSafeInteger(Number(value))) {
|
|
161
|
+
console.error('Error: --kind must be a non-negative integer')
|
|
162
|
+
process.exit(1)
|
|
163
|
+
}
|
|
164
|
+
expectedKind = Number(value)
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
let requireAggregate
|
|
168
|
+
if (options.has('--aggregate')) {
|
|
169
|
+
const name = options.get('--aggregate')
|
|
170
|
+
if (name === undefined || !isAggregateName(name)) {
|
|
171
|
+
const names = Object.keys(AGGREGATES)
|
|
172
|
+
console.error(`Error: --aggregate must be one of ${names.slice(0, -1).join(', ')} or ${names.at(-1)}`)
|
|
173
|
+
process.exit(1)
|
|
174
|
+
}
|
|
175
|
+
requireAggregate = name
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
return { eventJson: positionals[0], expectedKind, requireAggregate }
|
|
122
179
|
}
|
|
123
180
|
|
|
124
181
|
function cmdVerify(args) {
|
|
125
|
-
const eventJson = args
|
|
182
|
+
const { eventJson, expectedKind, requireAggregate } = parseVerifyArgs(args)
|
|
126
183
|
if (!eventJson) {
|
|
127
184
|
console.error('Error: verify requires <event-json>')
|
|
128
185
|
process.exit(1)
|
|
129
186
|
}
|
|
130
|
-
const expectedKind = extractKindFlag(args)
|
|
131
187
|
|
|
132
188
|
let event
|
|
133
189
|
try {
|
|
@@ -140,7 +196,12 @@ function cmdVerify(args) {
|
|
|
140
196
|
console.error('Error: event must be a JSON object with a "tags" array')
|
|
141
197
|
process.exit(1)
|
|
142
198
|
}
|
|
143
|
-
const
|
|
199
|
+
const options = {
|
|
200
|
+
...(expectedKind === undefined ? {} : { expectedKind }),
|
|
201
|
+
...(requireAggregate === undefined ? {} : { requireAggregate }),
|
|
202
|
+
}
|
|
203
|
+
// With neither flag the call is the same bare verifyProof(event) as before
|
|
204
|
+
const result = verifyProof(event, Object.keys(options).length === 0 ? undefined : options)
|
|
144
205
|
console.log(JSON.stringify(result, null, 2))
|
|
145
206
|
}
|
|
146
207
|
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What can safely be done with a value that came from outside. An event
|
|
3
|
+
* arrives from a relay as JSON, so it can be anything: no tags, tags that are
|
|
4
|
+
* not a list, a tag that is not a list, a tag whose name is a number, a value
|
|
5
|
+
* that is an object where a string belongs. Three things go wrong when code
|
|
6
|
+
* uses such a value without looking:
|
|
7
|
+
*
|
|
8
|
+
* - reading a property of it throws when it is `null`;
|
|
9
|
+
* - calling a string or list method on it throws when it is something else;
|
|
10
|
+
* - turning it into a string or a number throws when it is an object whose
|
|
11
|
+
* `toString` is not a function, which JSON can carry (`{"toString":1}`), and
|
|
12
|
+
* overflows the stack when it is a list nested thousands deep. A template, a
|
|
13
|
+
* comparison with `<`, `Number()`, `String()` and `RegExp.test()` all do
|
|
14
|
+
* that conversion.
|
|
15
|
+
*
|
|
16
|
+
* This is the one definition of what is safe to read. Each layer consults it
|
|
17
|
+
* before its own reads. It is internal: not exported from the package.
|
|
18
|
+
*/
|
|
19
|
+
/** Reported for an event that is not an object, or whose tags are not a list. */
|
|
20
|
+
export declare const MALFORMED_EVENT = "Malformed event: tags must be an array.";
|
|
21
|
+
/** Reported for a tag that is not a list, or whose first element, its name, is not a string. */
|
|
22
|
+
export declare const MALFORMED_TAG = "Malformed tag: every tag must be an array whose name is a string.";
|
|
23
|
+
/** A tag is well formed when it is a list whose first element, its name, is a string. */
|
|
24
|
+
export declare function isWellFormedTag(tag: unknown): tag is [string, ...unknown[]];
|
|
25
|
+
/** A tag is readable when it is a non-empty list of strings, which is all NIP-01 allows it to be. */
|
|
26
|
+
export declare function isReadableTag(tag: unknown): tag is string[];
|
|
27
|
+
/**
|
|
28
|
+
* The event with only its readable tags, for code that reads tag names and
|
|
29
|
+
* values after the syntax check has reported the rest. An event that is not an
|
|
30
|
+
* object, or has no list of tags, reads as one with no tags. An event whose
|
|
31
|
+
* tags are all readable comes back as it is.
|
|
32
|
+
*/
|
|
33
|
+
export declare function readableEvent<T extends {
|
|
34
|
+
tags: string[][];
|
|
35
|
+
}>(event: T): T;
|
|
36
|
+
/** True when nothing was left out of {@link readableEvent}: the event is an object and every tag is readable. */
|
|
37
|
+
export declare function isFullyReadable(event: unknown): boolean;
|
|
38
|
+
/**
|
|
39
|
+
* A value for an error message. A template would convert it to a string, which
|
|
40
|
+
* throws or overflows on the objects described above, so an object is named by
|
|
41
|
+
* what it is and never converted. A plain object reads as it always did in
|
|
42
|
+
* these messages.
|
|
43
|
+
*/
|
|
44
|
+
export declare function shown(value: unknown): string;
|
|
45
|
+
/**
|
|
46
|
+
* The number a value stands for, or `NaN`. `Number()` converts an object
|
|
47
|
+
* through its `toString`, with the same two hazards, and reads a one-element
|
|
48
|
+
* list as its element; an object is no number at all.
|
|
49
|
+
*/
|
|
50
|
+
export declare function numberFrom(value: unknown): number;
|
|
51
|
+
/** Test a pattern against a value only when it is a string. `RegExp.test` converts anything else first. */
|
|
52
|
+
export declare function matches(pattern: RegExp, value: unknown): value is string;
|
|
53
|
+
//# sourceMappingURL=shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.d.ts","sourceRoot":"","sources":["../../src/nip85/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,eAAO,MAAM,eAAe,4CAA4C,CAAA;AAExE,gGAAgG;AAChG,eAAO,MAAM,aAAa,sEAAsE,CAAA;AAEhG,yFAAyF;AACzF,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC,CAE3E;AAED,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,GAAG,EAAE,OAAO,GAAG,GAAG,IAAI,MAAM,EAAE,CAE3D;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,CAAC,SAAS;IAAE,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAKzE;AAED,iHAAiH;AACjH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIvD;AAED;;;;;GAKG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAG5C;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAEjD;AAED,2GAA2G;AAC3G,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,MAAM,CAExE"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What can safely be done with a value that came from outside. An event
|
|
3
|
+
* arrives from a relay as JSON, so it can be anything: no tags, tags that are
|
|
4
|
+
* not a list, a tag that is not a list, a tag whose name is a number, a value
|
|
5
|
+
* that is an object where a string belongs. Three things go wrong when code
|
|
6
|
+
* uses such a value without looking:
|
|
7
|
+
*
|
|
8
|
+
* - reading a property of it throws when it is `null`;
|
|
9
|
+
* - calling a string or list method on it throws when it is something else;
|
|
10
|
+
* - turning it into a string or a number throws when it is an object whose
|
|
11
|
+
* `toString` is not a function, which JSON can carry (`{"toString":1}`), and
|
|
12
|
+
* overflows the stack when it is a list nested thousands deep. A template, a
|
|
13
|
+
* comparison with `<`, `Number()`, `String()` and `RegExp.test()` all do
|
|
14
|
+
* that conversion.
|
|
15
|
+
*
|
|
16
|
+
* This is the one definition of what is safe to read. Each layer consults it
|
|
17
|
+
* before its own reads. It is internal: not exported from the package.
|
|
18
|
+
*/
|
|
19
|
+
/** Reported for an event that is not an object, or whose tags are not a list. */
|
|
20
|
+
export const MALFORMED_EVENT = 'Malformed event: tags must be an array.';
|
|
21
|
+
/** Reported for a tag that is not a list, or whose first element, its name, is not a string. */
|
|
22
|
+
export const MALFORMED_TAG = 'Malformed tag: every tag must be an array whose name is a string.';
|
|
23
|
+
/** A tag is well formed when it is a list whose first element, its name, is a string. */
|
|
24
|
+
export function isWellFormedTag(tag) {
|
|
25
|
+
return Array.isArray(tag) && typeof tag[0] === 'string';
|
|
26
|
+
}
|
|
27
|
+
/** A tag is readable when it is a non-empty list of strings, which is all NIP-01 allows it to be. */
|
|
28
|
+
export function isReadableTag(tag) {
|
|
29
|
+
return Array.isArray(tag) && tag.length > 0 && tag.every(element => typeof element === 'string');
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The event with only its readable tags, for code that reads tag names and
|
|
33
|
+
* values after the syntax check has reported the rest. An event that is not an
|
|
34
|
+
* object, or has no list of tags, reads as one with no tags. An event whose
|
|
35
|
+
* tags are all readable comes back as it is.
|
|
36
|
+
*/
|
|
37
|
+
export function readableEvent(event) {
|
|
38
|
+
if (event === null || typeof event !== 'object')
|
|
39
|
+
return { tags: [] };
|
|
40
|
+
const tags = event.tags;
|
|
41
|
+
if (!Array.isArray(tags))
|
|
42
|
+
return { ...event, tags: [] };
|
|
43
|
+
return tags.every(isReadableTag) ? event : { ...event, tags: tags.filter(isReadableTag) };
|
|
44
|
+
}
|
|
45
|
+
/** True when nothing was left out of {@link readableEvent}: the event is an object and every tag is readable. */
|
|
46
|
+
export function isFullyReadable(event) {
|
|
47
|
+
if (event === null || typeof event !== 'object')
|
|
48
|
+
return false;
|
|
49
|
+
const tags = event.tags;
|
|
50
|
+
return Array.isArray(tags) && tags.every(isReadableTag);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A value for an error message. A template would convert it to a string, which
|
|
54
|
+
* throws or overflows on the objects described above, so an object is named by
|
|
55
|
+
* what it is and never converted. A plain object reads as it always did in
|
|
56
|
+
* these messages.
|
|
57
|
+
*/
|
|
58
|
+
export function shown(value) {
|
|
59
|
+
if (value === null || typeof value !== 'object')
|
|
60
|
+
return String(value);
|
|
61
|
+
return Array.isArray(value) ? '[list]' : '[object Object]';
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* The number a value stands for, or `NaN`. `Number()` converts an object
|
|
65
|
+
* through its `toString`, with the same two hazards, and reads a one-element
|
|
66
|
+
* list as its element; an object is no number at all.
|
|
67
|
+
*/
|
|
68
|
+
export function numberFrom(value) {
|
|
69
|
+
return value !== null && typeof value === 'object' ? Number.NaN : Number(value);
|
|
70
|
+
}
|
|
71
|
+
/** Test a pattern against a value only when it is a string. `RegExp.test` converts anything else first. */
|
|
72
|
+
export function matches(pattern, value) {
|
|
73
|
+
return typeof value === 'string' && pattern.test(value);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=shape.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shape.js","sourceRoot":"","sources":["../../src/nip85/shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,iFAAiF;AACjF,MAAM,CAAC,MAAM,eAAe,GAAG,yCAAyC,CAAA;AAExE,gGAAgG;AAChG,MAAM,CAAC,MAAM,aAAa,GAAG,mEAAmE,CAAA;AAEhG,yFAAyF;AACzF,MAAM,UAAU,eAAe,CAAC,GAAY;IAC1C,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,CAAC,CAAC,CAAC,K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AA;IACrE,OAAO,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,iBAAiB,CAAA;AAC5D,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAc;IACvC,OAAO,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;AACjF,CAAC;AAED,2GAA2G;AAC3G,MAAM,UAAU,OAAO,CAAC,OAAe,EAAE,KAAc;IACrD,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACzD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/nip85/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"validators.d.ts","sourceRoot":"","sources":["../../src/nip85/validators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAYlD,UAAU,QAAQ;IAChB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,EAAE,EAAE,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AA0ND;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,QAAQ,EAAE,OAAO,GAAE,iBAAsB,GAAG,gBAAgB,CA4CpG;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,QAAQ,GAAG,gBAAgB,CAEzE;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAAC,KAAK,EAAE,QAAQ,GAAG,gBAAgB,CAwDnF"}
|
package/dist/nip85/validators.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MALFORMED_EVENT, MALFORMED_TAG, isWellFormedTag, matches, numberFrom, shown } from './shape.js';
|
|
1
2
|
import { NIP85_KINDS } from './types.js';
|
|
2
3
|
import { GENERAL_TAGS, isUnixSecondsTagValue } from './tags.js';
|
|
3
4
|
const ASSERTION_KINDS = new Set([
|
|
@@ -64,9 +65,11 @@ function isFiniteNumberTag(value) {
|
|
|
64
65
|
return Number.isFinite(Number(value));
|
|
65
66
|
}
|
|
66
67
|
function validateLooseRank(value, errors) {
|
|
67
|
-
|
|
68
|
+
// Not Number() and not a template on the value as it stands: a tag value
|
|
69
|
+
// from a relay can be an object, and converting one can throw
|
|
70
|
+
const rankValue = numberFrom(value);
|
|
68
71
|
if (isNaN(rankValue) || rankValue < 0 || rankValue > 100) {
|
|
69
|
-
errors.push(`Invalid rank value: "${value}". Must be a number between 0 and 100.`);
|
|
72
|
+
errors.push(`Invalid rank value: "${shown(value)}". Must be a number between 0 and 100.`);
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
function validateStrictRank(value, errors) {
|
|
@@ -162,7 +165,7 @@ function validateStrictGeneralTags(event, errors) {
|
|
|
162
165
|
}
|
|
163
166
|
const value = expirations[0][1];
|
|
164
167
|
if (!isUnixSecondsTagValue(value)) {
|
|
165
|
-
errors.push(`Invalid expiration-tag: "${value}". Must be a unix timestamp in seconds.`);
|
|
168
|
+
errors.push(`Invalid expiration-tag: "${shown(value)}". Must be a unix timestamp in seconds.`);
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
171
|
function validateStrictMetrics(event, errors) {
|
|
@@ -191,6 +194,13 @@ function validateStrictMetrics(event, errors) {
|
|
|
191
194
|
errors.push(`Metric "${name}" is missing a value.`);
|
|
192
195
|
continue;
|
|
193
196
|
}
|
|
197
|
+
// A tag value from a relay need not be a string. Both checks below call a
|
|
198
|
+
// string method on it, and would throw on a number where they should
|
|
199
|
+
// report it.
|
|
200
|
+
if (allowed.numeric.has(name) && typeof tag[1] !== 'string') {
|
|
201
|
+
errors.push(`Metric "${name}" must be a string.`);
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
194
204
|
if (name === 'rank') {
|
|
195
205
|
validateStrictRank(tag[1], errors);
|
|
196
206
|
}
|
|
@@ -226,15 +236,15 @@ export function validateAssertion(input, options = {}) {
|
|
|
226
236
|
const errors = [];
|
|
227
237
|
// Fail closed rather than throw on relay-supplied junk: drop malformed tags and report them
|
|
228
238
|
if (input === null || typeof input !== 'object' || !Array.isArray(input.tags)) {
|
|
229
|
-
return { valid: false, errors: [
|
|
239
|
+
return { valid: false, errors: [MALFORMED_EVENT] };
|
|
230
240
|
}
|
|
231
|
-
const wellFormed = input.tags.filter(
|
|
241
|
+
const wellFormed = input.tags.filter(isWellFormedTag);
|
|
232
242
|
if (wellFormed.length !== input.tags.length) {
|
|
233
|
-
errors.push(
|
|
243
|
+
errors.push(MALFORMED_TAG);
|
|
234
244
|
}
|
|
235
245
|
const event = { kind: input.kind, tags: wellFormed, content: input.content };
|
|
236
246
|
if (!ASSERTION_KINDS.has(event.kind)) {
|
|
237
|
-
errors.push(`Invalid kind: ${event.kind}. Must be one of 30382, 30383, 30384, 30385.`);
|
|
247
|
+
errors.push(`Invalid kind: ${shown(event.kind)}. Must be one of 30382, 30383, 30384, 30385.`);
|
|
238
248
|
}
|
|
239
249
|
const dTag = event.tags.find(t => t[0] === 'd');
|
|
240
250
|
if (!dTag) {
|
|
@@ -247,9 +257,9 @@ export function validateAssertion(input, options = {}) {
|
|
|
247
257
|
// Validate all numeric metric tags are finite numbers
|
|
248
258
|
for (const tag of event.tags) {
|
|
249
259
|
if (LOOSE_NUMERIC_METRICS.has(tag[0]) && tag[0] !== 'rank') {
|
|
250
|
-
const value =
|
|
260
|
+
const value = numberFrom(tag[1]);
|
|
251
261
|
if (!Number.isFinite(value)) {
|
|
252
|
-
errors.push(`Invalid metric "${tag[0]}": "${tag[1]}" is not a finite number.`);
|
|
262
|
+
errors.push(`Invalid metric "${tag[0]}": "${shown(tag[1])}" is not a finite number.`);
|
|
253
263
|
}
|
|
254
264
|
}
|
|
255
265
|
}
|
|
@@ -276,8 +286,12 @@ export function validateAssertionStrict(event) {
|
|
|
276
286
|
*/
|
|
277
287
|
export function validateProviderDeclarationStrict(event) {
|
|
278
288
|
const errors = [];
|
|
289
|
+
// Fail closed rather than throw on relay-supplied junk, as validateAssertion does
|
|
290
|
+
if (event === null || typeof event !== 'object' || !Array.isArray(event.tags)) {
|
|
291
|
+
return { valid: false, errors: [MALFORMED_EVENT] };
|
|
292
|
+
}
|
|
279
293
|
if (event.kind !== NIP85_KINDS.PROVIDER) {
|
|
280
|
-
errors.push(`Invalid kind: ${event.kind}. Must be 10040 for a provider declaration.`);
|
|
294
|
+
errors.push(`Invalid kind: ${shown(event.kind)}. Must be 10040 for a provider declaration.`);
|
|
281
295
|
}
|
|
282
296
|
if (event.content !== '' && event.tags.length === 0) {
|
|
283
297
|
return { valid: errors.length === 0, errors };
|
|
@@ -288,7 +302,7 @@ export function validateProviderDeclarationStrict(event) {
|
|
|
288
302
|
const seen = new Set();
|
|
289
303
|
for (let i = 0; i < event.tags.length; i++) {
|
|
290
304
|
const tag = event.tags[i];
|
|
291
|
-
const name = tag[0];
|
|
305
|
+
const name = Array.isArray(tag) ? tag[0] : undefined;
|
|
292
306
|
if (typeof name !== 'string' || !PROVIDER_TAG_RE.test(name)) {
|
|
293
307
|
errors.push(`Provider tag at index ${i} must use kind:metric format.`);
|
|
294
308
|
continue;
|
|
@@ -301,7 +315,7 @@ export function validateProviderDeclarationStrict(event) {
|
|
|
301
315
|
if (metric === '') {
|
|
302
316
|
errors.push(`Provider tag at index ${i} has an empty metric name.`);
|
|
303
317
|
}
|
|
304
|
-
const key = `${kindText}:${metric}:${tag[1] ?? ''}`;
|
|
318
|
+
const key = `${kindText}:${metric}:${shown(tag[1] ?? '')}`;
|
|
305
319
|
if (seen.has(key)) {
|
|
306
320
|
errors.push(`Duplicate provider declaration for ${kindText}:${metric}.`);
|
|
307
321
|
}
|
|
@@ -311,7 +325,7 @@ export function validateProviderDeclarationStrict(event) {
|
|
|
311
325
|
errors.push(`Provider tag at index ${i} service pubkey must be a 64-character lowercase hex pubkey.`);
|
|
312
326
|
}
|
|
313
327
|
const relayHint = tag[2];
|
|
314
|
-
if (relayHint !== undefined && relayHint !== '' && !RELAY_HINT_RE
|
|
328
|
+
if (relayHint !== undefined && relayHint !== '' && !matches(RELAY_HINT_RE, relayHint)) {
|
|
315
329
|
errors.push(`Provider tag at index ${i} relay hint must be a websocket URL.`);
|
|
316
330
|
}
|
|
317
331
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/nip85/validators.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAA;AAE/D,MAAM,eAAe,GAAG,IAAI,GAAG,CAAS;IACtC,WAAW,CAAC,IAAI;IAChB,WAAW,CAAC,KAAK;IACjB,WAAW,CAAC,WAAW;IACvB,WAAW,CAAC,UAAU;CACvB,CAAC,CAAA;AAgBF,MAAM,QAAQ,GAAG,gBAAgB,CAAA;AACjC,8EAA8E;AAC9E,MAAM,UAAU,GAAG,qBAAqB,CAAA;AACxC,MAAM,UAAU,GAAG,gCAAgC,CAAA;AACnD,MAAM,eAAe,GAAG,gCAAgC,CAAA;AACxD,MAAM,aAAa,GAAG,gBAAgB,CAAA;AACtC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAEpD,MAAM,qBAAqB,GAAG,IAAI,GAAG,CAAC;IAC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sCAAsC,QAAQ,IAAI,MAAM,GAAG,CAAC,CAAA;QAC1E,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QAEb,MAAM,aAAa,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QAC5B,IAAI,OAAO,aAAa,KAAK,QAAQ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;YACvE,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,8DAA8D,CAAC,CAAA;QACvG,CAAC;QAED,MAAM,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC,CAAA;QACxB,IAAI,SAAS,KAAK,SAAS,IAAI,SAAS,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,SAAS,CAAC,EAAE,CAAC;YACtF,MAAM,CAAC,IAAI,CAAC,yBAAyB,CAAC,sCAAsC,CAAC,CAAA;QAC/E,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,MAAM,CAAC,MAAM,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;AAC/C,CAAC"}
|
|
@@ -86,6 +86,6 @@ export declare function createAdmissionChallenge(options: CreateAdmissionChallen
|
|
|
86
86
|
* challenge. It does not modify the NIP-85 vouch assertion.
|
|
87
87
|
*/
|
|
88
88
|
export declare function createAdmissionPresentation(challenge: AdmissionChallenge, privateKey: string, options?: CreateAdmissionPresentationOptions): AdmissionPresentation;
|
|
89
|
-
export declare function verifyAdmissionPresentation(
|
|
89
|
+
export declare function verifyAdmissionPresentation(givenPresentation: AdmissionPresentation, givenChallenge: AdmissionChallenge, options?: VerifyAdmissionPresentationOptions): AdmissionPresentationVerification;
|
|
90
90
|
export declare function verifyAdmissionRequest(events: EventTemplate | readonly EventTemplate[], bundle: SignedDeploymentBundle, challenge: AdmissionChallenge, presentation: AdmissionPresentation, options?: VerifyAdmissionRequestOptions): AdmissionRequestVerification;
|
|
91
91
|
//# sourceMappingURL=admission.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admission.d.ts","sourceRoot":"","sources":["../../src/profiles/admission.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"admission.d.ts","sourceRoot":"","sources":["../../src/profiles/admission.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACtD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAA;AACzD,OAAO,KAAK,EAAE,gCAAgC,EAAE,iCAAiC,EAAE,MAAM,iBAAiB,CAAA;AAE1G,eAAO,MAAM,wBAAwB,mCAAmC,CAAA;AACxE,eAAO,MAAM,2BAA2B,sCAAsC,CAAA;AAE9E,MAAM,MAAM,iBAAiB,GAAG,OAAO,GAAG,eAAe,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,CAAA;AAE5F,MAAM,WAAW,yBAAyB;IACxC,OAAO,EAAE,CAAC,CAAA;IACV,IAAI,EAAE,OAAO,wBAAwB,CAAA;IACrC,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;CACd;AAED,MAAM,WAAW,kBAAmB,SAAQ,yBAAyB;IACnE,EAAE,EAAE,MAAM,CAAA;CACX;AAED,MAAM,WAAW,+BAA+B;IAC9C,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,4BAA4B;IAC3C,OAAO,EAAE,CAAC,CAAA;IACV,IAAI,EAAE,OAAO,2BAA2B,CAAA;IACxC,eAAe,EAAE,MA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