@atproto/repo 0.3.2 → 0.3.4
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/CHANGELOG.md +25 -0
- package/LICENSE.txt +7 -0
- package/README.md +6 -1
- package/dist/index.js +35 -12
- package/dist/index.js.map +3 -3
- package/package.json +7 -7
- package/src/util.ts +1 -1
- package/LICENSE +0 -21
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @atproto/repo
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#1788](https://github.com/bluesky-social/atproto/pull/1788) [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423) Thanks [@bnewbold](https://github.com/bnewbold)! - update license to "MIT or Apache2"
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`ce49743d`](https://github.com/bluesky-social/atproto/commit/ce49743d7f8800d33116b88001d7b512553c2c89), [`84e2d4d2`](https://github.com/bluesky-social/atproto/commit/84e2d4d2b6694f344d80c18672c78b650189d423)]:
|
|
10
|
+
- @atproto/lexicon@0.3.0
|
|
11
|
+
- @atproto/common-web@0.2.3
|
|
12
|
+
- @atproto/identity@0.3.1
|
|
13
|
+
- @atproto/common@0.3.3
|
|
14
|
+
- @atproto/crypto@0.2.3
|
|
15
|
+
- @atproto/syntax@0.1.4
|
|
16
|
+
|
|
17
|
+
## 0.3.3
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- Updated dependencies [[`bb039d8e`](https://github.com/bluesky-social/atproto/commit/bb039d8e4ce5b7f70c4f3e86d1327e210ef24dc3), [`35d108ce`](https://github.com/bluesky-social/atproto/commit/35d108ce94866ce1b3d147cd0620a0ba1c4ebcd7)]:
|
|
22
|
+
- @atproto/identity@0.3.0
|
|
23
|
+
- @atproto/common-web@0.2.2
|
|
24
|
+
- @atproto/common@0.3.2
|
|
25
|
+
- @atproto/lexicon@0.2.3
|
|
26
|
+
- @atproto/syntax@0.1.3
|
|
27
|
+
|
|
3
28
|
## 0.3.2
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/LICENSE.txt
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Dual MIT/Apache-2.0 License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022-2023 Bluesky PBC, and Contributors
|
|
4
|
+
|
|
5
|
+
Except as otherwise noted in individual files, this software is licensed under the MIT license (<http://opensource.org/licenses/MIT>), or the Apache License, Version 2.0 (<http://www.apache.org/licenses/LICENSE-2.0>).
|
|
6
|
+
|
|
7
|
+
Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
|
package/README.md
CHANGED
|
@@ -9,4 +9,9 @@ Repositories in atproto are signed key/value stores containing CBOR-encoded data
|
|
|
9
9
|
|
|
10
10
|
## License
|
|
11
11
|
|
|
12
|
-
MIT
|
|
12
|
+
This project is dual-licensed under MIT and Apache 2.0 terms:
|
|
13
|
+
|
|
14
|
+
- MIT license ([LICENSE-MIT.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-MIT.txt) or http://opensource.org/licenses/MIT)
|
|
15
|
+
- Apache License, Version 2.0, ([LICENSE-APACHE.txt](https://github.com/bluesky-social/atproto/blob/main/LICENSE-APACHE.txt) or http://www.apache.org/licenses/LICENSE-2.0)
|
|
16
|
+
|
|
17
|
+
Downstream projects and end users may chose either license individually, or both together, at their discretion. The motivation for this dual-licensing is the additional software patent assurance provided by Apache 2.0.
|
package/dist/index.js
CHANGED
|
@@ -18170,6 +18170,25 @@ var DAY = HOUR * 24;
|
|
|
18170
18170
|
// ../common-web/src/strings.ts
|
|
18171
18171
|
var import_graphemer = __toESM(require_lib());
|
|
18172
18172
|
|
|
18173
|
+
// ../common-web/src/did-doc.ts
|
|
18174
|
+
var verificationMethod = z.object({
|
|
18175
|
+
id: z.string(),
|
|
18176
|
+
type: z.string(),
|
|
18177
|
+
controller: z.string(),
|
|
18178
|
+
publicKeyMultibase: z.string().optional()
|
|
18179
|
+
});
|
|
18180
|
+
var service = z.object({
|
|
18181
|
+
id: z.string(),
|
|
18182
|
+
type: z.string(),
|
|
18183
|
+
serviceEndpoint: z.union([z.string(), z.record(z.unknown())])
|
|
18184
|
+
});
|
|
18185
|
+
var didDocument = z.object({
|
|
18186
|
+
id: z.string(),
|
|
18187
|
+
alsoKnownAs: z.array(z.string()).optional(),
|
|
18188
|
+
verificationMethod: z.array(verificationMethod).optional(),
|
|
18189
|
+
service: z.array(service).optional()
|
|
18190
|
+
});
|
|
18191
|
+
|
|
18173
18192
|
// ../lexicon/src/validators/formats.ts
|
|
18174
18193
|
var import_iso_datestring_validator = __toESM(require_dist());
|
|
18175
18194
|
|
|
@@ -24518,16 +24537,18 @@ var decompressPubkey2 = (compressed) => {
|
|
|
24518
24537
|
};
|
|
24519
24538
|
|
|
24520
24539
|
// ../crypto/src/p256/operations.ts
|
|
24521
|
-
var verifyDidSig = async (did2, data, sig) => {
|
|
24540
|
+
var verifyDidSig = async (did2, data, sig, opts) => {
|
|
24522
24541
|
const { jwtAlg, keyBytes } = parseDidKey(did2);
|
|
24523
24542
|
if (jwtAlg !== P256_JWT_ALG) {
|
|
24524
24543
|
throw new Error(`Not a P-256 did:key: ${did2}`);
|
|
24525
24544
|
}
|
|
24526
|
-
return verifySig(keyBytes, data, sig);
|
|
24545
|
+
return verifySig(keyBytes, data, sig, opts);
|
|
24527
24546
|
};
|
|
24528
|
-
var verifySig = async (publicKey, data, sig) => {
|
|
24547
|
+
var verifySig = async (publicKey, data, sig, opts) => {
|
|
24529
24548
|
const msgHash = await sha2562(data);
|
|
24530
|
-
return p256.verify(sig, msgHash, publicKey, {
|
|
24549
|
+
return p256.verify(sig, msgHash, publicKey, {
|
|
24550
|
+
lowS: opts?.lowS ?? true
|
|
24551
|
+
});
|
|
24531
24552
|
};
|
|
24532
24553
|
|
|
24533
24554
|
// ../crypto/src/p256/plugin.ts
|
|
@@ -24539,16 +24560,18 @@ var p256Plugin = {
|
|
|
24539
24560
|
var plugin_default = p256Plugin;
|
|
24540
24561
|
|
|
24541
24562
|
// ../crypto/src/secp256k1/operations.ts
|
|
24542
|
-
var verifyDidSig2 = async (did2, data, sig) => {
|
|
24563
|
+
var verifyDidSig2 = async (did2, data, sig, opts) => {
|
|
24543
24564
|
const { jwtAlg, keyBytes } = parseDidKey(did2);
|
|
24544
24565
|
if (jwtAlg !== SECP256K1_JWT_ALG) {
|
|
24545
24566
|
throw new Error(`Not a secp256k1 did:key: ${did2}`);
|
|
24546
24567
|
}
|
|
24547
|
-
return verifySig2(keyBytes, data, sig);
|
|
24568
|
+
return verifySig2(keyBytes, data, sig, opts);
|
|
24548
24569
|
};
|
|
24549
|
-
var verifySig2 = async (publicKey, data, sig) => {
|
|
24570
|
+
var verifySig2 = async (publicKey, data, sig, opts) => {
|
|
24550
24571
|
const msgHash = await sha2562(data);
|
|
24551
|
-
return secp256k1.verify(sig, msgHash, publicKey, {
|
|
24572
|
+
return secp256k1.verify(sig, msgHash, publicKey, {
|
|
24573
|
+
lowS: opts?.lowS ?? true
|
|
24574
|
+
});
|
|
24552
24575
|
};
|
|
24553
24576
|
|
|
24554
24577
|
// ../crypto/src/secp256k1/plugin.ts
|
|
@@ -24601,13 +24624,13 @@ var sha2563 = async (input) => {
|
|
|
24601
24624
|
};
|
|
24602
24625
|
|
|
24603
24626
|
// ../crypto/src/verify.ts
|
|
24604
|
-
var verifySignature = (didKey, data, sig) => {
|
|
24627
|
+
var verifySignature = (didKey, data, sig, opts) => {
|
|
24605
24628
|
const parsed = parseDidKey(didKey);
|
|
24606
24629
|
const plugin = plugins_default.find((p) => p.jwtAlg === parsed.jwtAlg);
|
|
24607
24630
|
if (!plugin) {
|
|
24608
|
-
throw new Error(`Unsupported signature alg:
|
|
24631
|
+
throw new Error(`Unsupported signature alg: ${parsed.jwtAlg}`);
|
|
24609
24632
|
}
|
|
24610
|
-
return plugin.verifySignature(didKey, data, sig);
|
|
24633
|
+
return plugin.verifySignature(didKey, data, sig, opts);
|
|
24611
24634
|
};
|
|
24612
24635
|
|
|
24613
24636
|
// src/mst/util.ts
|
|
@@ -25332,7 +25355,7 @@ var readCar = async (bytes3) => {
|
|
|
25332
25355
|
const roots = await car.getRoots();
|
|
25333
25356
|
const blocks = new block_map_default();
|
|
25334
25357
|
for await (const block of verifyIncomingCarBlocks(car.blocks())) {
|
|
25335
|
-
|
|
25358
|
+
blocks.set(block.cid, block.bytes);
|
|
25336
25359
|
}
|
|
25337
25360
|
return {
|
|
25338
25361
|
roots,
|