@metalabel/dfos-protocol 0.50.0 → 0.52.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 +8 -11
- package/dist/chain/index.d.ts +71 -23
- package/dist/chain/index.js +7 -5
- package/dist/{chunk-IDVYITX7.js → chunk-F7RHI2CK.js} +9 -1
- package/dist/{chunk-MHSBBYDO.js → chunk-IV3TIYKP.js} +28 -19
- package/dist/{chunk-JGFFADPR.js → chunk-OU2DPHCN.js} +128 -51
- package/dist/{chunk-JVSC67DC.js → chunk-QRCOMLAP.js} +4 -9
- package/dist/{chunk-4LG2GEB2.js → chunk-QTJZGXMH.js} +140 -25
- package/dist/credentials/index.d.ts +21 -20
- package/dist/credentials/index.js +3 -3
- package/dist/crypto/index.d.ts +23 -1
- package/dist/crypto/index.js +3 -1
- package/dist/{dfos-credential-BtiYPqBT.d.ts → dfos-credential-j-kHtFvG.d.ts} +73 -21
- package/dist/index.d.ts +3 -3
- package/dist/index.js +9 -5
- package/dist/key-proof/index.d.ts +14 -13
- package/dist/key-proof/index.js +3 -3
- package/package.json +1 -1
- package/schemas/credit-claim.v1.json +1 -1
- package/schemas/post.v1.json +1 -1
|
@@ -43,7 +43,7 @@ declare const isCanonicalRoleSet: (value: string) => boolean;
|
|
|
43
43
|
declare const roleSetCovers: (value: string, role: KeyRole) => boolean;
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* The
|
|
46
|
+
* The registered key-proof purpose in PROTOCOL.md, The envelope: the candidate
|
|
47
47
|
* key presents for addition to a ceremony-named identity's `authKeys`/
|
|
48
48
|
* `assertKeys` sets.
|
|
49
49
|
*
|
|
@@ -57,7 +57,7 @@ declare const KEY_ADD_JWS_TYP = "did:dfos:key-add";
|
|
|
57
57
|
declare const MAX_KEY_PROOF_SIZE = 4096;
|
|
58
58
|
/**
|
|
59
59
|
* RECOMMENDED acceptance window, in seconds, EITHER SIDE of the verifier's clock
|
|
60
|
-
* — matching a ceremony's own lifetime (
|
|
60
|
+
* — matching a ceremony's own lifetime (INTEGRATIONS.md, Presentation verification).
|
|
61
61
|
*/
|
|
62
62
|
declare const DEFAULT_KEY_PROOF_SKEW_SECONDS = 300;
|
|
63
63
|
/**
|
|
@@ -146,8 +146,8 @@ interface SignKeyProofInput {
|
|
|
146
146
|
* through `createJws`, whose `JwsHeader` requires a `kid` this envelope must not
|
|
147
147
|
* carry.
|
|
148
148
|
*
|
|
149
|
-
* HOLDER OBLIGATIONS THIS FUNCTION CANNOT DISCHARGE (
|
|
150
|
-
*
|
|
149
|
+
* HOLDER OBLIGATIONS THIS FUNCTION CANNOT DISCHARGE (INTEGRATIONS.md, Holder
|
|
150
|
+
* obligations). A holder MUST show its human — before calling this — the
|
|
151
151
|
* audience, the purpose, the adopting identity, and the roles. A proof is
|
|
152
152
|
* consent, and consent that was never displayed was never given.
|
|
153
153
|
*
|
|
@@ -210,10 +210,10 @@ interface VerifyKeyProofOptions {
|
|
|
210
210
|
/** What a verified key proof hands back. */
|
|
211
211
|
interface VerifiedKeyProof {
|
|
212
212
|
/**
|
|
213
|
-
* The validated payload. THE CALLER MUST NOW RUN
|
|
214
|
-
* check that it is a nonce this verifier minted, for this
|
|
215
|
-
* consumed, and consume it ATOMICALLY (check-and-delete) so
|
|
216
|
-
* completions cannot both pass.
|
|
213
|
+
* The validated payload. THE CALLER MUST NOW RUN THE NONCE CHECK against
|
|
214
|
+
* `payload.nonce`: check that it is a nonce this verifier minted, for this
|
|
215
|
+
* ceremony, not yet consumed, and consume it ATOMICALLY (check-and-delete) so
|
|
216
|
+
* two racing completions cannot both pass.
|
|
217
217
|
*/
|
|
218
218
|
payload: KeyProofPayload;
|
|
219
219
|
/** The header `typ` — equal to `expectedTyp`, since anything else rejected. */
|
|
@@ -222,17 +222,18 @@ interface VerifiedKeyProof {
|
|
|
222
222
|
now: number;
|
|
223
223
|
}
|
|
224
224
|
/**
|
|
225
|
-
* Verify a key proof AT PRESENTATION TIME —
|
|
226
|
-
*
|
|
227
|
-
* CANONICAL bytes, the four expectation arms (audience,
|
|
228
|
-
* freshness, and the signature against the payload's
|
|
225
|
+
* Verify a key proof AT PRESENTATION TIME — INTEGRATIONS.md, Presentation
|
|
226
|
+
* verification except its nonce check: size cap, header gates, the closed
|
|
227
|
+
* payload schema over CANONICAL bytes, the four expectation arms (audience,
|
|
228
|
+
* did, roleSet, prevCID), freshness, and the signature against the payload's
|
|
229
|
+
* OWN `publicKeyMultibase`.
|
|
229
230
|
*
|
|
230
231
|
* EVERY EXPECTATION IS THE DEPLOYMENT'S OWN VALUE. There is no arm here that
|
|
231
232
|
* compares the envelope to itself. `expectedDid`, `expectedRoleSet` and
|
|
232
233
|
* `expectedPrevCID` are the position the completing authority is about to WRITE;
|
|
233
234
|
* if the envelope names a different one, the holder consented to something else.
|
|
234
235
|
*
|
|
235
|
-
*
|
|
236
|
+
* THE NONCE CHECK IS THE CALLER'S, and this function cannot stand in for it. The
|
|
236
237
|
* nonce MUST be one this verifier minted, for this ceremony, not yet consumed,
|
|
237
238
|
* checked and consumed ATOMICALLY — a check-and-delete against the verifier's
|
|
238
239
|
* own store, which is state this pure function does not hold. It is returned on
|
package/dist/key-proof/index.js
CHANGED
|
@@ -14,9 +14,9 @@ import {
|
|
|
14
14
|
unsafeKeyProofSubject,
|
|
15
15
|
verifyChainKeyProof,
|
|
16
16
|
verifyKeyProof
|
|
17
|
-
} from "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
17
|
+
} from "../chunk-QRCOMLAP.js";
|
|
18
|
+
import "../chunk-F7RHI2CK.js";
|
|
19
|
+
import "../chunk-QTJZGXMH.js";
|
|
20
20
|
export {
|
|
21
21
|
DEFAULT_KEY_PROOF_SKEW_SECONDS,
|
|
22
22
|
KEY_ADD_JWS_TYP,
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
3
|
"$id": "https://schemas.dfos.com/credit-claim/v1",
|
|
4
4
|
"title": "Credit Claim",
|
|
5
|
-
"description": "The payload of a did:dfos:credit-claim JWS — a claimant's own signed assertion that it holds a named role on a content chain. Unlike post/v1, profile/v1, and index/v1, this is NOT a document committed to a chain by CID: it is an envelope payload carried inside document bytes, in the claim field of a credits entry (see $defs/creditEntry). Attribution, not authorization — a credit claim grants nothing. Unknown top-level fields are deliberately NOT rejected here (no additionalProperties: false, unlike the document schemas): this is a wire payload under the protocol's MUST-ignore-unknown rule, and the CID commits to the exact bytes, so a verifier that stripped unknown keys would fail its own CID check. Full semantics, the two-way bind, and the four verification states: https://protocol.dfos.com/credits",
|
|
5
|
+
"description": "The payload of a did:dfos:credit-claim JWS — a claimant's own signed assertion that it holds a named role on a content chain. Unlike post/v1, profile/v1, and index/v1, this is NOT a document committed to a chain by CID: it is an envelope payload carried inside document bytes, in the claim field of a credits entry (see $defs/creditEntry). Attribution, not authorization — a credit claim grants nothing. Unknown top-level fields are deliberately NOT rejected here (no additionalProperties: false, unlike the document schemas): this is a wire payload under the protocol's MUST-ignore-unknown rule, and the CID commits to the exact bytes, so a verifier that stripped unknown keys would fail its own CID check. Full semantics, the two-way bind, and the four verification states: https://protocol.dfos.com/content-model#credits",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"required": ["version", "type", "contentId", "did", "role", "createdAt"],
|
|
8
8
|
"properties": {
|
package/schemas/post.v1.json
CHANGED
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"items": {
|
|
44
44
|
"$ref": "#/$defs/credit"
|
|
45
45
|
},
|
|
46
|
-
"description": "Ordered authorship credits. Array order is display order; the first entry is the primary author. Omit entirely for unattributed content. A bare entry is the assertion tier of the authorship lattice — the operation signer asserts it; a credited DID upgrades its credit to proof by adding a credit claim in the entry's claim field (see https://protocol.dfos.com/credits)."
|
|
46
|
+
"description": "Ordered authorship credits. Array order is display order; the first entry is the primary author. Omit entirely for unattributed content. A bare entry is the assertion tier of the authorship lattice — the operation signer asserts it; a credited DID upgrades its credit to proof by adding a credit claim in the entry's claim field (see https://protocol.dfos.com/content-model#credits)."
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"additionalProperties": false,
|