@cubist-labs/cubesigner-sdk 0.3.8 → 0.3.13
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/README.md +1 -0
- package/dist/cjs/package.json +1 -1
- package/dist/cjs/src/client.d.ts +4 -2
- package/dist/cjs/src/error.d.ts +23 -0
- package/dist/cjs/src/error.js +63 -1
- package/dist/cjs/src/events.d.ts +31 -9
- package/dist/cjs/src/events.js +56 -25
- package/dist/cjs/src/index.js +3 -2
- package/dist/cjs/src/schema.d.ts +104 -5
- package/dist/cjs/src/schema.js +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/src/client.d.ts +4 -2
- package/dist/esm/src/error.d.ts +23 -0
- package/dist/esm/src/error.js +63 -1
- package/dist/esm/src/events.d.ts +31 -9
- package/dist/esm/src/events.js +53 -23
- package/dist/esm/src/index.js +2 -2
- package/dist/esm/src/schema.d.ts +104 -5
- package/dist/esm/src/schema.js +1 -1
- package/package.json +1 -1
- package/src/error.ts +69 -0
- package/src/events.ts +53 -24
- package/src/schema.ts +103 -4
- package/tsconfig.json +3 -3
package/dist/cjs/src/schema.d.ts
CHANGED
|
@@ -263,6 +263,21 @@ export interface paths {
|
|
|
263
263
|
*/
|
|
264
264
|
patch: operations["mfaVoteTotp"];
|
|
265
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"];
|
|
280
|
+
};
|
|
266
281
|
"/v0/org/{org_id}/oidc": {
|
|
267
282
|
/**
|
|
268
283
|
* Login with OIDC
|
|
@@ -983,7 +998,9 @@ export interface components {
|
|
|
983
998
|
/** @description Wrapper around a zeroizing 32-byte fixed-size array */
|
|
984
999
|
B32: string;
|
|
985
1000
|
/** @enum {string} */
|
|
986
|
-
|
|
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";
|
|
987
1004
|
/**
|
|
988
1005
|
* @example {
|
|
989
1006
|
* "message_base64": "YWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXoxMjM0NTYK"
|
|
@@ -1479,7 +1496,7 @@ export interface components {
|
|
|
1479
1496
|
name: string;
|
|
1480
1497
|
};
|
|
1481
1498
|
/** @enum {string} */
|
|
1482
|
-
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" | "
|
|
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";
|
|
1483
1500
|
/**
|
|
1484
1501
|
* @description Specifies a fork of the `BeaconChain`, to prevent replay attacks.
|
|
1485
1502
|
* The schema of `Fork` is defined in the [Beacon chain
|
|
@@ -1614,9 +1631,14 @@ export interface components {
|
|
|
1614
1631
|
* @description The email associated with the user
|
|
1615
1632
|
* @example user@email.com
|
|
1616
1633
|
*/
|
|
1617
|
-
email
|
|
1634
|
+
email?: string | null;
|
|
1618
1635
|
exp_epoch: components["schemas"]["EpochDateTime"];
|
|
1619
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;
|
|
1620
1642
|
user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
|
|
1621
1643
|
} & {
|
|
1622
1644
|
/** @description An opaque identifier for the proof */
|
|
@@ -2589,7 +2611,7 @@ export interface components {
|
|
|
2589
2611
|
/** @description The list of sessions */
|
|
2590
2612
|
sessions: components["schemas"]["SessionInfo"][];
|
|
2591
2613
|
};
|
|
2592
|
-
SignerErrorCode: components["schemas"]["SignerErrorOwnCodes"] | components["schemas"]["AcceptedValueCode"] | components["schemas"]["BadRequestErrorCode"] | components["schemas"]["NotFoundErrorCode"] | components["schemas"]["ForbiddenErrorCode"] | components["schemas"]["UnauthorizedErrorCode"] | components["schemas"]["PreconditionErrorCode"] | components["schemas"]["InternalErrorCode"];
|
|
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"];
|
|
2593
2615
|
/** @enum {string} */
|
|
2594
2616
|
SignerErrorOwnCodes: "UnhandledError" | "ProxyStartError" | "EnclaveError";
|
|
2595
2617
|
/**
|
|
@@ -2669,6 +2691,21 @@ export interface components {
|
|
|
2669
2691
|
/** @description Tokens purpose */
|
|
2670
2692
|
purpose: string;
|
|
2671
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
|
+
};
|
|
2672
2709
|
TotpApproveRequest: {
|
|
2673
2710
|
/** @description TOTP verification code */
|
|
2674
2711
|
code: string;
|
|
@@ -3231,9 +3268,14 @@ export interface components {
|
|
|
3231
3268
|
* @description The email associated with the user
|
|
3232
3269
|
* @example user@email.com
|
|
3233
3270
|
*/
|
|
3234
|
-
email
|
|
3271
|
+
email?: string | null;
|
|
3235
3272
|
exp_epoch: components["schemas"]["EpochDateTime"];
|
|
3236
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;
|
|
3237
3279
|
user_info?: components["schemas"]["CubeSignerUserInfo"] | null;
|
|
3238
3280
|
} & {
|
|
3239
3281
|
/** @description An opaque identifier for the proof */
|
|
@@ -3667,6 +3709,25 @@ export interface components {
|
|
|
3667
3709
|
};
|
|
3668
3710
|
};
|
|
3669
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
|
+
};
|
|
3670
3731
|
TotpInfo: {
|
|
3671
3732
|
content: {
|
|
3672
3733
|
"application/json": {
|
|
@@ -4685,6 +4746,44 @@ export interface operations {
|
|
|
4685
4746
|
};
|
|
4686
4747
|
};
|
|
4687
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
|
+
};
|
|
4688
4787
|
/**
|
|
4689
4788
|
* Login with OIDC
|
|
4690
4789
|
* @description Login with OIDC
|