@todesktop/shared 7.188.52 → 7.188.54
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/lib/base.d.ts +2 -0
- package/lib/hsm.js +6 -0
- package/package.json +1 -1
- package/src/base.ts +2 -0
- package/src/hsm.ts +10 -0
package/lib/base.d.ts
CHANGED
|
@@ -172,6 +172,7 @@ export declare enum WindowsHSMCertType {
|
|
|
172
172
|
file = "file"
|
|
173
173
|
}
|
|
174
174
|
export interface CustomWindowsCodeSignFile {
|
|
175
|
+
type?: 'hsm';
|
|
175
176
|
certType: string;
|
|
176
177
|
hsmCertType: WindowsHSMCertType.file;
|
|
177
178
|
hsmCertName: string;
|
|
@@ -179,6 +180,7 @@ export interface CustomWindowsCodeSignFile {
|
|
|
179
180
|
certUrl?: URL;
|
|
180
181
|
}
|
|
181
182
|
export interface CustomWindowsCodeSignEV {
|
|
183
|
+
type?: 'hsm';
|
|
182
184
|
certType: 'hsm';
|
|
183
185
|
hsmCertType: WindowsHSMCertType.ev;
|
|
184
186
|
hsmCertName: string;
|
package/lib/hsm.js
CHANGED
|
@@ -18,6 +18,9 @@ exports.isWindowsTarget = isWindowsTarget;
|
|
|
18
18
|
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
19
19
|
*/
|
|
20
20
|
exports.getCertificateNameFromHSM = (appId, target) => {
|
|
21
|
+
if (!isMacTarget(target) && !isWindowsTarget(target)) {
|
|
22
|
+
throw new Error(`Invalid target '${target}'. Only windows or mac certs are supported`);
|
|
23
|
+
}
|
|
21
24
|
return `todesktop-${appId}-${target}-cert`;
|
|
22
25
|
};
|
|
23
26
|
/**
|
|
@@ -30,5 +33,8 @@ exports.getCertificateNameFromHSM = (appId, target) => {
|
|
|
30
33
|
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
31
34
|
*/
|
|
32
35
|
exports.getAPIKeyNameFromHSM = (appId, target) => {
|
|
36
|
+
if (!isMacTarget(target)) {
|
|
37
|
+
throw new Error(`Invalid target '${target}'. Only mac certs are supported`);
|
|
38
|
+
}
|
|
33
39
|
return `todesktop-${appId}-${target}-api-key`;
|
|
34
40
|
};
|
package/package.json
CHANGED
package/src/base.ts
CHANGED
|
@@ -187,6 +187,7 @@ export enum WindowsHSMCertType {
|
|
|
187
187
|
}
|
|
188
188
|
|
|
189
189
|
export interface CustomWindowsCodeSignFile {
|
|
190
|
+
type?: 'hsm';
|
|
190
191
|
certType: string;
|
|
191
192
|
hsmCertType: WindowsHSMCertType.file;
|
|
192
193
|
hsmCertName: string;
|
|
@@ -196,6 +197,7 @@ export interface CustomWindowsCodeSignFile {
|
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
export interface CustomWindowsCodeSignEV {
|
|
200
|
+
type?: 'hsm';
|
|
199
201
|
certType: 'hsm';
|
|
200
202
|
hsmCertType: WindowsHSMCertType.ev;
|
|
201
203
|
hsmCertName: string;
|
package/src/hsm.ts
CHANGED
|
@@ -36,6 +36,12 @@ export const getCertificateNameFromHSM = (
|
|
|
36
36
|
appId: string,
|
|
37
37
|
target: MacTarget | WindowsTarget
|
|
38
38
|
) => {
|
|
39
|
+
if (!isMacTarget(target) && !isWindowsTarget(target)) {
|
|
40
|
+
throw new Error(
|
|
41
|
+
`Invalid target '${target}'. Only windows or mac certs are supported`
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
39
45
|
return `todesktop-${appId}-${target}-cert`;
|
|
40
46
|
};
|
|
41
47
|
|
|
@@ -49,5 +55,9 @@ export const getCertificateNameFromHSM = (
|
|
|
49
55
|
* @returns the name of the secret that is required for downloading the cert from HSM.
|
|
50
56
|
*/
|
|
51
57
|
export const getAPIKeyNameFromHSM = (appId: string, target: MacTarget) => {
|
|
58
|
+
if (!isMacTarget(target)) {
|
|
59
|
+
throw new Error(`Invalid target '${target}'. Only mac certs are supported`);
|
|
60
|
+
}
|
|
61
|
+
|
|
52
62
|
return `todesktop-${appId}-${target}-api-key`;
|
|
53
63
|
};
|