@metalabel/dfos-protocol 0.30.0 → 0.32.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/dist/chain/index.js +3 -3
- package/dist/{chunk-4QQ5HK5M.js → chunk-4LG2GEB2.js} +7 -2
- package/dist/{chunk-W4ESJVMO.js → chunk-W7IFQNUH.js} +2 -2
- package/dist/{chunk-6HVYO5OS.js → chunk-XP644GQK.js} +1 -1
- package/dist/credentials/index.js +2 -2
- package/dist/crypto/index.d.ts +4 -1
- package/dist/crypto/index.js +3 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +5 -3
- package/package.json +1 -1
package/dist/chain/index.js
CHANGED
|
@@ -49,14 +49,14 @@ import {
|
|
|
49
49
|
verifyIdentityExtensionFromTrustedState,
|
|
50
50
|
verifyRevocation,
|
|
51
51
|
verifySignRequest
|
|
52
|
-
} from "../chunk-
|
|
52
|
+
} from "../chunk-W7IFQNUH.js";
|
|
53
53
|
import {
|
|
54
54
|
ED25519_PRIV_MULTICODEC,
|
|
55
55
|
ED25519_PUB_MULTICODEC,
|
|
56
56
|
decodeMultikey,
|
|
57
57
|
encodeEd25519Multikey
|
|
58
|
-
} from "../chunk-
|
|
59
|
-
import "../chunk-
|
|
58
|
+
} from "../chunk-XP644GQK.js";
|
|
59
|
+
import "../chunk-4LG2GEB2.js";
|
|
60
60
|
export {
|
|
61
61
|
ARTIFACT_CID_ANCHOR_RE,
|
|
62
62
|
ArtifactPayload,
|
|
@@ -37,6 +37,10 @@ var isValidEd25519Signature = (payload, signature, publicKey) => {
|
|
|
37
37
|
return ed25519.verify(signature, payload, publicKey);
|
|
38
38
|
};
|
|
39
39
|
|
|
40
|
+
// src/crypto/hash.ts
|
|
41
|
+
import { sha256 as nobleSha256 } from "@noble/hashes/sha2.js";
|
|
42
|
+
var sha256 = (data) => nobleSha256(data);
|
|
43
|
+
|
|
40
44
|
// src/crypto/id.ts
|
|
41
45
|
import { sha256 as sha256Hash } from "@noble/hashes/sha2.js";
|
|
42
46
|
var alphabet = "2346789acdefhknrtvz";
|
|
@@ -225,7 +229,7 @@ var JwtVerificationError = class extends Error {
|
|
|
225
229
|
import * as dagCborCodec from "@ipld/dag-cbor";
|
|
226
230
|
import * as Block from "multiformats/block";
|
|
227
231
|
import { CID } from "multiformats/cid";
|
|
228
|
-
import { sha256 } from "multiformats/hashes/sha2";
|
|
232
|
+
import { sha256 as sha2562 } from "multiformats/hashes/sha2";
|
|
229
233
|
var dagCborCanonicalEncode = async (value) => {
|
|
230
234
|
assertCanonicalNumbers(value);
|
|
231
235
|
const serialized = JSON.parse(JSON.stringify(value));
|
|
@@ -235,7 +239,7 @@ var dagCborCanonicalEncode = async (value) => {
|
|
|
235
239
|
// -0 to 0)
|
|
236
240
|
value: serialized,
|
|
237
241
|
codec: dagCborCodec,
|
|
238
|
-
hasher:
|
|
242
|
+
hasher: sha2562
|
|
239
243
|
});
|
|
240
244
|
};
|
|
241
245
|
var MAX_SAFE_CANONICAL_INTEGER = 9007199254740991;
|
|
@@ -284,6 +288,7 @@ export {
|
|
|
284
288
|
importEd25519Keypair,
|
|
285
289
|
signPayloadEd25519,
|
|
286
290
|
isValidEd25519Signature,
|
|
291
|
+
sha256,
|
|
287
292
|
generateIdNoPrefix,
|
|
288
293
|
generateId,
|
|
289
294
|
isValidId,
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
matchesResource,
|
|
6
6
|
verifyDFOSCredential,
|
|
7
7
|
verifyDelegationChain
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XP644GQK.js";
|
|
9
9
|
import {
|
|
10
10
|
assertJwsProfile,
|
|
11
11
|
base64urlDecode,
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
decodeJwsUnsafe,
|
|
16
16
|
generateIdNoPrefix,
|
|
17
17
|
verifyJws
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-4LG2GEB2.js";
|
|
19
19
|
|
|
20
20
|
// src/chain/schemas.ts
|
|
21
21
|
import { z } from "zod";
|
|
@@ -13,8 +13,8 @@ import {
|
|
|
13
13
|
verifyAuthToken,
|
|
14
14
|
verifyDFOSCredential,
|
|
15
15
|
verifyDelegationChain
|
|
16
|
-
} from "../chunk-
|
|
17
|
-
import "../chunk-
|
|
16
|
+
} from "../chunk-XP644GQK.js";
|
|
17
|
+
import "../chunk-4LG2GEB2.js";
|
|
18
18
|
export {
|
|
19
19
|
Attenuation,
|
|
20
20
|
AuthTokenClaims,
|
package/dist/crypto/index.d.ts
CHANGED
|
@@ -35,6 +35,9 @@ declare const signPayloadEd25519: (payload: Uint8Array, privateKey: Uint8Array)
|
|
|
35
35
|
*/
|
|
36
36
|
declare const isValidEd25519Signature: (payload: Uint8Array, signature: Uint8Array, publicKey: Uint8Array) => boolean;
|
|
37
37
|
|
|
38
|
+
/** SHA-256 of the given octets, as 32 raw bytes. */
|
|
39
|
+
declare const sha256: (data: Uint8Array) => Uint8Array;
|
|
40
|
+
|
|
38
41
|
type PrefixedID<T extends string> = `${T}_${string}`;
|
|
39
42
|
/**
|
|
40
43
|
* Generate an ID without a prefix
|
|
@@ -211,4 +214,4 @@ declare const parseDagCborCID: (cid: string) => CID<unknown, number, number, mul
|
|
|
211
214
|
*/
|
|
212
215
|
declare const isCanonicallyEqual: (data1: unknown, data2: unknown) => Promise<boolean>;
|
|
213
216
|
|
|
214
|
-
export { type JwsHeader, JwsVerificationError, type JwtClaims, type JwtCreateOptions, type JwtHeader, JwtVerificationError, type JwtVerifyOptions, type PrefixedID, assertJwsProfile, base64urlDecode, base64urlEncode, createJws, createJwt, createNewEd25519Keypair, dagCborCanonicalEncode, decodeJwsUnsafe, decodeJwtUnsafe, generateId, generateIdNoPrefix, importEd25519Keypair, isCanonicallyEqual, isValidEd25519Signature, isValidId, normalizedId, parseDagCborCID, signPayloadEd25519, verifyJws, verifyJwt };
|
|
217
|
+
export { type JwsHeader, JwsVerificationError, type JwtClaims, type JwtCreateOptions, type JwtHeader, JwtVerificationError, type JwtVerifyOptions, type PrefixedID, assertJwsProfile, base64urlDecode, base64urlEncode, createJws, createJwt, createNewEd25519Keypair, dagCborCanonicalEncode, decodeJwsUnsafe, decodeJwtUnsafe, generateId, generateIdNoPrefix, importEd25519Keypair, isCanonicallyEqual, isValidEd25519Signature, isValidId, normalizedId, parseDagCborCID, sha256, signPayloadEd25519, verifyJws, verifyJwt };
|
package/dist/crypto/index.js
CHANGED
|
@@ -18,10 +18,11 @@ import {
|
|
|
18
18
|
isValidId,
|
|
19
19
|
normalizedId,
|
|
20
20
|
parseDagCborCID,
|
|
21
|
+
sha256,
|
|
21
22
|
signPayloadEd25519,
|
|
22
23
|
verifyJws,
|
|
23
24
|
verifyJwt
|
|
24
|
-
} from "../chunk-
|
|
25
|
+
} from "../chunk-4LG2GEB2.js";
|
|
25
26
|
export {
|
|
26
27
|
JwsVerificationError,
|
|
27
28
|
JwtVerificationError,
|
|
@@ -42,6 +43,7 @@ export {
|
|
|
42
43
|
isValidId,
|
|
43
44
|
normalizedId,
|
|
44
45
|
parseDagCborCID,
|
|
46
|
+
sha256,
|
|
45
47
|
signPayloadEd25519,
|
|
46
48
|
verifyJws,
|
|
47
49
|
verifyJwt
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { JwsHeader, JwsVerificationError, JwtClaims, JwtCreateOptions, JwtHeader, JwtVerificationError, JwtVerifyOptions, PrefixedID, assertJwsProfile, base64urlDecode, base64urlEncode, createJws, createJwt, createNewEd25519Keypair, dagCborCanonicalEncode, decodeJwsUnsafe, decodeJwtUnsafe, generateId, generateIdNoPrefix, importEd25519Keypair, isCanonicallyEqual, isValidEd25519Signature, isValidId, normalizedId, parseDagCborCID, signPayloadEd25519, verifyJws, verifyJwt } from './crypto/index.js';
|
|
1
|
+
export { JwsHeader, JwsVerificationError, JwtClaims, JwtCreateOptions, JwtHeader, JwtVerificationError, JwtVerifyOptions, PrefixedID, assertJwsProfile, base64urlDecode, base64urlEncode, createJws, createJwt, createNewEd25519Keypair, dagCborCanonicalEncode, decodeJwsUnsafe, decodeJwtUnsafe, generateId, generateIdNoPrefix, importEd25519Keypair, isCanonicallyEqual, isValidEd25519Signature, isValidId, normalizedId, parseDagCborCID, sha256, signPayloadEd25519, verifyJws, verifyJwt } from './crypto/index.js';
|
|
2
2
|
export { A as ARTIFACT_CID_ANCHOR_RE, a as ArtifactPayload, b as Attenuation, c as AuthTokenClaims, C as CONTENT_ID_ANCHOR_RE, d as ContentOperation, e as CountersignPayload, f as CredentialVerificationError, g as CreditClaimPayload, D as DFOSCredentialPayload, I as IdentityOperation, h as Iso8601, M as MAX_ARTIFACT_PAYLOAD_SIZE, i as MAX_CREDENTIAL_SIZE, j as MAX_CREDIT_CLAIM_SIZE, k as MAX_OPERATION_SIZE, l as MAX_SERVICES_ENTRIES, m as MAX_SERVICES_PAYLOAD_SIZE, n as MAX_SIGN_REQUEST_PAYLOAD_SIZE, o as MAX_SIGN_REQUEST_SIZE, p as MultikeyPublicKey, R as RevocationChecker, q as RevocationPayload, S as ServiceEntry, r as ServicesArray, s as SignRequestPayload, t as Signer, V as VerifiedDFOSCredential, u as VerifiedDelegationChain, v as VerifiedIdentity, w as createDFOSCredential, x as decodeDFOSCredentialUnsafe, y as isAttenuated, z as matchesResource, B as parseProtocolTimestampUnix, E as verifyDFOSCredential, F as verifyDelegationChain } from './dfos-credential-DU7WvoHE.js';
|
|
3
3
|
export { AnchorKind, CreditClaimFailureReason, CreditClaimVerifyError, CreditEntry, CreditEntryState, ED25519_PRIV_MULTICODEC, ED25519_PUB_MULTICODEC, RECOGNIZED_SERVICE_TYPES, SignRequestFailureReason, SignRequestVerifyError, VerifiedArtifact, VerifiedContentChain, VerifiedCountersignature, VerifiedCreditClaim, VerifiedCreditEntry, VerifiedRevocation, VerifiedSignRequest, anchorsByLabel, assertCanonicalSignRequestPayload, assertServicesWithinCap, buildSignRequest, classifyAnchor, decodeMultikey, deriveChainIdentifier, deriveContentId, encodeEd25519Multikey, isRecognizedServiceType, relayEndpoints, signArtifact, signContentOperation, signCountersignature, signCreditClaim, signIdentityOperation, signRevocation, verifyArtifact, verifyContentChain, verifyContentExtensionFromTrustedState, verifyCountersignature, verifyCreditClaim, verifyCreditEntry, verifyIdentityChain, verifyIdentityExtensionFromTrustedState, verifyRevocation, verifySignRequest } from './chain/index.js';
|
|
4
4
|
export { AuthTokenCreateOptions, AuthTokenVerificationError, AuthTokenVerifyOptions, VerifiedAuthToken, createAuthToken, verifyAuthToken } from './credentials/index.js';
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ import {
|
|
|
49
49
|
verifyIdentityExtensionFromTrustedState,
|
|
50
50
|
verifyRevocation,
|
|
51
51
|
verifySignRequest
|
|
52
|
-
} from "./chunk-
|
|
52
|
+
} from "./chunk-W7IFQNUH.js";
|
|
53
53
|
import {
|
|
54
54
|
Attenuation,
|
|
55
55
|
AuthTokenClaims,
|
|
@@ -69,7 +69,7 @@ import {
|
|
|
69
69
|
verifyAuthToken,
|
|
70
70
|
verifyDFOSCredential,
|
|
71
71
|
verifyDelegationChain
|
|
72
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-XP644GQK.js";
|
|
73
73
|
import {
|
|
74
74
|
JwsVerificationError,
|
|
75
75
|
JwtVerificationError,
|
|
@@ -90,10 +90,11 @@ import {
|
|
|
90
90
|
isValidId,
|
|
91
91
|
normalizedId,
|
|
92
92
|
parseDagCborCID,
|
|
93
|
+
sha256,
|
|
93
94
|
signPayloadEd25519,
|
|
94
95
|
verifyJws,
|
|
95
96
|
verifyJwt
|
|
96
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-4LG2GEB2.js";
|
|
97
98
|
import {
|
|
98
99
|
INDEX_V1_SCHEMA,
|
|
99
100
|
byteCompare,
|
|
@@ -179,6 +180,7 @@ export {
|
|
|
179
180
|
parseDagCborCID,
|
|
180
181
|
parseProtocolTimestampUnix,
|
|
181
182
|
relayEndpoints,
|
|
183
|
+
sha256,
|
|
182
184
|
signArtifact,
|
|
183
185
|
signContentOperation,
|
|
184
186
|
signCountersignature,
|