hooks

package
v0.0.0-...-e3e9b0f Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultMFAHookRejectionMessage      = "Further MFA verification attempts will be rejected."
	DefaultPasswordHookRejectionMessage = "Further password verification attempts will be rejected."
)
View Source
const (
	// In Miliseconds
	DefaultTimeout = 2000
)
View Source
const (
	HookRejection = "reject"
)

Hook Names

View Source
const MinimumViableTokenSchema = `` /* 992-byte string literal not displayed */

#nosec

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessTokenClaims

type AccessTokenClaims struct {
	jwt.StandardClaims
	Email                         string                 `json:"email"`
	Phone                         string                 `json:"phone"`
	AppMetaData                   map[string]interface{} `json:"app_metadata"`
	UserMetaData                  map[string]interface{} `json:"user_metadata"`
	Role                          string                 `json:"role"`
	AuthenticatorAssuranceLevel   string                 `json:"aal,omitempty"`
	AuthenticationMethodReference []models.AMREntry      `json:"amr,omitempty"`
	SessionId                     string                 `json:"session_id,omitempty"`
	IsAnonymous                   bool                   `json:"is_anonymous"`
}

AccessTokenClaims is a struct thats used for JWT claims

type AuthHookError

type AuthHookError struct {
	HTTPCode int    `json:"http_code,omitempty"`
	Message  string `json:"message,omitempty"`
}

func (*AuthHookError) Error

func (a *AuthHookError) Error() string

type CustomAccessTokenInput

type CustomAccessTokenInput struct {
	UserID               uuid.UUID          `json:"user_id"`
	Claims               *AccessTokenClaims `json:"claims"`
	AuthenticationMethod string             `json:"authentication_method"`
}

type CustomAccessTokenOutput

type CustomAccessTokenOutput struct {
	Claims    map[string]interface{} `json:"claims"`
	HookError AuthHookError          `json:"error,omitempty"`
}

func (*CustomAccessTokenOutput) Error

func (ca *CustomAccessTokenOutput) Error() string

func (*CustomAccessTokenOutput) IsError

func (ca *CustomAccessTokenOutput) IsError() bool

type CustomSMSProviderInput

type CustomSMSProviderInput struct {
	UserID uuid.UUID `json:"user_id"`
	Phone  string    `json:"phone"`
	OTP    string    `json:"otp"`
}

type CustomSMSProviderOutput

type CustomSMSProviderOutput struct {
	Success   bool          `json:"success"`
	HookError AuthHookError `json:"error,omitempty"`
}

func (*CustomSMSProviderOutput) Error

func (cs *CustomSMSProviderOutput) Error() string

func (*CustomSMSProviderOutput) IsError

func (cs *CustomSMSProviderOutput) IsError() bool

func (*CustomSMSProviderOutput) IsHTTPHook

func (cs *CustomSMSProviderOutput) IsHTTPHook() bool

type HTTPHookInput

type HTTPHookInput interface {
	IsHTTPHook()
}

type HookOutput

type HookOutput interface {
	IsError() bool
	Error() string
}

type HookType

type HookType string
const (
	PostgresHook HookType = "pg-functions"
)

type MFAVerificationAttemptInput

type MFAVerificationAttemptInput struct {
	UserID   uuid.UUID `json:"user_id"`
	FactorID uuid.UUID `json:"factor_id"`
	Valid    bool      `json:"valid"`
}

type MFAVerificationAttemptOutput

type MFAVerificationAttemptOutput struct {
	Decision  string        `json:"decision"`
	Message   string        `json:"message"`
	HookError AuthHookError `json:"error"`
}

func (*MFAVerificationAttemptOutput) Error

func (*MFAVerificationAttemptOutput) IsError

func (mf *MFAVerificationAttemptOutput) IsError() bool

type PasswordVerificationAttemptInput

type PasswordVerificationAttemptInput struct {
	UserID uuid.UUID `json:"user_id"`
	Valid  bool      `json:"valid"`
}

type PasswordVerificationAttemptOutput

type PasswordVerificationAttemptOutput struct {
	Decision         string        `json:"decision"`
	Message          string        `json:"message"`
	ShouldLogoutUser bool          `json:"should_logout_user"`
	HookError        AuthHookError `json:"error"`
}

func (*PasswordVerificationAttemptOutput) Error

func (*PasswordVerificationAttemptOutput) IsError

Jump to

Keyboard shortcuts

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