@cubist-labs/cubesigner-sdk 0.1.77 → 0.2.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.
- package/dist/src/client.d.ts +434 -7
- package/dist/src/client.js +1022 -18
- package/dist/src/ethers/index.d.ts +2 -4
- package/dist/src/ethers/index.js +5 -8
- package/dist/src/index.d.ts +41 -65
- package/dist/src/index.js +58 -231
- package/dist/src/key.d.ts +9 -45
- package/dist/src/key.js +18 -89
- package/dist/src/mfa.d.ts +85 -14
- package/dist/src/mfa.js +158 -40
- package/dist/src/org.d.ts +217 -127
- package/dist/src/org.js +94 -232
- package/dist/src/role.d.ts +76 -74
- package/dist/src/role.js +79 -136
- package/dist/src/schema.d.ts +345 -13
- package/dist/src/schema.js +1 -1
- package/dist/src/schema_types.d.ts +103 -0
- package/dist/src/schema_types.js +3 -0
- package/dist/src/session/session_manager.js +1 -1
- package/dist/src/session/signer_session_manager.d.ts +14 -29
- package/dist/src/session/signer_session_manager.js +26 -79
- package/dist/src/signer_session.d.ts +212 -191
- package/dist/src/signer_session.js +120 -313
- package/package.json +6 -6
- package/src/client.ts +1217 -7
- package/src/ethers/index.ts +5 -17
- package/src/index.ts +69 -262
- package/src/key.ts +19 -121
- package/src/{fido.ts → mfa.ts} +62 -26
- package/src/org.ts +96 -292
- package/src/role.ts +108 -181
- package/src/schema.ts +345 -13
- package/src/schema_types.ts +103 -0
- package/src/session/session_manager.ts +1 -1
- package/src/session/signer_session_manager.ts +35 -109
- package/src/signer_session.ts +115 -442
package/src/schema.ts
CHANGED
|
@@ -8,7 +8,6 @@ export interface paths {
|
|
|
8
8
|
"/v0/about_me": {
|
|
9
9
|
/**
|
|
10
10
|
* User Info
|
|
11
|
-
* @deprecated
|
|
12
11
|
* @description User Info
|
|
13
12
|
*
|
|
14
13
|
* Retrieves information about the current user.
|
|
@@ -395,6 +394,15 @@ export interface paths {
|
|
|
395
394
|
*/
|
|
396
395
|
delete: operations["revokeSessions"];
|
|
397
396
|
};
|
|
397
|
+
"/v0/org/{org_id}/session/self": {
|
|
398
|
+
/**
|
|
399
|
+
* Revoke current session
|
|
400
|
+
* @description Revoke current session
|
|
401
|
+
*
|
|
402
|
+
* Immediately revokes the current session, preventing it from being used or refreshed
|
|
403
|
+
*/
|
|
404
|
+
delete: operations["revokeCurrentSession"];
|
|
405
|
+
};
|
|
398
406
|
"/v0/org/{org_id}/session/{session_id}": {
|
|
399
407
|
/**
|
|
400
408
|
* Get session information
|
|
@@ -711,6 +719,10 @@ export interface components {
|
|
|
711
719
|
mfa_policy?: Record<string, unknown> | null;
|
|
712
720
|
role: components["schemas"]["MemberRole"];
|
|
713
721
|
};
|
|
722
|
+
AddThirdPartyUserResponse: {
|
|
723
|
+
/** @example User#c3b9379c-4e8c-4216-bd0a-65ace53cf98f */
|
|
724
|
+
user_id: string;
|
|
725
|
+
};
|
|
714
726
|
ApprovalInfo: {
|
|
715
727
|
timestamp: components["schemas"]["EpochDateTime"];
|
|
716
728
|
};
|
|
@@ -860,6 +872,10 @@ export interface components {
|
|
|
860
872
|
*/
|
|
861
873
|
tx: Record<string, never>;
|
|
862
874
|
};
|
|
875
|
+
AvaSignResponse: {
|
|
876
|
+
/** @description The hex-encoded signature. */
|
|
877
|
+
signature: string;
|
|
878
|
+
};
|
|
863
879
|
/** @description Wrapper around a zeroizing 32-byte fixed-size array */
|
|
864
880
|
B32: string;
|
|
865
881
|
/**
|
|
@@ -876,6 +892,10 @@ export interface components {
|
|
|
876
892
|
*/
|
|
877
893
|
message_base64: string;
|
|
878
894
|
};
|
|
895
|
+
BlobSignResponse: {
|
|
896
|
+
/** @description The hex-encoded signature. */
|
|
897
|
+
signature: string;
|
|
898
|
+
};
|
|
879
899
|
/** @enum {string} */
|
|
880
900
|
BtcSighashType: "All" | "None" | "Single" | "AllPlusAnyoneCanPay" | "NonePlusAnyoneCanPay" | "SinglePlusAnyoneCanPay";
|
|
881
901
|
BtcSignRequest: {
|
|
@@ -883,6 +903,13 @@ export interface components {
|
|
|
883
903
|
/** @description The bitcoin transaction to sign */
|
|
884
904
|
tx: Record<string, never>;
|
|
885
905
|
};
|
|
906
|
+
BtcSignResponse: {
|
|
907
|
+
/**
|
|
908
|
+
* @description The hex-encoded signature in compact format.
|
|
909
|
+
* @example 0x454aef27c21df7dd8f537dc869f4cd65286ce239a52d36470f4d85be85a891b02789e5ffd8560b32a98110e5d0096802e4c14145cf6c44f10a768c87755eaa4800
|
|
910
|
+
*/
|
|
911
|
+
signature: string;
|
|
912
|
+
};
|
|
886
913
|
BtcSignatureKind: {
|
|
887
914
|
/** @description Segregated Witness */
|
|
888
915
|
Segwit: {
|
|
@@ -936,6 +963,18 @@ export interface components {
|
|
|
936
963
|
/** @enum {string} */
|
|
937
964
|
type: "fido";
|
|
938
965
|
};
|
|
966
|
+
CreateKeyImportKeyResponse: components["schemas"]["KeyImportKey"] & {
|
|
967
|
+
/**
|
|
968
|
+
* @description An attestation document from a secure enclave, including an
|
|
969
|
+
* RSA signing key used to sign the contents of this message.
|
|
970
|
+
*/
|
|
971
|
+
enclave_attestation: string;
|
|
972
|
+
/**
|
|
973
|
+
* @description An RSA-PSS-SHA256 signature on the public key and encrypted
|
|
974
|
+
* secrets attesting to their generation inside a secure enclave.
|
|
975
|
+
*/
|
|
976
|
+
enclave_signature: string;
|
|
977
|
+
};
|
|
939
978
|
CreateKeyRequest: {
|
|
940
979
|
/**
|
|
941
980
|
* Format: int64
|
|
@@ -956,6 +995,10 @@ export interface components {
|
|
|
956
995
|
*/
|
|
957
996
|
owner?: string | null;
|
|
958
997
|
};
|
|
998
|
+
CreateKeyResponse: {
|
|
999
|
+
/** @description The info about the created keys */
|
|
1000
|
+
keys: components["schemas"]["KeyInfo"][];
|
|
1001
|
+
};
|
|
959
1002
|
/** @description Optional create role request body */
|
|
960
1003
|
CreateRoleRequest: {
|
|
961
1004
|
/**
|
|
@@ -964,6 +1007,19 @@ export interface components {
|
|
|
964
1007
|
*/
|
|
965
1008
|
name: string;
|
|
966
1009
|
};
|
|
1010
|
+
/** @description The newly created role information */
|
|
1011
|
+
CreateRoleResponse: {
|
|
1012
|
+
/**
|
|
1013
|
+
* @description A human-readable name for the role.
|
|
1014
|
+
* @example my_role
|
|
1015
|
+
*/
|
|
1016
|
+
name?: string | null;
|
|
1017
|
+
/**
|
|
1018
|
+
* @description The id of the newly created role
|
|
1019
|
+
* @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
|
|
1020
|
+
*/
|
|
1021
|
+
role_id: string;
|
|
1022
|
+
};
|
|
967
1023
|
CreateTokenRequest: components["schemas"]["RatchetConfig"] & ({
|
|
968
1024
|
/**
|
|
969
1025
|
* @description A human readable description of the purpose of the key
|
|
@@ -1126,8 +1182,20 @@ export interface components {
|
|
|
1126
1182
|
/** @description EIP-712 typed data. Refer to the JSON schema defined in EIP-712. */
|
|
1127
1183
|
typed_data: Record<string, never>;
|
|
1128
1184
|
};
|
|
1185
|
+
Eip712SignResponse: {
|
|
1186
|
+
/**
|
|
1187
|
+
* @description Hex-encoded signature comprising 65 bytes in the format required
|
|
1188
|
+
* by ecrecover: 32-byte r, 32-byte s, and one-byte recovery-id v
|
|
1189
|
+
* which is either 27 or 28.
|
|
1190
|
+
* @example 0x4355c47d63924e8a72e509b65029052eb6c299d53a04e167c5775fd466751c9d07299936d304c153f6443dfa05f40ff007d72911b6f72307f996231605b915621c
|
|
1191
|
+
*/
|
|
1192
|
+
signature: string;
|
|
1193
|
+
};
|
|
1129
1194
|
/** @default null */
|
|
1130
1195
|
Empty: Record<string, unknown> | null;
|
|
1196
|
+
EmptyImpl: {
|
|
1197
|
+
status: string;
|
|
1198
|
+
};
|
|
1131
1199
|
/**
|
|
1132
1200
|
* @description Epoch is a quoted `uint64`.
|
|
1133
1201
|
* @example 256
|
|
@@ -1177,6 +1245,13 @@ export interface components {
|
|
|
1177
1245
|
*/
|
|
1178
1246
|
tx: Record<string, never>;
|
|
1179
1247
|
};
|
|
1248
|
+
Eth1SignResponse: {
|
|
1249
|
+
/**
|
|
1250
|
+
* @description Hex-encoded RLP encoding of the transaction and its signature
|
|
1251
|
+
* @example 0x22895118000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000e000000000000000000000000000000000000000000000000000000000000001201d58656b0e22aaa68fdc692db41979098c3886ed33015d7467de9211609cdac000000000000000000000000000000000000000000000000000000000000000308b0c2900324d3ff9adfba7fdfe5af3f9b2cdbeef7b280437bbf1b1c59a093d615afe3e5dfed9622b540cdd9b49b3c5ad00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002001000000000000000000000049011adbcc3bc9c0307bb07f37dda1a1a9c69d2e0000000000000000000000000000000000000000000000000000000000000060903db8525674b8e7904f9b7d7d9ec55a0a42d33cf58be25469b0c21bbb6d06172bc5bb5fd1aed8e4f35936968958116b0619553c2cb1c52e7323074c6f8eb3d5a7074fc6580148df907837fa3b164ad7fbc2288dad1e8a5b021095b57c8a36d4
|
|
1252
|
+
*/
|
|
1253
|
+
rlp_signed_tx: string;
|
|
1254
|
+
};
|
|
1180
1255
|
/**
|
|
1181
1256
|
* @example {
|
|
1182
1257
|
* "eth2_sign_request": {
|
|
@@ -1206,18 +1281,39 @@ export interface components {
|
|
|
1206
1281
|
eth2_sign_request: Record<string, never>;
|
|
1207
1282
|
network: components["schemas"]["Network"];
|
|
1208
1283
|
};
|
|
1284
|
+
Eth2SignResponse: {
|
|
1285
|
+
/**
|
|
1286
|
+
* @description Hex encoded signature prefixed with 0x e.g. "0x0000..."
|
|
1287
|
+
* @example 0xb4f2ef9d12a54e1f569596c07c97d6d730535b6ffc0d287761dc78103a86326782471a04c75ce7a6faea08ca9a4a0830031cdcb893da8711d54aa22619f1a7e71b8185ddf4c6bfd9babbd735960e35e56bd6eeb89625b04850e7a9ef8846e549
|
|
1288
|
+
*/
|
|
1289
|
+
signature: string;
|
|
1290
|
+
};
|
|
1209
1291
|
/** @description Sent from the client to the server to answer a fido challenge */
|
|
1210
1292
|
FidoAssertAnswer: {
|
|
1211
1293
|
/** @description The ID of the challenge that was returned from the POST endpoint */
|
|
1212
1294
|
challenge_id: string;
|
|
1213
1295
|
credential: components["schemas"]["PublicKeyCredential"];
|
|
1214
1296
|
};
|
|
1297
|
+
FidoAssertChallenge: {
|
|
1298
|
+
/** @description The id of the challenge. Must be supplied when answering the challenge. */
|
|
1299
|
+
challenge_id: string;
|
|
1300
|
+
options: components["schemas"]["PublicKeyCredentialRequestOptions"];
|
|
1301
|
+
};
|
|
1215
1302
|
/** @description Sent from the client to the server to answer a fido challenge */
|
|
1216
1303
|
FidoCreateChallengeAnswer: {
|
|
1217
1304
|
/** @description The ID of the challenge that was returned from the POST endpoint */
|
|
1218
1305
|
challenge_id: string;
|
|
1219
1306
|
credential: components["schemas"]["PublicKeyCredential"];
|
|
1220
1307
|
};
|
|
1308
|
+
/**
|
|
1309
|
+
* @description Sent by the server to the client. Contains the challenge data that must be
|
|
1310
|
+
* used to generate a new credential
|
|
1311
|
+
*/
|
|
1312
|
+
FidoCreateChallengeResponse: {
|
|
1313
|
+
/** @description The id of the challenge. Must be supplied when answering the challenge. */
|
|
1314
|
+
challenge_id: string;
|
|
1315
|
+
options: components["schemas"]["PublicKeyCredentialCreationOptions"];
|
|
1316
|
+
};
|
|
1221
1317
|
/** @description Declares intent to register a new FIDO key */
|
|
1222
1318
|
FidoCreateRequest: {
|
|
1223
1319
|
/**
|
|
@@ -1275,6 +1371,10 @@ export interface components {
|
|
|
1275
1371
|
GetKeysInOrgRequest: {
|
|
1276
1372
|
key_type?: components["schemas"]["KeyType"] | null;
|
|
1277
1373
|
};
|
|
1374
|
+
GetUsersInOrgResponse: {
|
|
1375
|
+
/** @description The list of users in the org */
|
|
1376
|
+
users: components["schemas"]["UserIdInfo"][];
|
|
1377
|
+
};
|
|
1278
1378
|
/** @description Stats pertaining the the sender `cube3signer` instance */
|
|
1279
1379
|
HeartbeatRequest: {
|
|
1280
1380
|
/**
|
|
@@ -1500,6 +1600,9 @@ export interface components {
|
|
|
1500
1600
|
*/
|
|
1501
1601
|
purpose: string;
|
|
1502
1602
|
};
|
|
1603
|
+
KeyInfos: {
|
|
1604
|
+
keys: components["schemas"]["KeyInfo"][];
|
|
1605
|
+
};
|
|
1503
1606
|
/** @enum {string} */
|
|
1504
1607
|
KeyType: "SecpEthAddr" | "SecpBtc" | "SecpBtcTest" | "SecpAvaAddr" | "SecpAvaTestAddr" | "BlsPub" | "BlsInactive" | "Ed25519SolanaAddr" | "Ed25519SuiAddr" | "Ed25519AptosAddr" | "Ed25519CardanoAddrVk" | "Ed25519StellarAddr" | "Mnemonic" | "Stark";
|
|
1505
1608
|
/**
|
|
@@ -1509,6 +1612,13 @@ export interface components {
|
|
|
1509
1612
|
* so that they can pass this back to us as a url query parameter.
|
|
1510
1613
|
*/
|
|
1511
1614
|
LastEvalKey: string;
|
|
1615
|
+
ListMfaResponse: {
|
|
1616
|
+
/** @description All pending MFA requests */
|
|
1617
|
+
mfa_requests: components["schemas"]["MfaRequestInfo"][];
|
|
1618
|
+
};
|
|
1619
|
+
ListTokensResponse: {
|
|
1620
|
+
tokens: components["schemas"]["TokenInfo"][];
|
|
1621
|
+
};
|
|
1512
1622
|
/**
|
|
1513
1623
|
* @description Describes whether a user in an org is an Owner or just a regular member
|
|
1514
1624
|
* @enum {string}
|
|
@@ -1550,11 +1660,6 @@ export interface components {
|
|
|
1550
1660
|
* a single OIDC user to multiple `User`s in CubeSigner
|
|
1551
1661
|
*/
|
|
1552
1662
|
OIDCIdentity: {
|
|
1553
|
-
/**
|
|
1554
|
-
* @description Free-form additional user info.
|
|
1555
|
-
* @example null
|
|
1556
|
-
*/
|
|
1557
|
-
disambiguator?: string | null;
|
|
1558
1663
|
/**
|
|
1559
1664
|
* @description The root-level issuer who administrates this user. Frome the OIDC spec:
|
|
1560
1665
|
* Issuer Identifier for the Issuer of the response. The iss
|
|
@@ -1648,6 +1753,80 @@ export interface components {
|
|
|
1648
1753
|
*/
|
|
1649
1754
|
"page.start"?: string | null;
|
|
1650
1755
|
};
|
|
1756
|
+
/**
|
|
1757
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
1758
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
1759
|
+
*/
|
|
1760
|
+
PaginatedListKeysResponse: {
|
|
1761
|
+
keys: components["schemas"]["KeyInfo"][];
|
|
1762
|
+
} & ({
|
|
1763
|
+
/**
|
|
1764
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
1765
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
1766
|
+
* but specify this value as the 'page.start' query parameter.
|
|
1767
|
+
*/
|
|
1768
|
+
last_evaluated_key?: string | null;
|
|
1769
|
+
});
|
|
1770
|
+
/**
|
|
1771
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
1772
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
1773
|
+
*/
|
|
1774
|
+
PaginatedListRoleKeysResponse: {
|
|
1775
|
+
/** @description All keys in a role */
|
|
1776
|
+
keys: components["schemas"]["KeyInRoleInfo"][];
|
|
1777
|
+
} & ({
|
|
1778
|
+
/**
|
|
1779
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
1780
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
1781
|
+
* but specify this value as the 'page.start' query parameter.
|
|
1782
|
+
*/
|
|
1783
|
+
last_evaluated_key?: string | null;
|
|
1784
|
+
});
|
|
1785
|
+
/**
|
|
1786
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
1787
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
1788
|
+
*/
|
|
1789
|
+
PaginatedListRoleUsersResponse: {
|
|
1790
|
+
/** @description All users in a role */
|
|
1791
|
+
users: components["schemas"]["UserInRoleInfo"][];
|
|
1792
|
+
} & ({
|
|
1793
|
+
/**
|
|
1794
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
1795
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
1796
|
+
* but specify this value as the 'page.start' query parameter.
|
|
1797
|
+
*/
|
|
1798
|
+
last_evaluated_key?: string | null;
|
|
1799
|
+
});
|
|
1800
|
+
/**
|
|
1801
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
1802
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
1803
|
+
*/
|
|
1804
|
+
PaginatedListRolesResponse: {
|
|
1805
|
+
/** @description All roles in an organization. */
|
|
1806
|
+
roles: components["schemas"]["RoleInfo"][];
|
|
1807
|
+
} & ({
|
|
1808
|
+
/**
|
|
1809
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
1810
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
1811
|
+
* but specify this value as the 'page.start' query parameter.
|
|
1812
|
+
*/
|
|
1813
|
+
last_evaluated_key?: string | null;
|
|
1814
|
+
});
|
|
1815
|
+
/**
|
|
1816
|
+
* @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
|
|
1817
|
+
* value (which can the user pass back to use as a url query parameter to continue pagination).
|
|
1818
|
+
*/
|
|
1819
|
+
PaginatedSessionsResponse: {
|
|
1820
|
+
/** @description The list of sessions */
|
|
1821
|
+
sessions: components["schemas"]["SessionInfo"][];
|
|
1822
|
+
} & ({
|
|
1823
|
+
/**
|
|
1824
|
+
* @description If set, the content of `response` does not contain the entire result set.
|
|
1825
|
+
* To fetch the next page of the result set, call the same endpoint
|
|
1826
|
+
* but specify this value as the 'page.start' query parameter.
|
|
1827
|
+
*/
|
|
1828
|
+
last_evaluated_key?: string | null;
|
|
1829
|
+
});
|
|
1651
1830
|
/**
|
|
1652
1831
|
* @description This type represents a wire-encodable form of the PublicKeyCredential interface
|
|
1653
1832
|
* Clients may need to manually encode into this format to communicate with the server
|
|
@@ -1743,7 +1922,7 @@ export interface components {
|
|
|
1743
1922
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialcreationoptions-timeout
|
|
1744
1923
|
*/
|
|
1745
1924
|
timeout?: number | null;
|
|
1746
|
-
user
|
|
1925
|
+
user: components["schemas"]["PublicKeyCredentialUserEntity"];
|
|
1747
1926
|
};
|
|
1748
1927
|
/**
|
|
1749
1928
|
* @description This dictionary contains the attributes that are specified by a caller when
|
|
@@ -1849,7 +2028,7 @@ export interface components {
|
|
|
1849
2028
|
*
|
|
1850
2029
|
* https://www.w3.org/TR/webauthn-2/#dom-publickeycredentialrpentity-id
|
|
1851
2030
|
*/
|
|
1852
|
-
id
|
|
2031
|
+
id?: string | null;
|
|
1853
2032
|
/**
|
|
1854
2033
|
* @description A human-palatable name for the entity. Its function depends on what the
|
|
1855
2034
|
* PublicKeyCredentialEntity represents: When inherited by
|
|
@@ -1993,6 +2172,13 @@ export interface components {
|
|
|
1993
2172
|
* @enum {string}
|
|
1994
2173
|
*/
|
|
1995
2174
|
ResidentKeyRequirement: "discouraged" | "preferred" | "required";
|
|
2175
|
+
RevokeTokenResponse: {
|
|
2176
|
+
token?: components["schemas"]["TokenInfo"] | null;
|
|
2177
|
+
};
|
|
2178
|
+
RevokeTokensResponse: {
|
|
2179
|
+
/** @description Tokens that were revoked. */
|
|
2180
|
+
revoked: components["schemas"]["TokenInfo"][];
|
|
2181
|
+
};
|
|
1996
2182
|
RoleInfo: {
|
|
1997
2183
|
/**
|
|
1998
2184
|
* @description Whether the role is enabled
|
|
@@ -2006,6 +2192,22 @@ export interface components {
|
|
|
2006
2192
|
* @example my_role
|
|
2007
2193
|
*/
|
|
2008
2194
|
name?: string | null;
|
|
2195
|
+
/**
|
|
2196
|
+
* @description Policy that is checked whenever a key is accessed for signing via this role.
|
|
2197
|
+
* @example [
|
|
2198
|
+
* {
|
|
2199
|
+
* "SourceIpAllowlist": [
|
|
2200
|
+
* "123.456.78.9/16"
|
|
2201
|
+
* ]
|
|
2202
|
+
* },
|
|
2203
|
+
* {
|
|
2204
|
+
* "RequireMfa": {
|
|
2205
|
+
* "count": 1
|
|
2206
|
+
* }
|
|
2207
|
+
* }
|
|
2208
|
+
* ]
|
|
2209
|
+
*/
|
|
2210
|
+
policy?: Record<string, never>[];
|
|
2009
2211
|
/**
|
|
2010
2212
|
* @description The ID of the role
|
|
2011
2213
|
* @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
|
|
@@ -2032,10 +2234,24 @@ export interface components {
|
|
|
2032
2234
|
*/
|
|
2033
2235
|
session_id: string;
|
|
2034
2236
|
};
|
|
2035
|
-
|
|
2036
|
-
|
|
2237
|
+
/** @description The response from any operation operating on multiple sessions */
|
|
2238
|
+
SessionsResponse: {
|
|
2239
|
+
/** @description The list of sessions */
|
|
2240
|
+
sessions: components["schemas"]["SessionInfo"][];
|
|
2241
|
+
};
|
|
2242
|
+
/**
|
|
2243
|
+
* @example {
|
|
2244
|
+
* "message_base64": "AQABA8OKVzLEjststN4xXr39kLKHT8d58eQY1QEs6MeXwEFBrxTAlULX1troLbWxuAXQqgbQofGi6z8fJi7KAAIf7YMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJK0tn39k28s+X86W47EvbRRKnYBVQ8Q/l2m1EbfT7+vAQICAAEMAgAAAGQAAAAAAAAA"
|
|
2245
|
+
* }
|
|
2246
|
+
*/
|
|
2247
|
+
SolanaSignRequest: {
|
|
2248
|
+
/** @description Solana base64-encoded serialized Message */
|
|
2249
|
+
message_base64: string;
|
|
2250
|
+
};
|
|
2251
|
+
SolanaSignResponse: {
|
|
2252
|
+
/** @description The hex-encoded signature. */
|
|
2253
|
+
signature: string;
|
|
2037
2254
|
};
|
|
2038
|
-
SolanaSignRequest: components["schemas"]["SignRequest"] & Record<string, never>;
|
|
2039
2255
|
StakeRequest: {
|
|
2040
2256
|
/**
|
|
2041
2257
|
* Format: int64
|
|
@@ -2064,6 +2280,14 @@ export interface components {
|
|
|
2064
2280
|
*/
|
|
2065
2281
|
withdrawal_addr: string;
|
|
2066
2282
|
};
|
|
2283
|
+
StakeResponse: {
|
|
2284
|
+
/**
|
|
2285
|
+
* @description The validator key id ("Key#...")
|
|
2286
|
+
* @example Key#db1731f8-3659-45c0-885b-e11e1f5b7be2
|
|
2287
|
+
*/
|
|
2288
|
+
created_validator_key_id: string;
|
|
2289
|
+
deposit_tx: components["schemas"]["DepositTxn"];
|
|
2290
|
+
};
|
|
2067
2291
|
Status: {
|
|
2068
2292
|
/** @description Users who are allowed to approve. Must be non-empty. */
|
|
2069
2293
|
allowed_approvers: string[];
|
|
@@ -2103,6 +2327,18 @@ export interface components {
|
|
|
2103
2327
|
/** @description The ID of the challenge that was returned from the POST endpoint */
|
|
2104
2328
|
totp_id: string;
|
|
2105
2329
|
};
|
|
2330
|
+
TotpInfo: {
|
|
2331
|
+
/**
|
|
2332
|
+
* @description The ID of the TOTP challenge.
|
|
2333
|
+
* @example TotpChallenge#7892ebba-563e-485b-bb7d-e26267363286
|
|
2334
|
+
*/
|
|
2335
|
+
totp_id: string;
|
|
2336
|
+
/**
|
|
2337
|
+
* @description Standard TOTP url which includes everything needed to initialize TOTP.
|
|
2338
|
+
* @example otpauth://totp/Cubist:alice-%40example.com?secret=DAHF7KCOTQWSOMK4XFEMNHXO4J433OD7&issuer=Cubist
|
|
2339
|
+
*/
|
|
2340
|
+
totp_url: string;
|
|
2341
|
+
};
|
|
2106
2342
|
/** @description Options that should be set only for local devnet testing. */
|
|
2107
2343
|
UnsafeConf: {
|
|
2108
2344
|
/**
|
|
@@ -2149,6 +2385,22 @@ export interface components {
|
|
|
2149
2385
|
*/
|
|
2150
2386
|
validator_index: string;
|
|
2151
2387
|
};
|
|
2388
|
+
/**
|
|
2389
|
+
* @description Unstake responses are signed voluntary exit messages.
|
|
2390
|
+
* The schema for this message is defined
|
|
2391
|
+
* [here](https://github.com/ethereum/consensus-specs/blob/v1.0.1/specs/phase0/beacon-chain.md#signedvoluntaryexit).
|
|
2392
|
+
* This message can be directly POSTed to the Beacon node's
|
|
2393
|
+
* `/eth/v1/beacon/pool/voluntary_exits` end-point (see expected schema
|
|
2394
|
+
* [here](https://ethereum.github.io/beacon-APIs/#/Beacon/submitPoolVoluntaryExit)).
|
|
2395
|
+
*/
|
|
2396
|
+
UnstakeResponse: {
|
|
2397
|
+
message: components["schemas"]["VoluntaryExit"];
|
|
2398
|
+
/**
|
|
2399
|
+
* @description BLS signature.
|
|
2400
|
+
* @example 0x910c7cd537ed91cc8c4a82f3cbd832e9be8c24a22e9c86df479f7ce42025ea6a09619b418b666a060e260d2aae31b8e50e9d05ca3442c7eed3b507e5207e14674275f68c2ba84c4bf6b8dd364a304acac8cfab3681e2514b4400f9242bc61164
|
|
2401
|
+
*/
|
|
2402
|
+
signature: string;
|
|
2403
|
+
};
|
|
2152
2404
|
UpdateKeyRequest: {
|
|
2153
2405
|
/**
|
|
2154
2406
|
* @description If set, updates the keys's `enabled` property to this value.
|
|
@@ -2203,12 +2455,52 @@ export interface components {
|
|
|
2203
2455
|
*/
|
|
2204
2456
|
policy?: Record<string, never>[] | null;
|
|
2205
2457
|
};
|
|
2458
|
+
UpdateOrgResponse: {
|
|
2459
|
+
/** @description The new value of the 'enabled' property */
|
|
2460
|
+
enabled?: boolean | null;
|
|
2461
|
+
/**
|
|
2462
|
+
* @description The new human-readable name for the org (must be alphanumeric)
|
|
2463
|
+
* @example my_org_name
|
|
2464
|
+
*/
|
|
2465
|
+
name?: string | null;
|
|
2466
|
+
/**
|
|
2467
|
+
* @description The ID of the organization
|
|
2468
|
+
* @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
2469
|
+
*/
|
|
2470
|
+
org_id: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* @description The new value of org-wide policies
|
|
2473
|
+
* @example [
|
|
2474
|
+
* {
|
|
2475
|
+
* "MaxDailyUnstake": 5
|
|
2476
|
+
* },
|
|
2477
|
+
* {
|
|
2478
|
+
* "OriginAllowlist": [
|
|
2479
|
+
* "https://example.com"
|
|
2480
|
+
* ]
|
|
2481
|
+
* }
|
|
2482
|
+
* ]
|
|
2483
|
+
*/
|
|
2484
|
+
policy?: Record<string, never>[] | null;
|
|
2485
|
+
};
|
|
2206
2486
|
UpdateRoleRequest: {
|
|
2207
2487
|
/**
|
|
2208
2488
|
* @description If set, updates the role's `enabled` property to this value.
|
|
2209
2489
|
* Once disabled, a role cannot be used; and it's tokens cannot be used for signing.
|
|
2210
2490
|
*/
|
|
2211
2491
|
enabled?: boolean | null;
|
|
2492
|
+
/**
|
|
2493
|
+
* @description If set, update this role's key policies (old policies will be overwritten!).
|
|
2494
|
+
* Only "deny" style policies may be set.
|
|
2495
|
+
* @example [
|
|
2496
|
+
* {
|
|
2497
|
+
* "SourceIpAllowlist": [
|
|
2498
|
+
* "123.456.78.9/16"
|
|
2499
|
+
* ]
|
|
2500
|
+
* }
|
|
2501
|
+
* ]
|
|
2502
|
+
*/
|
|
2503
|
+
policy?: Record<string, never>[] | null;
|
|
2212
2504
|
};
|
|
2213
2505
|
UserIdInfo: {
|
|
2214
2506
|
/**
|
|
@@ -2724,6 +3016,22 @@ export interface components {
|
|
|
2724
3016
|
* @example my_role
|
|
2725
3017
|
*/
|
|
2726
3018
|
name?: string | null;
|
|
3019
|
+
/**
|
|
3020
|
+
* @description Policy that is checked whenever a key is accessed for signing via this role.
|
|
3021
|
+
* @example [
|
|
3022
|
+
* {
|
|
3023
|
+
* "SourceIpAllowlist": [
|
|
3024
|
+
* "123.456.78.9/16"
|
|
3025
|
+
* ]
|
|
3026
|
+
* },
|
|
3027
|
+
* {
|
|
3028
|
+
* "RequireMfa": {
|
|
3029
|
+
* "count": 1
|
|
3030
|
+
* }
|
|
3031
|
+
* }
|
|
3032
|
+
* ]
|
|
3033
|
+
*/
|
|
3034
|
+
policy?: Record<string, never>[];
|
|
2727
3035
|
/**
|
|
2728
3036
|
* @description The ID of the role
|
|
2729
3037
|
* @example Role#bfe3eccb-731e-430d-b1e5-ac1363e6b06b
|
|
@@ -2896,7 +3204,6 @@ export interface operations {
|
|
|
2896
3204
|
|
|
2897
3205
|
/**
|
|
2898
3206
|
* User Info
|
|
2899
|
-
* @deprecated
|
|
2900
3207
|
* @description User Info
|
|
2901
3208
|
*
|
|
2902
3209
|
* Retrieves information about the current user.
|
|
@@ -3856,7 +4163,7 @@ export interface operations {
|
|
|
3856
4163
|
};
|
|
3857
4164
|
};
|
|
3858
4165
|
responses: {
|
|
3859
|
-
200: components["responses"]["
|
|
4166
|
+
200: components["responses"]["RoleInfo"];
|
|
3860
4167
|
default: {
|
|
3861
4168
|
content: {
|
|
3862
4169
|
"application/json": components["schemas"]["ErrorResponse"];
|
|
@@ -4263,6 +4570,31 @@ export interface operations {
|
|
|
4263
4570
|
};
|
|
4264
4571
|
};
|
|
4265
4572
|
};
|
|
4573
|
+
/**
|
|
4574
|
+
* Revoke current session
|
|
4575
|
+
* @description Revoke current session
|
|
4576
|
+
*
|
|
4577
|
+
* Immediately revokes the current session, preventing it from being used or refreshed
|
|
4578
|
+
*/
|
|
4579
|
+
revokeCurrentSession: {
|
|
4580
|
+
parameters: {
|
|
4581
|
+
path: {
|
|
4582
|
+
/**
|
|
4583
|
+
* @description Name or ID of the desired Org
|
|
4584
|
+
* @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
|
|
4585
|
+
*/
|
|
4586
|
+
org_id: string;
|
|
4587
|
+
};
|
|
4588
|
+
};
|
|
4589
|
+
responses: {
|
|
4590
|
+
200: components["responses"]["EmptyImpl"];
|
|
4591
|
+
default: {
|
|
4592
|
+
content: {
|
|
4593
|
+
"application/json": components["schemas"]["ErrorResponse"];
|
|
4594
|
+
};
|
|
4595
|
+
};
|
|
4596
|
+
};
|
|
4597
|
+
};
|
|
4266
4598
|
/**
|
|
4267
4599
|
* Get session information
|
|
4268
4600
|
* @description Get session information
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { MfaPolicy } from "./role";
|
|
2
|
+
import { components } from "./schema";
|
|
3
|
+
import { JsonMap } from "./util";
|
|
4
|
+
|
|
5
|
+
type schemas = components["schemas"];
|
|
6
|
+
|
|
7
|
+
export type UserInfo = schemas["UserInfo"];
|
|
8
|
+
export type ConfiguredMfa = schemas["ConfiguredMfa"];
|
|
9
|
+
export type RatchetConfig = schemas["RatchetConfig"];
|
|
10
|
+
export type IdentityProof = schemas["IdentityProof"];
|
|
11
|
+
export type TotpInfo = schemas["TotpInfo"];
|
|
12
|
+
|
|
13
|
+
export type OidcAuthResponse = schemas["NewSessionResponse"];
|
|
14
|
+
export type ApiAddFidoChallenge = schemas["FidoCreateChallengeResponse"];
|
|
15
|
+
export type ApiMfaFidoChallenge = schemas["FidoAssertChallenge"];
|
|
16
|
+
|
|
17
|
+
export type PublicKeyCredentialCreationOptions = schemas["PublicKeyCredentialCreationOptions"];
|
|
18
|
+
export type PublicKeyCredentialRequestOptions = schemas["PublicKeyCredentialRequestOptions"];
|
|
19
|
+
export type PublicKeyCredentialParameters = schemas["PublicKeyCredentialParameters"];
|
|
20
|
+
export type PublicKeyCredentialDescriptor = schemas["PublicKeyCredentialDescriptor"];
|
|
21
|
+
export type AuthenticatorSelectionCriteria = schemas["AuthenticatorSelectionCriteria"];
|
|
22
|
+
export type PublicKeyCredentialUserEntity = schemas["PublicKeyCredentialUserEntity"];
|
|
23
|
+
export type PublicKeyCredential = schemas["PublicKeyCredential"];
|
|
24
|
+
|
|
25
|
+
export type OrgInfo = schemas["OrgInfo"];
|
|
26
|
+
export type UserIdInfo = schemas["UserIdInfo"];
|
|
27
|
+
export type UpdateOrgRequest = schemas["UpdateOrgRequest"];
|
|
28
|
+
export type UpdateOrgResponse = schemas["UpdateOrgResponse"];
|
|
29
|
+
|
|
30
|
+
export type OidcIdentity = schemas["OIDCIdentity"];
|
|
31
|
+
export type MemberRole = schemas["MemberRole"];
|
|
32
|
+
|
|
33
|
+
export type SchemaKeyType = schemas["KeyType"];
|
|
34
|
+
|
|
35
|
+
export type ListKeysResponse = schemas["PaginatedListKeysResponse"];
|
|
36
|
+
export type UpdateKeyRequest = schemas["UpdateKeyRequest"];
|
|
37
|
+
export type KeyInfoApi = schemas["KeyInfo"];
|
|
38
|
+
export type KeyInRoleInfo = schemas["KeyInRoleInfo"];
|
|
39
|
+
export type UserInRoleInfo = schemas["UserInRoleInfo"];
|
|
40
|
+
export type KeyTypeApi = schemas["KeyType"];
|
|
41
|
+
|
|
42
|
+
export type ListRolesResponse = schemas["PaginatedListRolesResponse"];
|
|
43
|
+
export type ListRoleKeysResponse = schemas["PaginatedListRoleKeysResponse"];
|
|
44
|
+
export type ListRoleUsersResponse = schemas["PaginatedListRoleUsersResponse"];
|
|
45
|
+
export type UpdateRoleRequest = schemas["UpdateRoleRequest"];
|
|
46
|
+
export type KeyWithPoliciesInfo = schemas["KeyInRoleInfo"];
|
|
47
|
+
export type RoleInfo = schemas["RoleInfo"];
|
|
48
|
+
|
|
49
|
+
export type SessionInfo = schemas["SessionInfo"];
|
|
50
|
+
export type ClientSessionInfo = schemas["ClientSessionInfo"];
|
|
51
|
+
export type NewSessionResponse = schemas["NewSessionResponse"];
|
|
52
|
+
export type SessionsResponse = schemas["PaginatedSessionsResponse"];
|
|
53
|
+
|
|
54
|
+
export type CreateSignerSessionRequest = schemas["CreateTokenRequest"];
|
|
55
|
+
export type RefreshSignerSessionRequest = schemas["AuthData"];
|
|
56
|
+
|
|
57
|
+
export type EvmSignRequest = schemas["Eth1SignRequest"];
|
|
58
|
+
export type EvmSignResponse = schemas["Eth1SignResponse"];
|
|
59
|
+
export type Eth2SignRequest = schemas["Eth2SignRequest"];
|
|
60
|
+
export type Eth2SignResponse = schemas["Eth2SignResponse"];
|
|
61
|
+
export type Eth2StakeRequest = schemas["StakeRequest"];
|
|
62
|
+
export type Eth2StakeResponse = schemas["StakeResponse"];
|
|
63
|
+
export type Eth2UnstakeRequest = schemas["UnstakeRequest"];
|
|
64
|
+
export type Eth2UnstakeResponse = schemas["UnstakeResponse"];
|
|
65
|
+
export type BlobSignRequest = schemas["BlobSignRequest"];
|
|
66
|
+
export type BlobSignResponse = schemas["BlobSignResponse"];
|
|
67
|
+
export type BtcSignRequest = schemas["BtcSignRequest"];
|
|
68
|
+
export type BtcSignResponse = schemas["BtcSignResponse"];
|
|
69
|
+
export type SolanaSignRequest = schemas["SolanaSignRequest"];
|
|
70
|
+
export type SolanaSignResponse = schemas["SolanaSignResponse"];
|
|
71
|
+
export type AvaSignRequest = schemas["AvaSignRequest"];
|
|
72
|
+
export type AvaSignResponse = schemas["AvaSignResponse"];
|
|
73
|
+
|
|
74
|
+
export type AcceptedResponse = schemas["AcceptedResponse"];
|
|
75
|
+
export type ErrorResponse = schemas["ErrorResponse"];
|
|
76
|
+
export type BtcSignatureKind = schemas["BtcSignatureKind"];
|
|
77
|
+
|
|
78
|
+
export type MfaType = schemas["MfaType"];
|
|
79
|
+
export type MfaRequestInfo = schemas["MfaRequestInfo"];
|
|
80
|
+
|
|
81
|
+
/** Options for a new OIDC user */
|
|
82
|
+
export interface CreateOidcUserOptions {
|
|
83
|
+
/** The role of an OIDC user, default is "Alien" */
|
|
84
|
+
memberRole?: MemberRole;
|
|
85
|
+
/** Optional MFA policy to associate with the user account */
|
|
86
|
+
mfaPolicy?: MfaPolicy;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/** Ava P- or X-chain transaction */
|
|
90
|
+
export type AvaTx = { P: AvaPChainTx } | { X: AvaXChainTx };
|
|
91
|
+
|
|
92
|
+
/** Ava P-chain transaction */
|
|
93
|
+
export type AvaPChainTx =
|
|
94
|
+
| { AddPermissionlessValidator: JsonMap }
|
|
95
|
+
| { AddSubnetValidator: JsonMap }
|
|
96
|
+
| { AddValidator: JsonMap }
|
|
97
|
+
| { CreateChain: JsonMap }
|
|
98
|
+
| { CreateSubnet: JsonMap }
|
|
99
|
+
| { Export: JsonMap }
|
|
100
|
+
| { Import: JsonMap };
|
|
101
|
+
|
|
102
|
+
/** Ava X-chain transaction */
|
|
103
|
+
export type AvaXChainTx = { Base: JsonMap } | { Export: JsonMap } | { Import: JsonMap };
|