triggers

package
v0.0.0-...-ebf1a85 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 4, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PreSignUp                             = "PreSignUp_SignUp"
	PreSignUpAdminCreateUser              = "PreSignUp_AdminCreateUser"
	PostConfirmationConfirmSignUp         = "PostConfirmation_ConfirmSignUp"
	PostConfirmationConfirmForgotPassword = "PostConfirmation_ConfirmForgotPassword"
	PreAuthentication                     = "PreAuthentication_Authentication"
	PostAuthentication                    = "PostAuthentication_Authentication"
	PreTokenHostedAuth                    = "TokenGeneration_HostedAuth"
	PreTokenAuthentication                = "TokenGeneration_Authentication"
	PreTokenNewPasswordChallenge          = "TokenGeneration_NewPasswordChallenge"
	PreTokenAuthenticateDevice            = "TokenGeneration_AuthenticateDevice"
	PreTokenRefreshTokens                 = "TokenGeneration_RefreshTokens"
)

Cognito trigger sources

Variables

View Source
var (
	// ErrInvalidDomain reject email domain
	ErrInvalidDomain = errors.New("invalid email domain")
	// ErrInvalidSignUpCode reject supplied invite code
	ErrInvalidSignUpCode = errors.New("invalid invite code, please check the value")
	// ErrMissingEmail email missing from event attributes
	ErrMissingEmail = errors.New("missing email")
)

Functions

func RawResponse

func RawResponse(res interface{}) (*json.RawMessage, error)

Types

type CognitoPoolEventEnvelope

type CognitoPoolEventEnvelope struct {
	Version       string                                    `json:"version"`
	TriggerSource string                                    `json:"triggerSource"`
	Region        string                                    `json:"region"`
	UserPoolID    string                                    `json:"userPoolId"`
	CallerContext events.CognitoEventUserPoolsCallerContext `json:"callerContext"`
	UserName      string                                    `json:"userName"`
	Request       *json.RawMessage                          `json:"request"`
	Response      *json.RawMessage                          `json:"response"`
}

CognitoPoolEventEnvelope cognito events for a pool with dynamic request/response to cater for different types

type CognitoTriggers

type CognitoTriggers struct {
	// contains filtered or unexported fields
}

CognitoTriggers handles all the cognito triggers supported in this service

func NewCognitoTriggers

func NewCognitoTriggers(cfgs ...*aws.Config) *CognitoTriggers

func (*CognitoTriggers) PostConfirmationSignUp

PostConfirmationSignUp post confirmation used to notify of signups

func (*CognitoTriggers) PreAuthentication

PreAuthentication pre authentication

func (*CognitoTriggers) PreSignUp

PreSignUp pre sign up used to implement checks prior before signup

func (*CognitoTriggers) PreToken

PreToken pretoken lambda used to override roles/groups/claims

type Dispatcher

type Dispatcher struct {
	// contains filtered or unexported fields
}

Dispatcher trigger dispatcher

func NewDispatcher

func NewDispatcher(ct *CognitoTriggers, mon *hooks.LambdaHooks) *Dispatcher

NewDispatcher create a new trigger dispacher

func (*Dispatcher) Handler

func (di *Dispatcher) Handler(ctx context.Context, payload json.RawMessage) (json.RawMessage, error)

Handler dispatches events to cognito triggers

func (*Dispatcher) PostConfirmationSignUp

func (di *Dispatcher) PostConfirmationSignUp(ctx context.Context, evt *CognitoPoolEventEnvelope) error

PostConfirmationSignUp Post confirmation signup trigger dispatcher

func (*Dispatcher) PreAuthentication

func (di *Dispatcher) PreAuthentication(ctx context.Context, evt *CognitoPoolEventEnvelope) error

PreAuthentication preauthentication trigger dispatcher

func (*Dispatcher) PreSignUp

func (di *Dispatcher) PreSignUp(ctx context.Context, evt *CognitoPoolEventEnvelope) error

PreSignUp presign up trigger dispatcher

func (*Dispatcher) PreToken

func (di *Dispatcher) PreToken(ctx context.Context, evt *CognitoPoolEventEnvelope) error

PreToken pre token trigger dispatcher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL