@secrecy/lib 1.79.0 → 1.79.2
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.
|
@@ -9,11 +9,15 @@ export class SecrecyGroupClient {
|
|
|
9
9
|
if (!groupIdentity) {
|
|
10
10
|
throw new Error('Group identity not found');
|
|
11
11
|
}
|
|
12
|
+
const groupPriv = this.#client.keyPairs[groupIdentity.identityPubKey];
|
|
13
|
+
if (!groupPriv) {
|
|
14
|
+
throw new Error('Group private key not found');
|
|
15
|
+
}
|
|
12
16
|
const opts = {
|
|
13
17
|
pubKey: input.pubKey,
|
|
14
18
|
role: input.role,
|
|
15
19
|
id: input.id,
|
|
16
|
-
encPriv: sodium.to_hex(encryptCryptoBox(sodium.from_hex(
|
|
20
|
+
encPriv: sodium.to_hex(encryptCryptoBox(sodium.from_hex(groupPriv), input.pubKey, this.#client.currentIdentityPrivateKey)),
|
|
17
21
|
};
|
|
18
22
|
return this.#client.apiClient.group.addMember.mutate({
|
|
19
23
|
...opts,
|
|
@@ -80,11 +80,11 @@ export async function uploadData({ storageType, data, password, forcePassword =
|
|
|
80
80
|
if (!data.key) {
|
|
81
81
|
throw new Error('Unable to encrypt data without key!');
|
|
82
82
|
}
|
|
83
|
-
const priv = keyPairs?.[data.
|
|
83
|
+
const priv = keyPairs?.[data.keyIdentityPubKey];
|
|
84
84
|
if (typeof priv !== 'string') {
|
|
85
85
|
throw new Error('Unable to encrypt data without keyPair!');
|
|
86
86
|
}
|
|
87
|
-
key = decryptCryptoBox(sodium.from_hex(data.key), data.
|
|
87
|
+
key = decryptCryptoBox(sodium.from_hex(data.key), data.keySharedByPubKey, priv);
|
|
88
88
|
}
|
|
89
89
|
// NOTE: Process to create a sharing for a auth client (todo: endpoint)
|
|
90
90
|
return {
|
package/dist/types/client.d.ts
CHANGED
|
@@ -1560,10 +1560,8 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
|
|
|
1560
1560
|
}[];
|
|
1561
1561
|
partSize: bigint;
|
|
1562
1562
|
key: string | null;
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
encPriv: string;
|
|
1566
|
-
};
|
|
1563
|
+
keySharedByPubKey: string;
|
|
1564
|
+
keyIdentityPubKey: string;
|
|
1567
1565
|
} | {
|
|
1568
1566
|
type: "guest";
|
|
1569
1567
|
id: string;
|
|
@@ -1609,10 +1607,8 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
|
|
|
1609
1607
|
}[];
|
|
1610
1608
|
partSize: bigint;
|
|
1611
1609
|
key: string | null;
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
encPriv: string;
|
|
1615
|
-
};
|
|
1610
|
+
keySharedByPubKey: string;
|
|
1611
|
+
keyIdentityPubKey: string;
|
|
1616
1612
|
} | {
|
|
1617
1613
|
type: "guest";
|
|
1618
1614
|
id: string;
|
|
@@ -1652,10 +1648,8 @@ export declare const createTRPCClient: (opts: CreateTrpcClientOptions) => import
|
|
|
1652
1648
|
id: string;
|
|
1653
1649
|
storageType: "s3" | "cold" | "lite";
|
|
1654
1650
|
key: string | null;
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
encPriv: string;
|
|
1658
|
-
};
|
|
1651
|
+
keySharedByPubKey: string;
|
|
1652
|
+
keyIdentityPubKey: string;
|
|
1659
1653
|
} | {
|
|
1660
1654
|
type: "guest";
|
|
1661
1655
|
id: string;
|
|
@@ -7921,10 +7915,8 @@ export declare const getTrpcGuestClient: ({ url }?: {
|
|
|
7921
7915
|
}[];
|
|
7922
7916
|
partSize: bigint;
|
|
7923
7917
|
key: string | null;
|
|
7924
|
-
|
|
7925
|
-
|
|
7926
|
-
encPriv: string;
|
|
7927
|
-
};
|
|
7918
|
+
keySharedByPubKey: string;
|
|
7919
|
+
keyIdentityPubKey: string;
|
|
7928
7920
|
} | {
|
|
7929
7921
|
type: "guest";
|
|
7930
7922
|
id: string;
|
|
@@ -7970,10 +7962,8 @@ export declare const getTrpcGuestClient: ({ url }?: {
|
|
|
7970
7962
|
}[];
|
|
7971
7963
|
partSize: bigint;
|
|
7972
7964
|
key: string | null;
|
|
7973
|
-
|
|
7974
|
-
|
|
7975
|
-
encPriv: string;
|
|
7976
|
-
};
|
|
7965
|
+
keySharedByPubKey: string;
|
|
7966
|
+
keyIdentityPubKey: string;
|
|
7977
7967
|
} | {
|
|
7978
7968
|
type: "guest";
|
|
7979
7969
|
id: string;
|
|
@@ -8013,10 +8003,8 @@ export declare const getTrpcGuestClient: ({ url }?: {
|
|
|
8013
8003
|
id: string;
|
|
8014
8004
|
storageType: "s3" | "cold" | "lite";
|
|
8015
8005
|
key: string | null;
|
|
8016
|
-
|
|
8017
|
-
|
|
8018
|
-
encPriv: string;
|
|
8019
|
-
};
|
|
8006
|
+
keySharedByPubKey: string;
|
|
8007
|
+
keyIdentityPubKey: string;
|
|
8020
8008
|
} | {
|
|
8021
8009
|
type: "guest";
|
|
8022
8010
|
id: string;
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@secrecy/lib",
|
|
3
3
|
"author": "Anonymize <anonymize@gmail.com>",
|
|
4
4
|
"description": "Anonymize Secrecy Library",
|
|
5
|
-
"version": "1.79.
|
|
5
|
+
"version": "1.79.2",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "https://github.com/anonymize-org/lib.git"
|
|
@@ -76,7 +76,7 @@
|
|
|
76
76
|
},
|
|
77
77
|
"dependencies": {
|
|
78
78
|
"@js-temporal/polyfill": "^0.5.1",
|
|
79
|
-
"@secrecy/trpc-api-types": "1.35.
|
|
79
|
+
"@secrecy/trpc-api-types": "1.35.2",
|
|
80
80
|
"@trpc/client": "11.6.0",
|
|
81
81
|
"@trpc/server": "^11.6.0",
|
|
82
82
|
"@types/libsodium-wrappers-sumo": "^0.7.8",
|