Protected _accessProtected _cognitoProtected Optional _configTrait instance configuration.
Protected _globalWhether this is a global (not bound to any specific schema item) trait instance.
Protected Readonly _graphqlProtected Optional _typeTrait type.
Protected Readonly dataProtected Readonly graphqladd custom IdP.
A promise that resolves to true if the operation is successful.
The data source wrapper.
The trait data object.
Private checkChecks the user roles in the provided trait data to determine if the action is allowed.
Throws an error if the user does not have the required roles for the action.
The trait data object containing user roles in the context.
Sends a welcome email to a user.
A promise that resolves to true if the operation is successful.
The data source wrapper.
The trait data object.
Disables multi-factor authentication (MFA) for a user.
A promise that resolves to true if the operation is successful.
The data source wrapper.
The trait data object.
Enables multi-factor authentication (MFA) for a user.
A promise that resolves to true if the operation is successful.
The data source wrapper.
The trait data object.
Attaches Trait callbacks to schema item hooks.
Makes this Trait instance global.
Creates user from in cognito
Deletes user from cognito
Update a user from in cognito
This method is triggered when a trait callback has been activated
This is the name of the callback function to call.
References to the Graph Hanlder
Request data passed along as part of the request.
Configuration setter.
The new configuration.
update welcome email template.
A promise that resolves to true if the operation is successful.
The data source wrapper.
The trait data object.
Private userCheck user context has iss
This is used to extract congito user pool id to enable us to talk to the cognito api
if user iss is provided.
Helper method for wrapping legacy Kosmos traits callbacks.
TODO: Remove this method once all Traits are converted.
Optional callbackName: stringOptional callback name; passing this parameter will additionally wrap the callback into legacy process().
Static traitGenerated using TypeDoc
The trait to integrate a vertex with AWS cognito
Mermaid
CognitoTrait Sequence
User ->> CognitoTrait: postCreate(traitData, item, legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: createUser(false, true, context) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: postUpdate(traitData, item, legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: updateUser(context, item) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: postDelete(_traitData, entity, _legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: deleteUser(context) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: cognitoSendWelcomeEmail(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: sendWelcomeEmail( temporaryPassword, setPasswordAutomatically, context ) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult
User ->> CognitoTrait: enableMFA(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: userMFASMSpreference(context, true) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult
User ->> CognitoTrait: disableMFA(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: userMFASMSpreference(context, false) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult
User ->> CognitoTrait: postCreate(traitData, item, legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: createUser(false, true, context) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: postUpdate(traitData, item, legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: updateUser(context, item) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: postDelete(_traitData, entity, _legacyDatasourceWrapper, context) CognitoTrait ->> CognitoUserPoolApi: deleteUser(context) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: Promise<void>
User ->> CognitoTrait: cognitoSendWelcomeEmail(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: sendWelcomeEmail( temporaryPassword, setPasswordAutomatically, context ) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult
User ->> CognitoTrait: enableMFA(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: userMFASMSpreference(context, true) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult
User ->> CognitoTrait: disableMFA(datasourceWrapper, data) CognitoTrait ->> CognitoUserPoolApi: userMFASMSpreference(context, false) CognitoUserPoolApi -->> CognitoTrait: Success Response CognitoTrait -->> User: CognitoOperationResult