@ledgerhq/revault-sdk 0.25.0 → 0.26.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/lib/bake.cjs +1214 -1361
- package/lib/bake.cjs.map +1 -1
- package/lib/bake.d.cts +564 -562
- package/lib/bake.d.ts +564 -562
- package/lib/bake.js +1204 -1359
- package/lib/bake.js.map +1 -1
- package/lib/chunk-CKQMccvm.cjs +28 -0
- package/lib/crypto-BDBF_rfw.cjs +266 -0
- package/lib/crypto-BDBF_rfw.cjs.map +1 -0
- package/lib/crypto-CPCBrCSZ.js +245 -0
- package/lib/crypto-CPCBrCSZ.js.map +1 -0
- package/lib/crypto.cjs +5 -11
- package/lib/crypto.d.cts +10 -7
- package/lib/crypto.d.ts +10 -7
- package/lib/crypto.js +2 -11
- package/lib/device-0lcfYGHr.cjs +791 -0
- package/lib/device-0lcfYGHr.cjs.map +1 -0
- package/lib/device-B8Fww8_6.js +719 -0
- package/lib/device-B8Fww8_6.js.map +1 -0
- package/lib/device.cjs +6 -13
- package/lib/device.d.cts +2 -50
- package/lib/device.d.ts +2 -50
- package/lib/device.js +2 -13
- package/lib/engine.cjs +851 -888
- package/lib/engine.cjs.map +1 -1
- package/lib/engine.d.cts +3 -25
- package/lib/engine.d.ts +3 -25
- package/lib/engine.js +844 -885
- package/lib/engine.js.map +1 -1
- package/lib/index--fscLDTT.d.ts +237 -0
- package/lib/index-BE7oUpCb.d.cts +237 -0
- package/lib/index-DOn7RPPt.d.cts +23 -0
- package/lib/index-U0iFMp3g.d.ts +23 -0
- package/lib/index.cjs +0 -1
- package/lib/index.d.cts +10 -5
- package/lib/index.d.ts +10 -5
- package/lib/index.js +1 -1
- package/lib/logger-Cme0iL1f.d.cts +10 -0
- package/lib/logger-DWLViq7U.d.ts +10 -0
- package/lib/onboarding.cjs +215 -183
- package/lib/onboarding.cjs.map +1 -1
- package/lib/onboarding.d.cts +1918 -1722
- package/lib/onboarding.d.ts +1918 -1722
- package/lib/onboarding.js +211 -181
- package/lib/onboarding.js.map +1 -1
- package/lib/trpc-CWGPr8Ox.d.ts +20 -0
- package/lib/trpc-C_dUOB1u.d.cts +20 -0
- package/lib/types-BXkDuD6i.d.ts +207 -0
- package/lib/types-CQROu0nu.d.cts +6 -0
- package/lib/types-Ngwgtu_U.d.cts +207 -0
- package/lib/types-_QeBv1U4.d.ts +6 -0
- package/lib/types.cjs +0 -1
- package/lib/types.d.cts +3 -4
- package/lib/types.d.ts +3 -4
- package/lib/types.js +1 -1
- package/lib/utils-BGbdjOP9.js +61 -0
- package/lib/utils-BGbdjOP9.js.map +1 -0
- package/lib/utils-DbSFXp4c.cjs +84 -0
- package/lib/utils-DbSFXp4c.cjs.map +1 -0
- package/package.json +6 -6
- package/lib/chunk-2WGM7EWA.cjs +0 -282
- package/lib/chunk-2WGM7EWA.cjs.map +0 -1
- package/lib/chunk-AXI72NFY.js +0 -50
- package/lib/chunk-AXI72NFY.js.map +0 -1
- package/lib/chunk-DRMYBKL3.cjs +0 -820
- package/lib/chunk-DRMYBKL3.cjs.map +0 -1
- package/lib/chunk-KV5FO7N5.js +0 -282
- package/lib/chunk-KV5FO7N5.js.map +0 -1
- package/lib/chunk-LH4QQXUH.cjs +0 -50
- package/lib/chunk-LH4QQXUH.cjs.map +0 -1
- package/lib/chunk-PFZIW6UP.js +0 -820
- package/lib/chunk-PFZIW6UP.js.map +0 -1
- package/lib/crypto.cjs.map +0 -1
- package/lib/crypto.js.map +0 -1
- package/lib/device.cjs.map +0 -1
- package/lib/device.js.map +0 -1
- package/lib/index.cjs.map +0 -1
- package/lib/index.js.map +0 -1
- package/lib/logger-C-TPbnjv.d.cts +0 -9
- package/lib/logger-C-TPbnjv.d.ts +0 -9
- package/lib/types-C-ngtI5m.d.ts +0 -202
- package/lib/types-CpGEbAxh.d.cts +0 -19
- package/lib/types-CpGEbAxh.d.ts +0 -19
- package/lib/types-CryvY9pW.d.cts +0 -202
- package/lib/types-DJfbanPz.d.cts +0 -167
- package/lib/types-DJfbanPz.d.ts +0 -167
- package/lib/types.cjs.map +0 -1
- package/lib/types.js.map +0 -1
package/lib/types-CryvY9pW.d.cts
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
import { VaultRequestResponse, PsdChallenge, ApiChallenge, UserRegistrationResponse, ClaimedRole, WrappingKeyResponse, OnboardingSeedChallenge } from '@ledgerhq/revault-api';
|
|
2
|
-
import { D as Device } from './types-DJfbanPz.cjs';
|
|
3
|
-
import { R as RevaultApiTRPCClient, c as TRPCClientOptions, b as RouterOutputs } from './types-CpGEbAxh.cjs';
|
|
4
|
-
|
|
5
|
-
type EngineOptions = {
|
|
6
|
-
/**
|
|
7
|
-
* revault-api URL
|
|
8
|
-
*/
|
|
9
|
-
baseUrl: string;
|
|
10
|
-
/**
|
|
11
|
-
* device-api URL
|
|
12
|
-
*/
|
|
13
|
-
deviceApiUrl: string;
|
|
14
|
-
/**
|
|
15
|
-
* salt used by device-api
|
|
16
|
-
*/
|
|
17
|
-
salt: string;
|
|
18
|
-
/**
|
|
19
|
-
* seed generation function used for device-api device spawn
|
|
20
|
-
*/
|
|
21
|
-
genSeed: (p: {
|
|
22
|
-
salt: string;
|
|
23
|
-
index: number;
|
|
24
|
-
}) => string | Promise<string>;
|
|
25
|
-
};
|
|
26
|
-
type EngineBase = {
|
|
27
|
-
/**
|
|
28
|
-
* revault-api client
|
|
29
|
-
*/
|
|
30
|
-
client: RevaultApiTRPCClient;
|
|
31
|
-
/**
|
|
32
|
-
* Create a new revault-api client with the given options overriding the base ones
|
|
33
|
-
*/
|
|
34
|
-
createClient: (opts: Partial<TRPCClientOptions>) => RevaultApiTRPCClient;
|
|
35
|
-
/**
|
|
36
|
-
* Engine options used to create the engine. Can be useful to retrieve them at runtime.
|
|
37
|
-
*/
|
|
38
|
-
__options: EngineOptions;
|
|
39
|
-
};
|
|
40
|
-
type EnhanceWithDevice<T> = T extends WithDevice | WithApiUser ? unknown : {
|
|
41
|
-
/**
|
|
42
|
-
* Mark the engine as targeting the given transport id for PSD communication.
|
|
43
|
-
* See `@ledgerhq/hw-transport` for more information.
|
|
44
|
-
*
|
|
45
|
-
* @param string transportId
|
|
46
|
-
*/
|
|
47
|
-
withTransportId: (transportId: string) => Engine<T & WithDevice>;
|
|
48
|
-
/**
|
|
49
|
-
* Mark the engine as using device-api (for dev & test purposes) with the given device index.
|
|
50
|
-
*
|
|
51
|
-
* @param number deviceIndex
|
|
52
|
-
*/
|
|
53
|
-
withDeviceIndex: (deviceIndex: number) => Engine<T & WithDevice>;
|
|
54
|
-
};
|
|
55
|
-
type EnhanceWithApiUser<T> = T extends WithDevice | WithApiUser | WithOnboarding ? unknown : {
|
|
56
|
-
/**
|
|
57
|
-
* Mark the engine as targeting API user
|
|
58
|
-
*/
|
|
59
|
-
withApiUser: () => Engine<T & WithApiUser>;
|
|
60
|
-
};
|
|
61
|
-
type EnhanceWithOnboarding<T> = T extends WithOnboarding | WithWorkspace | WithApiUser ? unknown : {
|
|
62
|
-
/**
|
|
63
|
-
* Target the given onboarding id
|
|
64
|
-
*
|
|
65
|
-
* @param string Onboarding id
|
|
66
|
-
*/
|
|
67
|
-
withOnboarding: (onboardingId: string) => Engine<T & WithOnboarding>;
|
|
68
|
-
};
|
|
69
|
-
type EnhanceWithWorkspace<T> = T extends WithWorkspace | WithOnboarding ? unknown : {
|
|
70
|
-
/**
|
|
71
|
-
* Target the given workspace
|
|
72
|
-
*
|
|
73
|
-
* @param string Workspace name
|
|
74
|
-
*/
|
|
75
|
-
withWorkspace: (workspaceName: string) => Engine<T & WithWorkspace>;
|
|
76
|
-
};
|
|
77
|
-
type Decorate<T, TCond, TExtend> = T extends TCond ? TExtend : unknown;
|
|
78
|
-
type Engine<T = unknown> = T & EngineBase & EnhanceWithDevice<T> & EnhanceWithApiUser<T> & EnhanceWithOnboarding<T> & EnhanceWithWorkspace<T> & Decorate<T, WithDevice, DecorateWithDevice<T>> & Decorate<T, WithWorkspace, DecorateWithWorkspace<T>> & Decorate<T, WithDevice & WithOnboarding, DecorateWithDeviceAndOnboarding>;
|
|
79
|
-
type WithDevice = {
|
|
80
|
-
device: Device;
|
|
81
|
-
};
|
|
82
|
-
type DecorateWithDevice<T> = T extends WithWorkspace ? unknown : {
|
|
83
|
-
getWorkspaces: () => Promise<string[]>;
|
|
84
|
-
getWorkspacesForSso: () => Promise<RouterOutputs["auth"]["sso"]["findWorkspaces"]["workspaces"]>;
|
|
85
|
-
};
|
|
86
|
-
type WithApiUser = {
|
|
87
|
-
__isApiUser: true;
|
|
88
|
-
};
|
|
89
|
-
type RegisterOnboardingDeviceParams = {
|
|
90
|
-
role: "ADMIN" | "SHARED_OWNER";
|
|
91
|
-
name: string;
|
|
92
|
-
};
|
|
93
|
-
type WithOnboarding = {
|
|
94
|
-
__onboardingId: string;
|
|
95
|
-
};
|
|
96
|
-
type DecorateWithDeviceAndOnboarding = {
|
|
97
|
-
/**
|
|
98
|
-
* Claim the device as part of the onboarding
|
|
99
|
-
*/
|
|
100
|
-
claimDevice: (p: {
|
|
101
|
-
role: ClaimedRole;
|
|
102
|
-
deviceName: string;
|
|
103
|
-
}) => Promise<void>;
|
|
104
|
-
/**
|
|
105
|
-
* Collect fragment of wrapping key
|
|
106
|
-
*/
|
|
107
|
-
collectWrappingKeyFragment: (wrappingKey: WrappingKeyResponse, params?: OnboardingOperationParams) => Promise<void>;
|
|
108
|
-
/**
|
|
109
|
-
* Register device (either Admin or Shared-Owner)
|
|
110
|
-
*/
|
|
111
|
-
registerDevice: (p: RegisterOnboardingDeviceParams, params?: OnboardingOperationParams) => Promise<void>;
|
|
112
|
-
/**
|
|
113
|
-
* Review Shared-Owner with Admin
|
|
114
|
-
*/
|
|
115
|
-
reviewSharedOwner: (challenge: PsdChallenge, params?: OnboardingOperationParams) => Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Collect master seed fragment
|
|
118
|
-
*/
|
|
119
|
-
collectSeedFragment: (challenge: OnboardingSeedChallenge, params?: OnboardingOperationParams) => Promise<void>;
|
|
120
|
-
};
|
|
121
|
-
type WithWorkspace = {
|
|
122
|
-
__workspaceName: string;
|
|
123
|
-
};
|
|
124
|
-
type DecorateWithWorkspace<T> = T extends WithPsdAuth | WithApiAuth ? DecorateWithWorkspaceAuthenticated<T> : DecorateWithWorkspaceUnauthenticated<T> & (T extends WithDevice ? DecorateWithDeviceAndWorkspaceUnauthenticated<T> : T extends WithApiUser ? DecorateWithApiUserAndWorkspaceUnauthenticated<T> : unknown);
|
|
125
|
-
type DecorateWithWorkspaceUnauthenticated<T> = {
|
|
126
|
-
/**
|
|
127
|
-
* Directly pass a PsdAuth token
|
|
128
|
-
*/
|
|
129
|
-
withPsdToken: (token: string) => Engine<T & WithPsdAuth>;
|
|
130
|
-
};
|
|
131
|
-
type DecorateWithWorkspaceAuthenticated<T> = T extends WithDevice ? DecorateWithWorkspacePsdAuthenticated : T extends WithApiUser ? DecorateWithWorkspaceApiAuthenticated : unknown;
|
|
132
|
-
type OnboardingOperationParams = {
|
|
133
|
-
onScreenDisplayed?: () => void | Promise<void>;
|
|
134
|
-
};
|
|
135
|
-
type CorrelationIdOpts = {
|
|
136
|
-
correlationId?: string;
|
|
137
|
-
};
|
|
138
|
-
type ApproveRequestParams = {
|
|
139
|
-
onScreenDisplayed?: () => void | Promise<void>;
|
|
140
|
-
onPsdChallengeSigned?: () => void | Promise<void>;
|
|
141
|
-
} & CorrelationIdOpts;
|
|
142
|
-
type DecorateWithWorkspacePsdAuthenticated = {
|
|
143
|
-
/**
|
|
144
|
-
* Approve the given request
|
|
145
|
-
*/
|
|
146
|
-
approve: (request: VaultRequestResponse, params?: ApproveRequestParams) => Promise<VaultRequestResponse>;
|
|
147
|
-
/**
|
|
148
|
-
* Approve the given challenge
|
|
149
|
-
*/
|
|
150
|
-
approveChallenge: (challenge: PsdChallenge, params?: ApproveRequestParams) => Promise<string>;
|
|
151
|
-
/**
|
|
152
|
-
* Reject the given request
|
|
153
|
-
*/
|
|
154
|
-
reject: (request: VaultRequestResponse) => Promise<VaultRequestResponse>;
|
|
155
|
-
};
|
|
156
|
-
type DecorateWithWorkspaceApiAuthenticated = {
|
|
157
|
-
/**
|
|
158
|
-
* Get API challenge for the given request
|
|
159
|
-
*/
|
|
160
|
-
getChallenge: (request: VaultRequestResponse) => Promise<ApiChallenge["payload"]>;
|
|
161
|
-
/**
|
|
162
|
-
* Approve the given request
|
|
163
|
-
*/
|
|
164
|
-
approve: (request: VaultRequestResponse, signature: string) => Promise<VaultRequestResponse>;
|
|
165
|
-
/**
|
|
166
|
-
* Reject the given request
|
|
167
|
-
*/
|
|
168
|
-
reject: (request: VaultRequestResponse, signature: string) => Promise<VaultRequestResponse>;
|
|
169
|
-
};
|
|
170
|
-
type DecorateWithDeviceAndWorkspaceUnauthenticated<T> = {
|
|
171
|
-
/**
|
|
172
|
-
* Login using the workspace & device that the engine are targeting
|
|
173
|
-
*/
|
|
174
|
-
login: (opts?: {
|
|
175
|
-
validityDurationSecs?: number;
|
|
176
|
-
onScreenDisplayed?: () => void | Promise<void>;
|
|
177
|
-
correlationId?: string;
|
|
178
|
-
}) => Promise<Engine<T & WithPsdAuth>>;
|
|
179
|
-
/**
|
|
180
|
-
* Register the current device
|
|
181
|
-
*/
|
|
182
|
-
register: (registration: UserRegistrationResponse) => Promise<UserRegistrationResponse>;
|
|
183
|
-
};
|
|
184
|
-
type WithPsdAuth = {
|
|
185
|
-
__psdToken: string;
|
|
186
|
-
};
|
|
187
|
-
type DecorateWithApiUserAndWorkspaceUnauthenticated<T> = {
|
|
188
|
-
/**
|
|
189
|
-
* Login using the workspace that the engine target and the given credentials
|
|
190
|
-
*/
|
|
191
|
-
login: (credentials: {
|
|
192
|
-
apiKeyId: string;
|
|
193
|
-
apiKeySecret: string;
|
|
194
|
-
}, options?: {
|
|
195
|
-
correlationId?: string;
|
|
196
|
-
}) => Promise<Engine<T & WithApiAuth>>;
|
|
197
|
-
};
|
|
198
|
-
type WithApiAuth = {
|
|
199
|
-
__apiAuth: RouterOutputs["auth"]["authenticate"];
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
export type { ApproveRequestParams as A, CorrelationIdOpts as C, DecorateWithApiUserAndWorkspaceUnauthenticated as D, Engine as E, OnboardingOperationParams as O, RegisterOnboardingDeviceParams as R, WithOnboarding as W, EngineOptions as a, DecorateWithDevice as b, DecorateWithDeviceAndOnboarding as c, DecorateWithDeviceAndWorkspaceUnauthenticated as d, DecorateWithWorkspace as e, DecorateWithWorkspaceApiAuthenticated as f, DecorateWithWorkspacePsdAuthenticated as g, DecorateWithWorkspaceUnauthenticated as h, EngineBase as i, WithApiAuth as j, WithApiUser as k, WithDevice as l, WithPsdAuth as m, WithWorkspace as n };
|
package/lib/types-DJfbanPz.d.cts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { PsdAuthChallengeResponse, HsmCertificate, PubKey, PsdPairingData } from '@ledgerhq/revault-api';
|
|
2
|
-
|
|
3
|
-
type Device = {
|
|
4
|
-
/**
|
|
5
|
-
* Authenticate (resolve challenge for login)
|
|
6
|
-
*/
|
|
7
|
-
authenticate: (opts: {
|
|
8
|
-
challenge: PsdAuthChallengeResponse;
|
|
9
|
-
workspaceName: string;
|
|
10
|
-
}) => Promise<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Finalize pairing
|
|
13
|
-
*/
|
|
14
|
-
finalizePairingHandshake: (opts: {
|
|
15
|
-
handshake: string;
|
|
16
|
-
partitionId: string;
|
|
17
|
-
handshakeAttestation: HsmCertificate;
|
|
18
|
-
}) => Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Generate seed fragment from Shared-Owner device
|
|
21
|
-
*/
|
|
22
|
-
generateSeedFragment: () => Promise<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Generate Wrapping Key fragment from Wrapping-Key Owner device
|
|
25
|
-
*/
|
|
26
|
-
generateWrappingKeyFragment: () => Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Get device attestation
|
|
29
|
-
*/
|
|
30
|
-
getAttestation: () => Promise<{
|
|
31
|
-
attestation: {
|
|
32
|
-
codeHash: string;
|
|
33
|
-
attestationPub: string;
|
|
34
|
-
certificate: string;
|
|
35
|
-
};
|
|
36
|
-
buffer: Buffer;
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* Get device confidentiality key
|
|
40
|
-
*/
|
|
41
|
-
getConfidentialityKey: () => Promise<{
|
|
42
|
-
confidentialityKeyCurve25519: string;
|
|
43
|
-
confidentialityKeySignature: string;
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Get device confidentiality public key
|
|
47
|
-
*/
|
|
48
|
-
getConfidentialityPubKey: () => Promise<{
|
|
49
|
-
pubKey: string;
|
|
50
|
-
signature: string;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Get device user id (the 16 chars user identifier displayed on Vault app)
|
|
54
|
-
*/
|
|
55
|
-
getDeviceUserId: () => Promise<string>;
|
|
56
|
-
/**
|
|
57
|
-
* Get device U2F public key
|
|
58
|
-
*/
|
|
59
|
-
getU2FPubKey: () => Promise<{
|
|
60
|
-
pubKey: string;
|
|
61
|
-
signature: string;
|
|
62
|
-
}>;
|
|
63
|
-
/**
|
|
64
|
-
* Get device validation public key
|
|
65
|
-
*/
|
|
66
|
-
getValidationPubKey: () => Promise<{
|
|
67
|
-
pubKey: string;
|
|
68
|
-
signature: string;
|
|
69
|
-
}>;
|
|
70
|
-
/**
|
|
71
|
-
* Check is device has partition pairing
|
|
72
|
-
*/
|
|
73
|
-
hasPairing: () => Promise<boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* Initialize pairing handshake
|
|
76
|
-
*/
|
|
77
|
-
initPairingHandshake: () => Promise<{
|
|
78
|
-
pubKey: string;
|
|
79
|
-
signature: string;
|
|
80
|
-
}>;
|
|
81
|
-
/**
|
|
82
|
-
* Open session
|
|
83
|
-
*/
|
|
84
|
-
openSession: (opts: {
|
|
85
|
-
secureChannel: {
|
|
86
|
-
pubKey: PubKey;
|
|
87
|
-
certificate: HsmCertificate;
|
|
88
|
-
};
|
|
89
|
-
}) => Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Register device
|
|
92
|
-
*/
|
|
93
|
-
register: (opts: {
|
|
94
|
-
challenge: string;
|
|
95
|
-
u2fRegisterData: string;
|
|
96
|
-
name: string;
|
|
97
|
-
role: "ADMIN" | "SHARED_OWNER" | "OPERATOR";
|
|
98
|
-
}) => Promise<{
|
|
99
|
-
u2fRegister: Buffer;
|
|
100
|
-
keyHandle: Buffer;
|
|
101
|
-
rfu: number;
|
|
102
|
-
pubKey: string;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Register data
|
|
106
|
-
*/
|
|
107
|
-
registerData: (opts: {
|
|
108
|
-
challenge: string;
|
|
109
|
-
}) => Promise<string>;
|
|
110
|
-
/**
|
|
111
|
-
* Inject partition pairing
|
|
112
|
-
*/
|
|
113
|
-
setPairing: (opts: {
|
|
114
|
-
pairing: PsdPairingData;
|
|
115
|
-
}) => Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Start KK pattern (related to noise channel)
|
|
118
|
-
*/
|
|
119
|
-
startKKPatternAsResponder: (opts: {
|
|
120
|
-
handshake: string;
|
|
121
|
-
handshakeAttestation: HsmCertificate;
|
|
122
|
-
partitionId: string;
|
|
123
|
-
}) => Promise<{
|
|
124
|
-
handshake: string;
|
|
125
|
-
signature: string;
|
|
126
|
-
}>;
|
|
127
|
-
/**
|
|
128
|
-
* Start K pattern (related to noise channel)
|
|
129
|
-
*/
|
|
130
|
-
startKPatternAsResponder: (opts: {
|
|
131
|
-
handshake: string;
|
|
132
|
-
handshakeAttestation: HsmCertificate;
|
|
133
|
-
partitionId: string;
|
|
134
|
-
}) => Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* Approve with device
|
|
137
|
-
*/
|
|
138
|
-
validateVaultOperation: (opts: {
|
|
139
|
-
actions: string[];
|
|
140
|
-
}) => Promise<string>;
|
|
141
|
-
/**
|
|
142
|
-
* Send arbitrary APDU
|
|
143
|
-
* apduCommand in HEX string format
|
|
144
|
-
*/
|
|
145
|
-
sendAPDU: (apduCommand: string) => Promise<string>;
|
|
146
|
-
/**
|
|
147
|
-
* Get app version
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
getVersion: () => Promise<string>;
|
|
151
|
-
/**
|
|
152
|
-
* Poll device until it's plugged-on
|
|
153
|
-
*
|
|
154
|
-
*/
|
|
155
|
-
poll: (opts?: {
|
|
156
|
-
retryOnError?: (err: Error) => boolean;
|
|
157
|
-
}) => Promise<{
|
|
158
|
-
isAppOpened: boolean;
|
|
159
|
-
}>;
|
|
160
|
-
/**
|
|
161
|
-
* Returned when app is opened
|
|
162
|
-
* appName in string format
|
|
163
|
-
*/
|
|
164
|
-
pollApp: (name: string) => Promise<string>;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export type { Device as D };
|
package/lib/types-DJfbanPz.d.ts
DELETED
|
@@ -1,167 +0,0 @@
|
|
|
1
|
-
import { PsdAuthChallengeResponse, HsmCertificate, PubKey, PsdPairingData } from '@ledgerhq/revault-api';
|
|
2
|
-
|
|
3
|
-
type Device = {
|
|
4
|
-
/**
|
|
5
|
-
* Authenticate (resolve challenge for login)
|
|
6
|
-
*/
|
|
7
|
-
authenticate: (opts: {
|
|
8
|
-
challenge: PsdAuthChallengeResponse;
|
|
9
|
-
workspaceName: string;
|
|
10
|
-
}) => Promise<string>;
|
|
11
|
-
/**
|
|
12
|
-
* Finalize pairing
|
|
13
|
-
*/
|
|
14
|
-
finalizePairingHandshake: (opts: {
|
|
15
|
-
handshake: string;
|
|
16
|
-
partitionId: string;
|
|
17
|
-
handshakeAttestation: HsmCertificate;
|
|
18
|
-
}) => Promise<string>;
|
|
19
|
-
/**
|
|
20
|
-
* Generate seed fragment from Shared-Owner device
|
|
21
|
-
*/
|
|
22
|
-
generateSeedFragment: () => Promise<string>;
|
|
23
|
-
/**
|
|
24
|
-
* Generate Wrapping Key fragment from Wrapping-Key Owner device
|
|
25
|
-
*/
|
|
26
|
-
generateWrappingKeyFragment: () => Promise<string>;
|
|
27
|
-
/**
|
|
28
|
-
* Get device attestation
|
|
29
|
-
*/
|
|
30
|
-
getAttestation: () => Promise<{
|
|
31
|
-
attestation: {
|
|
32
|
-
codeHash: string;
|
|
33
|
-
attestationPub: string;
|
|
34
|
-
certificate: string;
|
|
35
|
-
};
|
|
36
|
-
buffer: Buffer;
|
|
37
|
-
}>;
|
|
38
|
-
/**
|
|
39
|
-
* Get device confidentiality key
|
|
40
|
-
*/
|
|
41
|
-
getConfidentialityKey: () => Promise<{
|
|
42
|
-
confidentialityKeyCurve25519: string;
|
|
43
|
-
confidentialityKeySignature: string;
|
|
44
|
-
}>;
|
|
45
|
-
/**
|
|
46
|
-
* Get device confidentiality public key
|
|
47
|
-
*/
|
|
48
|
-
getConfidentialityPubKey: () => Promise<{
|
|
49
|
-
pubKey: string;
|
|
50
|
-
signature: string;
|
|
51
|
-
}>;
|
|
52
|
-
/**
|
|
53
|
-
* Get device user id (the 16 chars user identifier displayed on Vault app)
|
|
54
|
-
*/
|
|
55
|
-
getDeviceUserId: () => Promise<string>;
|
|
56
|
-
/**
|
|
57
|
-
* Get device U2F public key
|
|
58
|
-
*/
|
|
59
|
-
getU2FPubKey: () => Promise<{
|
|
60
|
-
pubKey: string;
|
|
61
|
-
signature: string;
|
|
62
|
-
}>;
|
|
63
|
-
/**
|
|
64
|
-
* Get device validation public key
|
|
65
|
-
*/
|
|
66
|
-
getValidationPubKey: () => Promise<{
|
|
67
|
-
pubKey: string;
|
|
68
|
-
signature: string;
|
|
69
|
-
}>;
|
|
70
|
-
/**
|
|
71
|
-
* Check is device has partition pairing
|
|
72
|
-
*/
|
|
73
|
-
hasPairing: () => Promise<boolean>;
|
|
74
|
-
/**
|
|
75
|
-
* Initialize pairing handshake
|
|
76
|
-
*/
|
|
77
|
-
initPairingHandshake: () => Promise<{
|
|
78
|
-
pubKey: string;
|
|
79
|
-
signature: string;
|
|
80
|
-
}>;
|
|
81
|
-
/**
|
|
82
|
-
* Open session
|
|
83
|
-
*/
|
|
84
|
-
openSession: (opts: {
|
|
85
|
-
secureChannel: {
|
|
86
|
-
pubKey: PubKey;
|
|
87
|
-
certificate: HsmCertificate;
|
|
88
|
-
};
|
|
89
|
-
}) => Promise<void>;
|
|
90
|
-
/**
|
|
91
|
-
* Register device
|
|
92
|
-
*/
|
|
93
|
-
register: (opts: {
|
|
94
|
-
challenge: string;
|
|
95
|
-
u2fRegisterData: string;
|
|
96
|
-
name: string;
|
|
97
|
-
role: "ADMIN" | "SHARED_OWNER" | "OPERATOR";
|
|
98
|
-
}) => Promise<{
|
|
99
|
-
u2fRegister: Buffer;
|
|
100
|
-
keyHandle: Buffer;
|
|
101
|
-
rfu: number;
|
|
102
|
-
pubKey: string;
|
|
103
|
-
}>;
|
|
104
|
-
/**
|
|
105
|
-
* Register data
|
|
106
|
-
*/
|
|
107
|
-
registerData: (opts: {
|
|
108
|
-
challenge: string;
|
|
109
|
-
}) => Promise<string>;
|
|
110
|
-
/**
|
|
111
|
-
* Inject partition pairing
|
|
112
|
-
*/
|
|
113
|
-
setPairing: (opts: {
|
|
114
|
-
pairing: PsdPairingData;
|
|
115
|
-
}) => Promise<void>;
|
|
116
|
-
/**
|
|
117
|
-
* Start KK pattern (related to noise channel)
|
|
118
|
-
*/
|
|
119
|
-
startKKPatternAsResponder: (opts: {
|
|
120
|
-
handshake: string;
|
|
121
|
-
handshakeAttestation: HsmCertificate;
|
|
122
|
-
partitionId: string;
|
|
123
|
-
}) => Promise<{
|
|
124
|
-
handshake: string;
|
|
125
|
-
signature: string;
|
|
126
|
-
}>;
|
|
127
|
-
/**
|
|
128
|
-
* Start K pattern (related to noise channel)
|
|
129
|
-
*/
|
|
130
|
-
startKPatternAsResponder: (opts: {
|
|
131
|
-
handshake: string;
|
|
132
|
-
handshakeAttestation: HsmCertificate;
|
|
133
|
-
partitionId: string;
|
|
134
|
-
}) => Promise<void>;
|
|
135
|
-
/**
|
|
136
|
-
* Approve with device
|
|
137
|
-
*/
|
|
138
|
-
validateVaultOperation: (opts: {
|
|
139
|
-
actions: string[];
|
|
140
|
-
}) => Promise<string>;
|
|
141
|
-
/**
|
|
142
|
-
* Send arbitrary APDU
|
|
143
|
-
* apduCommand in HEX string format
|
|
144
|
-
*/
|
|
145
|
-
sendAPDU: (apduCommand: string) => Promise<string>;
|
|
146
|
-
/**
|
|
147
|
-
* Get app version
|
|
148
|
-
*
|
|
149
|
-
*/
|
|
150
|
-
getVersion: () => Promise<string>;
|
|
151
|
-
/**
|
|
152
|
-
* Poll device until it's plugged-on
|
|
153
|
-
*
|
|
154
|
-
*/
|
|
155
|
-
poll: (opts?: {
|
|
156
|
-
retryOnError?: (err: Error) => boolean;
|
|
157
|
-
}) => Promise<{
|
|
158
|
-
isAppOpened: boolean;
|
|
159
|
-
}>;
|
|
160
|
-
/**
|
|
161
|
-
* Returned when app is opened
|
|
162
|
-
* appName in string format
|
|
163
|
-
*/
|
|
164
|
-
pollApp: (name: string) => Promise<string>;
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
export type { Device as D };
|
package/lib/types.cjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/_work/revault/revault/packages/sdk/lib/types.cjs"],"names":[],"mappings":"AAAA","file":"/home/runner/_work/revault/revault/packages/sdk/lib/types.cjs"}
|
package/lib/types.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|