@cubist-labs/cubesigner-sdk 0.3.1 → 0.3.11

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.
Files changed (62) hide show
  1. package/dist/cjs/package.json +1 -1
  2. package/dist/cjs/src/api.d.ts +27 -9
  3. package/dist/cjs/src/api.js +58 -22
  4. package/dist/cjs/src/client.d.ts +72 -3
  5. package/dist/cjs/src/client.js +79 -2
  6. package/dist/cjs/src/error.d.ts +26 -0
  7. package/dist/cjs/src/error.js +64 -1
  8. package/dist/cjs/src/events.d.ts +31 -9
  9. package/dist/cjs/src/events.js +56 -25
  10. package/dist/cjs/src/index.js +3 -2
  11. package/dist/cjs/src/key.d.ts +19 -2
  12. package/dist/cjs/src/key.js +22 -2
  13. package/dist/cjs/src/mfa.d.ts +6 -3
  14. package/dist/cjs/src/mfa.js +8 -5
  15. package/dist/cjs/src/response.d.ts +14 -1
  16. package/dist/cjs/src/response.js +65 -26
  17. package/dist/cjs/src/role.d.ts +6 -0
  18. package/dist/cjs/src/role.js +9 -1
  19. package/dist/cjs/src/schema.d.ts +339 -45
  20. package/dist/cjs/src/schema.js +1 -1
  21. package/dist/cjs/src/schema_types.d.ts +3 -0
  22. package/dist/cjs/src/schema_types.js +1 -1
  23. package/dist/cjs/src/session/signer_session_manager.js +3 -3
  24. package/dist/cjs/src/util.js +3 -2
  25. package/dist/esm/package.json +1 -1
  26. package/dist/esm/src/api.d.ts +27 -9
  27. package/dist/esm/src/api.js +56 -20
  28. package/dist/esm/src/client.d.ts +72 -3
  29. package/dist/esm/src/client.js +79 -2
  30. package/dist/esm/src/error.d.ts +26 -0
  31. package/dist/esm/src/error.js +64 -1
  32. package/dist/esm/src/events.d.ts +31 -9
  33. package/dist/esm/src/events.js +53 -23
  34. package/dist/esm/src/index.js +2 -2
  35. package/dist/esm/src/key.d.ts +19 -2
  36. package/dist/esm/src/key.js +22 -2
  37. package/dist/esm/src/mfa.d.ts +6 -3
  38. package/dist/esm/src/mfa.js +8 -5
  39. package/dist/esm/src/response.d.ts +14 -1
  40. package/dist/esm/src/response.js +65 -26
  41. package/dist/esm/src/role.d.ts +6 -0
  42. package/dist/esm/src/role.js +9 -1
  43. package/dist/esm/src/schema.d.ts +339 -45
  44. package/dist/esm/src/schema.js +1 -1
  45. package/dist/esm/src/schema_types.d.ts +3 -0
  46. package/dist/esm/src/schema_types.js +1 -1
  47. package/dist/esm/src/session/signer_session_manager.js +3 -3
  48. package/dist/esm/src/util.js +3 -2
  49. package/package.json +1 -1
  50. package/src/api.ts +66 -19
  51. package/src/client.ts +94 -2
  52. package/src/error.ts +73 -0
  53. package/src/events.ts +53 -24
  54. package/src/key.ts +31 -2
  55. package/src/mfa.ts +8 -4
  56. package/src/response.ts +50 -4
  57. package/src/role.ts +9 -0
  58. package/src/schema.ts +597 -45
  59. package/src/schema_types.ts +3 -0
  60. package/src/session/signer_session_manager.ts +2 -2
  61. package/src/util.ts +2 -3
  62. package/tsconfig.json +3 -3
@@ -188,6 +188,15 @@ export interface paths {
188
188
  */
189
189
  patch: operations["updateKey"];
190
190
  };
191
+ "/v0/org/{org_id}/keys/{key_id}/roles": {
192
+ /**
193
+ * List Key Roles
194
+ * @description List Key Roles
195
+ *
196
+ * Get all roles the key is in
197
+ */
198
+ get: operations["listKeyRoles"];
199
+ };
191
200
  "/v0/org/{org_id}/mfa": {
192
201
  /**
193
202
  * List Pending MFA Requests
@@ -207,46 +216,67 @@ export interface paths {
207
216
  */
208
217
  get: operations["mfaGet"];
209
218
  /**
210
- * Approve MFA Request
211
- * @description Approve MFA Request
219
+ * Approve or Reject MFA Request
220
+ * @description Approve or Reject MFA Request
212
221
  *
213
- * Approve request after logging in with CubeSigner. Adds the currently-logged user as an approver
222
+ * Approve or reject request after logging in with CubeSigner.
223
+ *
224
+ * If approving, adds the currently-logged user as an approver
214
225
  * of a pending MFA request of the [Status::RequiredApprovers] kind. If the required number of
215
226
  * approvers is reached, the MFA request is approved; the confirmation receipt can be used to
216
227
  * resume the original HTTP request.
228
+ *
229
+ * If rejecting, immediately deletes the pending MFA request.
217
230
  */
218
- patch: operations["mfaApproveCs"];
231
+ patch: operations["mfaVoteCs"];
219
232
  };
220
233
  "/v0/org/{org_id}/mfa/{mfa_id}/fido": {
221
234
  /**
222
- * Initiate Approving an MFA Request with FIDO
223
- * @description Initiate Approving an MFA Request with FIDO
235
+ * Initiate a FIDO MFA Approval/Rejection
236
+ * @description Initiate a FIDO MFA Approval/Rejection
224
237
  *
225
- * Initiates the approval process of an MFA Request using FIDO.
238
+ * Initiates the approval/rejection process of an MFA Request using FIDO.
226
239
  */
227
- post: operations["mfaApproveFido"];
240
+ post: operations["mfaFidoInit"];
228
241
  /**
229
- * Finalize a FIDO MFA Approval
230
- * @description Finalize a FIDO MFA Approval
231
- *
232
- * Adds an approver to a pending MFA request.
242
+ * Finalize a FIDO MFA Approval/Rejection
243
+ * @description Finalize a FIDO MFA Approval/Rejection
233
244
  *
245
+ * If approving, adds an approver to a pending MFA request.
234
246
  * If the required number of approvers is reached, the MFA request is approved;
235
247
  * the confirmation receipt can be used to resume the original HTTP request.
248
+ *
249
+ * If rejecting, immediately deletes the pending MFA request.
236
250
  */
237
- patch: operations["mfaApproveFidoComplete"];
251
+ patch: operations["mfaVoteFidoComplete"];
238
252
  };
239
253
  "/v0/org/{org_id}/mfa/{mfa_id}/totp": {
240
254
  /**
241
- * Approve a TOTP MFA Request
242
- * @description Approve a TOTP MFA Request
255
+ * Approve/Reject a TOTP MFA Request
256
+ * @description Approve/Reject a TOTP MFA Request
243
257
  *
244
- * Adds the current user as approver to a pending MFA request by providing TOTP code.
258
+ * If approving, adds the current user as approver to a pending MFA request by
259
+ * providing TOTP code. If the required number of approvers is reached, the MFA request is
260
+ * approved; the confirmation receipt can be used to resume the original HTTP request.
245
261
  *
246
- * If the required number of approvers is reached, the MFA request is approved;
247
- * the confirmation receipt can be used to resume the original HTTP request.
262
+ * If rejecting, immediately deletes the pending MFA request.
248
263
  */
249
- patch: operations["mfaApproveTotp"];
264
+ patch: operations["mfaVoteTotp"];
265
+ };
266
+ "/v0/org/{org_id}/oauth2/twitter": {
267
+ /**
268
+ * Mint an OIDC ID token for Twitter
269
+ * @description Mint an OIDC ID token for Twitter
270
+ *
271
+ * This function acts identically to Twitter's [`oauth2/token`](https://developer.twitter.com/en/docs/authentication/api-reference/token) endpoint,
272
+ * but extends the output with an `id_token`.
273
+ *
274
+ * This `id_token` can then be used with any CubeSigner endpoint that requires an OIDC token.
275
+ *
276
+ * > [!IMPORTANT]
277
+ * > This endpoint will fail unless the org is configured to allow the issuer `https://shim.oauth2.cubist.dev/twitter` and client ID being used for Twitter.
278
+ */
279
+ post: operations["oauth2Twitter"];
250
280
  };
251
281
  "/v0/org/{org_id}/oidc": {
252
282
  /**
@@ -391,6 +421,16 @@ export interface paths {
391
421
  */
392
422
  get: operations["listRoleUsers"];
393
423
  };
424
+ "/v0/org/{org_id}/roles/{role_id}/users/{user_id}": {
425
+ /**
426
+ * Remove User
427
+ * @description Remove User
428
+ *
429
+ * Removes an existing user from an existing role.
430
+ * Only users in the role or org owners can remove users from a role.
431
+ */
432
+ delete: operations["removeUserFromRole"];
433
+ };
394
434
  "/v0/org/{org_id}/session": {
395
435
  /**
396
436
  * List sessions
@@ -744,6 +784,8 @@ export interface components {
744
784
  session?: components["schemas"]["NewSessionResponse"] | null;
745
785
  };
746
786
  };
787
+ /** @enum {string} */
788
+ AcceptedValueCode: "MfaRequired";
747
789
  AddKeysToRoleRequest: {
748
790
  /**
749
791
  * @description A list of keys to add to a role
@@ -789,6 +831,11 @@ export interface components {
789
831
  identity: components["schemas"]["OIDCIdentity"];
790
832
  /** @description Optional login MFA policy */
791
833
  mfa_policy?: unknown;
834
+ /**
835
+ * @description Optional user full name
836
+ * @example Alice Wonderland
837
+ */
838
+ name?: string | null;
792
839
  role: components["schemas"]["MemberRole"];
793
840
  };
794
841
  AddThirdPartyUserResponse: {
@@ -950,6 +997,10 @@ export interface components {
950
997
  };
951
998
  /** @description Wrapper around a zeroizing 32-byte fixed-size array */
952
999
  B32: string;
1000
+ /** @enum {string} */
1001
+ BadGatewayErrorCode: "OAuthProviderError";
1002
+ /** @enum {string} */
1003
+ BadRequestErrorCode: "GenericBadRequest" | "InvalidBody" | "TokenRequestError" | "InvalidMfaReceipt" | "InvalidMfaPolicyCount" | "InvalidMfaPolicyNumAuthFactors" | "InvalidMfaPolicyNumAllowedApprovers" | "InvalidMfaPolicyRedundantRule" | "InvalidCreateKeyCount" | "OrgInviteExistingUser" | "OrgNameTaken" | "RoleNameTaken" | "AddKeyToRoleCountTooHigh" | "InvalidKeyId" | "InvalidKeyMetadataLength" | "InvalidKeyMetadata" | "InvalidKeyMaterialId" | "KeyNotFound" | "UserExportDerivedKey" | "UserExportPublicKeyInvalid" | "UserExportInProgress" | "RoleNotFound" | "InvalidMfaReceiptOrgIdMissing" | "InvalidMfaReceiptInvalidOrgId" | "MfaRequestNotFound" | "InvalidKeyType" | "InvalidKeyMaterial" | "InvalidHexValue" | "InvalidBase32Value" | "InvalidBase58Value" | "InvalidForkVersionLength" | "InvalidEthAddress" | "InvalidStellarAddress" | "InvalidOrgNameOrId" | "InvalidStakeDeposit" | "InvalidBlobSignRequest" | "InvalidSolanaSignRequest" | "InvalidEip712SignRequest" | "InvalidEvmSignRequest" | "InvalidEth2SignRequest" | "InvalidDeriveKeyRequest" | "InvalidStakingAmount" | "CustomStakingAmountNotAllowedForWrapperContract" | "InvalidUnstakeRequest" | "InvalidCreateUserRequest" | "UserAlreadyExists" | "UserNotFound" | "PolicyRuleKeyMismatch" | "EmptyScopes" | "InvalidScopesForRoleSession" | "InvalidLifetime" | "NoSingleKeyForUser" | "InvalidOrgPolicyRule" | "SourceIpAllowlistEmpty" | "InvalidOrgPolicyRepeatedRule" | "AvaSignHashError" | "AvaSignError" | "BtcSegwitHashError" | "BtcSignError" | "Eip712SignError" | "InvalidMemberRoleInUserAdd" | "ThirdPartyUserAlreadyExists" | "ThirdPartyUserNotFound" | "DeleteOidcUserError" | "SessionRoleMismatch" | "InvalidOidcToken" | "OidcIssuerUnsupported" | "OidcIssuerNotAllowed" | "OidcIssuerNoApplicableJwk" | "FidoKeyAlreadyRegistered" | "FidoKeySignCountTooLow" | "FidoVerificationFailed" | "FidoChallengeMfaMismatch" | "UnsupportedLegacyCognitoSession" | "InvalidIdentityProof" | "PaginationDataExpired" | "ExistingKeysViolateExclusiveKeyAccess" | "ExportDelayTooShort" | "ExportWindowTooLong" | "InvalidTotpFailureLimit" | "InvalidEip191SignRequest" | "CannotResendUserInvitation";
953
1004
  /**
954
1005
  * @example {
955
1006
  * "message_base64": "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTYK"
@@ -1148,6 +1199,8 @@ export interface components {
1148
1199
  configured_mfa: components["schemas"]["ConfiguredMfa"][];
1149
1200
  /** @description Set once the user successfully logs into CubeSigner */
1150
1201
  initialized: boolean;
1202
+ /** @description Optional human name for the user */
1203
+ name?: string | null;
1151
1204
  /** @description CubeSigner's user identifier */
1152
1205
  user_id: string;
1153
1206
  };
@@ -1326,6 +1379,7 @@ export interface components {
1326
1379
  /** @description The structure of ErrorResponse must match the response template that AWS uses */
1327
1380
  ErrorResponse: {
1328
1381
  accepted?: components["schemas"]["AcceptedValue"] | null;
1382
+ error_code: components["schemas"]["SignerErrorCode"];
1329
1383
  /** @description Error message */
1330
1384
  message: string;
1331
1385
  /** @description Optional request identifier */
@@ -1403,6 +1457,8 @@ export interface components {
1403
1457
  */
1404
1458
  signature: string;
1405
1459
  };
1460
+ /** @enum {string} */
1461
+ EvmTxDepositErrorCode: "EvmTxDepositReceiverMismatch" | "EvmTxDepositEmptyData" | "EvmTxDepositEmptyChainId" | "EvmTxDepositEmptyReceiver" | "EvmTxDepositUnexpectedValue" | "EvmTxDepositUnexpectedDataLength" | "EvmTxDepositNoAbi" | "EvmTxDepositNoDepositFunction" | "EvmTxDepositUnexpectedFunctionName" | "EvmTxDepositUnexpectedValidatorKey" | "EvmTxDepositInvalidValidatorKey" | "EvmTxDepositMissingDepositArg" | "EvmTxDepositWrongDepositArgType" | "EvmTxDepositWrongValidatorArgValue" | "EvmTxDepositValidatorKeyNotInRole" | "EvmTxDepositUnexpectedWithdrawalCredentials" | "EvmTxDepositUnresolvedRole" | "EvmTxDepositInvalidDepositEncoding";
1406
1462
  /** @description Sent from the client to the server to answer a fido challenge */
1407
1463
  FidoAssertAnswer: {
1408
1464
  /** @description The ID of the challenge that was returned from the POST endpoint */
@@ -1439,6 +1495,8 @@ export interface components {
1439
1495
  */
1440
1496
  name: string;
1441
1497
  };
1498
+ /** @enum {string} */
1499
+ ForbiddenErrorCode: "FidoRequiredToRemoveTotp" | "MfaChallengeExpired" | "ChainIdNotAllowed" | "InvalidOrg" | "SessionForWrongOrg" | "OrgDisabled" | "OrgNotFound" | "OrgWithoutOwner" | "OrphanedUser" | "OidcUserNotFound" | "UserNotInOrg" | "UserNotOrgOwner" | "UserNotKeyOwner" | "InvalidRole" | "DisabledRole" | "KeyDisabled" | "RoleNotInOrg" | "KeyNotInRole" | "KeyNotInOrg" | "UserExportRequestNotInOrg" | "UserExportRequestInvalid" | "UserNotOriginalKeyOwner" | "UserNotInRole" | "MustBeFullMember" | "SessionExpired" | "SessionRevoked" | "ExpectedUserSession" | "SessionRoleChanged" | "ScopedNameNotFound" | "SessionInvalidEpochToken" | "SessionInvalidRefreshToken" | "SessionRefreshTokenExpired" | "InvalidAuthHeader" | "SessionNotFound" | "InvalidArn" | "SessionInvalidAuthToken" | "SessionAuthTokenExpired" | "SessionPossiblyStolenToken" | "MfaDisallowedIdentity" | "MfaDisallowedApprover" | "MfaTypeNotAllowed" | "MfaNotApprovedYet" | "MfaConfirmationCodeMismatch" | "MfaHttpRequestMismatch" | "MfaRemoveBelowMin" | "TotpAlreadyConfigured" | "TotpConfigurationChanged" | "MfaTotpBadConfiguration" | "MfaTotpBadCode" | "MfaTotpRateLimit" | "ImproperSessionScope" | "FullSessionRequired" | "SessionWithoutAnyScopeUnder" | "UserRoleUnprivileged" | "MfaNotConfigured";
1442
1500
  /**
1443
1501
  * @description Specifies a fork of the `BeaconChain`, to prevent replay attacks.
1444
1502
  * The schema of `Fork` is defined in the [Beacon chain
@@ -1573,9 +1631,14 @@ export interface components {
1573
1631
  * @description The email associated with the user
1574
1632
  * @example user@email.com
1575
1633
  */
1576
- email: string;
1634
+ email?: string | null;
1577
1635
  exp_epoch: components["schemas"]["EpochDateTime"];
1578
1636
  identity?: components["schemas"]["OIDCIdentity"] | null;
1637
+ /**
1638
+ * @description The username (if any) associated with the user
1639
+ * @example cubistdev
1640
+ */
1641
+ preferred_username?: string | null;
1579
1642
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
1580
1643
  } & {
1581
1644
  /** @description An opaque identifier for the proof */
@@ -1603,6 +1666,8 @@ export interface components {
1603
1666
  */
1604
1667
  salt: string;
1605
1668
  };
1669
+ /** @enum {string} */
1670
+ InternalErrorCode: "SystemTimeError" | "ReqwestError" | "DbQueryError" | "DbGetError" | "DbDeleteError" | "DbPutError" | "DbUpdateError" | "SerdeError" | "TestAndSetError" | "DbGetItemsError" | "DbWriteError" | "CubistSignerError" | "CwPutMetricDataError" | "KmsGenerateRandomError" | "MalformedTotpBytes" | "KmsGenerateRandomNoResponseError" | "CreateKeyError" | "ParseDerivationPathError" | "SplitSignerError" | "CreateImportKeyError" | "CognitoDeleteUserError" | "CognitoListUsersError" | "CognitoGetUserError" | "MissingUserEmail" | "CognitoResendUserInvitation" | "CognitoSetUserPasswordError" | "GenericInternalError" | "OidcAuthWithoutOrg" | "MissingKeyMetadata" | "KmsKeyWithoutId" | "KmsEnableKeyError" | "KmsDisableKeyError" | "SerializeEncryptedExportKeyError" | "DeserializeEncryptedExportKeyError" | "ReEncryptUserExport" | "S3UploadError" | "S3DownloadError" | "ManagedStateMissing" | "InternalHeaderMissing" | "InvalidInternalHeaderValue" | "RequestLocalStateAlreadySet" | "OidcOrgMismatch" | "OrphanedRoleKeyId" | "OidcIssuerJwkEndpointUnavailable" | "OidcIssuerInvalidJwk" | "InvalidPkForMaterialId" | "UncheckedOrg" | "AvaSignCredsMissing" | "AvaSignSignatureMissing" | "ExpectedRoleSession" | "InvalidThirdPartyIdentity" | "CognitoGetUser";
1606
1671
  InviteRequest: {
1607
1672
  /**
1608
1673
  * @description The user's email address
@@ -1758,6 +1823,11 @@ export interface components {
1758
1823
  * ]
1759
1824
  */
1760
1825
  policy?: Record<string, never>[];
1826
+ /**
1827
+ * @description Role ID
1828
+ * @example Role#e427c28a-9c5b-49cc-a257-878aea58a22c
1829
+ */
1830
+ role_id: string;
1761
1831
  };
1762
1832
  KeyInfo: {
1763
1833
  derivation_info?: components["schemas"]["KeyDerivationInfo"] | null;
@@ -1861,6 +1931,8 @@ export interface components {
1861
1931
  };
1862
1932
  }
1863
1933
  ]>;
1934
+ /** @enum {string} */
1935
+ MfaVote: "approve" | "reject";
1864
1936
  /**
1865
1937
  * @description Network name ('mainnet', 'prater', 'goerli')
1866
1938
  * @example goerli
@@ -1882,14 +1954,13 @@ export interface components {
1882
1954
  */
1883
1955
  token: string;
1884
1956
  };
1957
+ /** @enum {string} */
1958
+ NotFoundErrorCode: "UriSegmentMissing" | "UriSegmentInvalid" | "TotpNotConfigured" | "FidoKeyNotFound" | "FidoChallengeNotFound" | "TotpChallengeNotFound" | "UserExportRequestNotFound" | "UserExportCiphertextNotFound";
1885
1959
  /**
1886
1960
  * @description Represents a globally unique OIDC-authorized user by expressing the full "path" to a user. That is:
1887
1961
  *
1888
1962
  * (iss) (sub)
1889
1963
  * Issuer -> Subresource
1890
- *
1891
- * We include a non-standard third-tier `disambiguator` which allows us to map
1892
- * a single OIDC user to multiple `User`s in CubeSigner
1893
1964
  */
1894
1965
  OIDCIdentity: {
1895
1966
  /**
@@ -2010,6 +2081,21 @@ export interface components {
2010
2081
  */
2011
2082
  "page.start"?: string | null;
2012
2083
  };
2084
+ /**
2085
+ * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2086
+ * value (which can the user pass back to use as a url query parameter to continue pagination).
2087
+ */
2088
+ PaginatedListKeyRolesResponse: {
2089
+ /** @description All roles the key is in */
2090
+ roles: components["schemas"]["KeyInRoleInfo"][];
2091
+ } & {
2092
+ /**
2093
+ * @description If set, the content of `response` does not contain the entire result set.
2094
+ * To fetch the next page of the result set, call the same endpoint
2095
+ * but specify this value as the 'page.start' query parameter.
2096
+ */
2097
+ last_evaluated_key?: string | null;
2098
+ };
2013
2099
  /**
2014
2100
  * @description Response type that wraps another type and adds base64url-encoded encrypted `last_evaluated_key`
2015
2101
  * value (which can the user pass back to use as a url query parameter to continue pagination).
@@ -2098,6 +2184,12 @@ export interface components {
2098
2184
  */
2099
2185
  last_evaluated_key?: string | null;
2100
2186
  };
2187
+ PolicyErrorCode: components["schemas"]["PolicyErrorOwnCodes"] | components["schemas"]["EvmTxDepositErrorCode"];
2188
+ /** @enum {string} */
2189
+ PolicyErrorOwnCodes: "EvmTxReceiverMismatch" | "EvmTxSenderMismatch" | "PolicyDisjunctionError" | "PolicyNegationError" | "Eth2ExceededMaxUnstake" | "Eth2ConcurrentUnstaking" | "NotInIpv4Allowlist" | "NotInOriginAllowlist" | "InvalidSourceIp" | "RawSigningNotAllowed" | "Eip712SigningNotAllowed" | "OidcSourceNotAllowed" | "NoOidcAuthSourcesDefined" | "AddKeyToRoleDisallowed" | "KeysAlreadyInRole" | "KeyInMultipleRoles" | "KeyAccessError" | "Eip191SigningNotAllowed";
2190
+ PreconditionErrorCode: components["schemas"]["PreconditionErrorOwnCodes"] | components["schemas"]["PolicyErrorCode"];
2191
+ /** @enum {string} */
2192
+ PreconditionErrorOwnCodes: "Eth2ProposerSlotTooLow" | "Eth2AttestationSourceEpochTooLow" | "Eth2AttestationTargetEpochTooLow" | "Eth2ConcurrentBlockSigning" | "Eth2ConcurrentAttestationSigning" | "Eth2MultiDepositToNonGeneratedKey" | "Eth2MultiDepositUnknownInitialDeposit" | "Eth2MultiDepositWithdrawalAddressMismatch";
2101
2193
  /**
2102
2194
  * @description This type represents a wire-encodable form of the PublicKeyCredential interface
2103
2195
  * Clients may need to manually encode into this format to communicate with the server
@@ -2519,6 +2611,9 @@ export interface components {
2519
2611
  /** @description The list of sessions */
2520
2612
  sessions: components["schemas"]["SessionInfo"][];
2521
2613
  };
2614
+ SignerErrorCode: components["schemas"]["SignerErrorOwnCodes"] | components["schemas"]["AcceptedValueCode"] | components["schemas"]["BadRequestErrorCode"] | components["schemas"]["BadGatewayErrorCode"] | components["schemas"]["NotFoundErrorCode"] | components["schemas"]["ForbiddenErrorCode"] | components["schemas"]["UnauthorizedErrorCode"] | components["schemas"]["PreconditionErrorCode"] | components["schemas"]["InternalErrorCode"];
2615
+ /** @enum {string} */
2616
+ SignerErrorOwnCodes: "UnhandledError" | "ProxyStartError" | "EnclaveError";
2522
2617
  /**
2523
2618
  * @example {
2524
2619
  * "message_base64": "AQABA8OKVzLEjststN4xXr39kLKHT8d58eQY1QEs6MeXwEFBrxTAlULX1troLbWxuAXQqgbQofGi6z8fJi7KAAIf7YMAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJK0tn39k28s+X86W47EvbRRKnYBVQ8Q/l2m1EbfT7+vAQICAAEMAgAAAGQAAAAAAAAA"
@@ -2596,6 +2691,21 @@ export interface components {
2596
2691
  /** @description Tokens purpose */
2597
2692
  purpose: string;
2598
2693
  };
2694
+ /**
2695
+ * @description OAuth2 standard Token Response.
2696
+ *
2697
+ * https://datatracker.ietf.org/doc/html/rfc6749#section-4.2.2
2698
+ */
2699
+ TokenResponse: {
2700
+ /** @description The access token issued by the authorization server. */
2701
+ access_token: string;
2702
+ expires_in: components["schemas"]["Seconds"];
2703
+ /** @description An OIDC token issued by Cubist, containing user information */
2704
+ id_token?: string;
2705
+ /** @description The type of the token issued. Value is case insensitive. */
2706
+ token_type: string;
2707
+ [key: string]: unknown;
2708
+ };
2599
2709
  TotpApproveRequest: {
2600
2710
  /** @description TOTP verification code */
2601
2711
  code: string;
@@ -2624,6 +2734,8 @@ export interface components {
2624
2734
  /** @description The name of the issuer; defaults to "Cubist". */
2625
2735
  issuer?: string | null;
2626
2736
  };
2737
+ /** @enum {string} */
2738
+ UnauthorizedErrorCode: "ClaimsHeaderMissing" | "ClaimsParseError" | "OidcIdentityHeaderMissing" | "OidcIdentityParseError";
2627
2739
  /** @description Options that should be set only for local devnet testing. */
2628
2740
  UnsafeConf: {
2629
2741
  /**
@@ -2939,12 +3051,20 @@ export interface components {
2939
3051
  user_id: string;
2940
3052
  };
2941
3053
  UserInfo: {
2942
- /** @example alice@example.com */
3054
+ /**
3055
+ * @description Optional email
3056
+ * @example alice@example.com
3057
+ */
2943
3058
  email: string;
2944
3059
  /** @description All multi-factor authentication methods configured for this user */
2945
3060
  mfa: components["schemas"]["ConfiguredMfa"][];
2946
3061
  /** @description MFA policy, applies before logging in and other sensitive operations */
2947
3062
  mfa_policy?: unknown;
3063
+ /**
3064
+ * @description Optional name
3065
+ * @example Alice
3066
+ */
3067
+ name?: string | null;
2948
3068
  /**
2949
3069
  * @description All organizations the user belongs to
2950
3070
  * @example [
@@ -3148,9 +3268,14 @@ export interface components {
3148
3268
  * @description The email associated with the user
3149
3269
  * @example user@email.com
3150
3270
  */
3151
- email: string;
3271
+ email?: string | null;
3152
3272
  exp_epoch: components["schemas"]["EpochDateTime"];
3153
3273
  identity?: components["schemas"]["OIDCIdentity"] | null;
3274
+ /**
3275
+ * @description The username (if any) associated with the user
3276
+ * @example cubistdev
3277
+ */
3278
+ preferred_username?: string | null;
3154
3279
  user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
3155
3280
  } & {
3156
3281
  /** @description An opaque identifier for the proof */
@@ -3370,6 +3495,21 @@ export interface components {
3370
3495
  };
3371
3496
  };
3372
3497
  };
3498
+ PaginatedListKeyRolesResponse: {
3499
+ content: {
3500
+ "application/json": {
3501
+ /** @description All roles the key is in */
3502
+ roles: components["schemas"]["KeyInRoleInfo"][];
3503
+ } & {
3504
+ /**
3505
+ * @description If set, the content of `response` does not contain the entire result set.
3506
+ * To fetch the next page of the result set, call the same endpoint
3507
+ * but specify this value as the 'page.start' query parameter.
3508
+ */
3509
+ last_evaluated_key?: string | null;
3510
+ };
3511
+ };
3512
+ };
3373
3513
  PaginatedListKeysResponse: {
3374
3514
  content: {
3375
3515
  "application/json": {
@@ -3569,6 +3709,25 @@ export interface components {
3569
3709
  };
3570
3710
  };
3571
3711
  };
3712
+ /**
3713
+ * @description OAuth2 standard Token Response.
3714
+ *
3715
+ * https://datatracker.ietf.org/doc/html/rfc6749#section-4.2.2
3716
+ */
3717
+ TokenResponse: {
3718
+ content: {
3719
+ "application/json": {
3720
+ /** @description The access token issued by the authorization server. */
3721
+ access_token: string;
3722
+ expires_in: components["schemas"]["Seconds"];
3723
+ /** @description An OIDC token issued by Cubist, containing user information */
3724
+ id_token?: string;
3725
+ /** @description The type of the token issued. Value is case insensitive. */
3726
+ token_type: string;
3727
+ [key: string]: unknown;
3728
+ };
3729
+ };
3730
+ };
3572
3731
  TotpInfo: {
3573
3732
  content: {
3574
3733
  "application/json": {
@@ -3687,12 +3846,20 @@ export interface components {
3687
3846
  UserInfo: {
3688
3847
  content: {
3689
3848
  "application/json": {
3690
- /** @example alice@example.com */
3849
+ /**
3850
+ * @description Optional email
3851
+ * @example alice@example.com
3852
+ */
3691
3853
  email: string;
3692
3854
  /** @description All multi-factor authentication methods configured for this user */
3693
3855
  mfa: components["schemas"]["ConfiguredMfa"][];
3694
3856
  /** @description MFA policy, applies before logging in and other sensitive operations */
3695
3857
  mfa_policy?: unknown;
3858
+ /**
3859
+ * @description Optional name
3860
+ * @example Alice
3861
+ */
3862
+ name?: string | null;
3696
3863
  /**
3697
3864
  * @description All organizations the user belongs to
3698
3865
  * @example [
@@ -4324,6 +4491,51 @@ export interface operations {
4324
4491
  };
4325
4492
  };
4326
4493
  };
4494
+ /**
4495
+ * List Key Roles
4496
+ * @description List Key Roles
4497
+ *
4498
+ * Get all roles the key is in
4499
+ */
4500
+ listKeyRoles: {
4501
+ parameters: {
4502
+ query?: {
4503
+ /**
4504
+ * @description Max number of items to return per page.
4505
+ *
4506
+ * If the actual number of returned items may be less that this, even if there exist more
4507
+ * data in the result set. To reliably determine if more data is left in the result set,
4508
+ * inspect the [UnencryptedLastEvalKey] value in the response object.
4509
+ */
4510
+ "page.size"?: number;
4511
+ /**
4512
+ * @description The start of the page. Omit to start from the beginning; otherwise, only specify a
4513
+ * the exact value previously returned as 'last_evaluated_key' from the same endpoint.
4514
+ */
4515
+ "page.start"?: components["schemas"]["LastEvalKey"] | null;
4516
+ };
4517
+ path: {
4518
+ /**
4519
+ * @description Name or ID of the desired Org
4520
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
4521
+ */
4522
+ org_id: string;
4523
+ /**
4524
+ * @description ID of the desired Key
4525
+ * @example Key#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
4526
+ */
4527
+ key_id: string;
4528
+ };
4529
+ };
4530
+ responses: {
4531
+ 200: components["responses"]["PaginatedListKeyRolesResponse"];
4532
+ default: {
4533
+ content: {
4534
+ "application/json": components["schemas"]["ErrorResponse"];
4535
+ };
4536
+ };
4537
+ };
4538
+ };
4327
4539
  /**
4328
4540
  * List Pending MFA Requests
4329
4541
  * @description List Pending MFA Requests
@@ -4381,16 +4593,23 @@ export interface operations {
4381
4593
  };
4382
4594
  };
4383
4595
  /**
4384
- * Approve MFA Request
4385
- * @description Approve MFA Request
4596
+ * Approve or Reject MFA Request
4597
+ * @description Approve or Reject MFA Request
4386
4598
  *
4387
- * Approve request after logging in with CubeSigner. Adds the currently-logged user as an approver
4599
+ * Approve or reject request after logging in with CubeSigner.
4600
+ *
4601
+ * If approving, adds the currently-logged user as an approver
4388
4602
  * of a pending MFA request of the [Status::RequiredApprovers] kind. If the required number of
4389
4603
  * approvers is reached, the MFA request is approved; the confirmation receipt can be used to
4390
4604
  * resume the original HTTP request.
4605
+ *
4606
+ * If rejecting, immediately deletes the pending MFA request.
4391
4607
  */
4392
- mfaApproveCs: {
4608
+ mfaVoteCs: {
4393
4609
  parameters: {
4610
+ query?: {
4611
+ mfa_vote?: components["schemas"]["MfaVote"] | null;
4612
+ };
4394
4613
  path: {
4395
4614
  /**
4396
4615
  * @description Name or ID of the desired Org
@@ -4414,12 +4633,12 @@ export interface operations {
4414
4633
  };
4415
4634
  };
4416
4635
  /**
4417
- * Initiate Approving an MFA Request with FIDO
4418
- * @description Initiate Approving an MFA Request with FIDO
4636
+ * Initiate a FIDO MFA Approval/Rejection
4637
+ * @description Initiate a FIDO MFA Approval/Rejection
4419
4638
  *
4420
- * Initiates the approval process of an MFA Request using FIDO.
4639
+ * Initiates the approval/rejection process of an MFA Request using FIDO.
4421
4640
  */
4422
- mfaApproveFido: {
4641
+ mfaFidoInit: {
4423
4642
  parameters: {
4424
4643
  path: {
4425
4644
  /**
@@ -4444,16 +4663,20 @@ export interface operations {
4444
4663
  };
4445
4664
  };
4446
4665
  /**
4447
- * Finalize a FIDO MFA Approval
4448
- * @description Finalize a FIDO MFA Approval
4449
- *
4450
- * Adds an approver to a pending MFA request.
4666
+ * Finalize a FIDO MFA Approval/Rejection
4667
+ * @description Finalize a FIDO MFA Approval/Rejection
4451
4668
  *
4669
+ * If approving, adds an approver to a pending MFA request.
4452
4670
  * If the required number of approvers is reached, the MFA request is approved;
4453
4671
  * the confirmation receipt can be used to resume the original HTTP request.
4672
+ *
4673
+ * If rejecting, immediately deletes the pending MFA request.
4454
4674
  */
4455
- mfaApproveFidoComplete: {
4675
+ mfaVoteFidoComplete: {
4456
4676
  parameters: {
4677
+ query?: {
4678
+ mfa_vote?: components["schemas"]["MfaVote"] | null;
4679
+ };
4457
4680
  path: {
4458
4681
  /**
4459
4682
  * @description Name or ID of the desired Org
@@ -4482,16 +4705,20 @@ export interface operations {
4482
4705
  };
4483
4706
  };
4484
4707
  /**
4485
- * Approve a TOTP MFA Request
4486
- * @description Approve a TOTP MFA Request
4708
+ * Approve/Reject a TOTP MFA Request
4709
+ * @description Approve/Reject a TOTP MFA Request
4487
4710
  *
4488
- * Adds the current user as approver to a pending MFA request by providing TOTP code.
4711
+ * If approving, adds the current user as approver to a pending MFA request by
4712
+ * providing TOTP code. If the required number of approvers is reached, the MFA request is
4713
+ * approved; the confirmation receipt can be used to resume the original HTTP request.
4489
4714
  *
4490
- * If the required number of approvers is reached, the MFA request is approved;
4491
- * the confirmation receipt can be used to resume the original HTTP request.
4715
+ * If rejecting, immediately deletes the pending MFA request.
4492
4716
  */
4493
- mfaApproveTotp: {
4717
+ mfaVoteTotp: {
4494
4718
  parameters: {
4719
+ query?: {
4720
+ mfa_vote?: components["schemas"]["MfaVote"] | null;
4721
+ };
4495
4722
  path: {
4496
4723
  /**
4497
4724
  * @description Name or ID of the desired Org
@@ -4519,6 +4746,44 @@ export interface operations {
4519
4746
  };
4520
4747
  };
4521
4748
  };
4749
+ /**
4750
+ * Mint an OIDC ID token for Twitter
4751
+ * @description Mint an OIDC ID token for Twitter
4752
+ *
4753
+ * This function acts identically to Twitter's [`oauth2/token`](https://developer.twitter.com/en/docs/authentication/api-reference/token) endpoint,
4754
+ * but extends the output with an `id_token`.
4755
+ *
4756
+ * This `id_token` can then be used with any CubeSigner endpoint that requires an OIDC token.
4757
+ *
4758
+ * > [!IMPORTANT]
4759
+ * > This endpoint will fail unless the org is configured to allow the issuer `https://shim.oauth2.cubist.dev/twitter` and client ID being used for Twitter.
4760
+ */
4761
+ oauth2Twitter: {
4762
+ parameters: {
4763
+ path: {
4764
+ /**
4765
+ * @description Name or ID of the desired Org
4766
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
4767
+ */
4768
+ org_id: string;
4769
+ };
4770
+ };
4771
+ requestBody: {
4772
+ content: {
4773
+ "application/json": {
4774
+ [key: string]: string;
4775
+ };
4776
+ };
4777
+ };
4778
+ responses: {
4779
+ 200: components["responses"]["TokenResponse"];
4780
+ default: {
4781
+ content: {
4782
+ "application/json": components["schemas"]["ErrorResponse"];
4783
+ };
4784
+ };
4785
+ };
4786
+ };
4522
4787
  /**
4523
4788
  * Login with OIDC
4524
4789
  * @description Login with OIDC
@@ -5044,6 +5309,35 @@ export interface operations {
5044
5309
  };
5045
5310
  };
5046
5311
  };
5312
+ /**
5313
+ * Remove User
5314
+ * @description Remove User
5315
+ *
5316
+ * Removes an existing user from an existing role.
5317
+ * Only users in the role or org owners can remove users from a role.
5318
+ */
5319
+ removeUserFromRole: {
5320
+ parameters: {
5321
+ path: {
5322
+ /**
5323
+ * @description Name or ID of the desired Org
5324
+ * @example Org#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5325
+ */
5326
+ org_id: string;
5327
+ /**
5328
+ * @description Name or ID of the desired Role
5329
+ * @example Role#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5330
+ */
5331
+ role_id: string;
5332
+ /**
5333
+ * @description ID of the desired User
5334
+ * @example User#124dfe3e-3bbd-487d-80c0-53c55e8ab87a
5335
+ */
5336
+ user_id: string;
5337
+ };
5338
+ };
5339
+ responses: {};
5340
+ };
5047
5341
  /**
5048
5342
  * List sessions
5049
5343
  * @description List sessions