hook

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2024 License: Apache-2.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeySessionIssuer       = "session"
	KeySessionDestroyer    = "revoke_active_sessions"
	KeyWebHook             = "web_hook"
	KeyAddressVerifier     = "require_verified_address"
	KeyVerificationUI      = "show_verification_ui"
	KeyTwoStepRegistration = "two_step_registration"
	KeyVerifier            = "verification"
)

Variables

View Source
var RequestHeaderAllowList = map[string]struct{}{
	"Accept":             {},
	"Accept-Encoding":    {},
	"Accept-Language":    {},
	"Content-Length":     {},
	"Content-Type":       {},
	"Origin":             {},
	"Priority":           {},
	"Referer":            {},
	"Sec-Ch-Ua":          {},
	"Sec-Ch-Ua-Mobile":   {},
	"Sec-Ch-Ua-Platform": {},
	"Sec-Fetch-Dest":     {},
	"Sec-Fetch-Mode":     {},
	"Sec-Fetch-Site":     {},
	"Sec-Fetch-User":     {},
	"True-Client-Ip":     {},
	"User-Agent":         {},
}

RequestHeaderAllowList contains the allowed request headers that are forwarded to the web hook target in canonical form (textproto.CanonicalMIMEHeaderKey).

Functions

This section is empty.

Types

type AddressVerifier

type AddressVerifier struct{}

func NewAddressVerifier

func NewAddressVerifier() *AddressVerifier

func (*AddressVerifier) ExecuteLoginPostHook

func (e *AddressVerifier) ExecuteLoginPostHook(_ http.ResponseWriter, _ *http.Request, _ node.UiNodeGroup, f *login.Flow, s *session.Session) error

type CodeAddressVerifier added in v1.1.0

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

func NewCodeAddressVerifier added in v1.1.0

func NewCodeAddressVerifier(r codeAddressDependencies) *CodeAddressVerifier

func (*CodeAddressVerifier) ExecutePostRegistrationPrePersistHook added in v1.1.0

func (cv *CodeAddressVerifier) ExecutePostRegistrationPrePersistHook(w http.ResponseWriter, r *http.Request, a *registration.Flow, i *identity.Identity) error

type Error

type Error struct {
	Config json.RawMessage
}

func (Error) ExecuteLoginPostHook

func (e Error) ExecuteLoginPostHook(w http.ResponseWriter, r *http.Request, g node.UiNodeGroup, a *login.Flow, s *session.Session) error

func (Error) ExecuteLoginPreHook

func (e Error) ExecuteLoginPreHook(w http.ResponseWriter, r *http.Request, a *login.Flow) error

func (Error) ExecutePostRecoveryHook

func (e Error) ExecutePostRecoveryHook(w http.ResponseWriter, r *http.Request, a *recovery.Flow, s *session.Session) error

func (Error) ExecutePostRegistrationPostPersistHook

func (e Error) ExecutePostRegistrationPostPersistHook(w http.ResponseWriter, r *http.Request, a *registration.Flow, s *session.Session) error

func (Error) ExecutePostRegistrationPrePersistHook

func (e Error) ExecutePostRegistrationPrePersistHook(w http.ResponseWriter, r *http.Request, a *registration.Flow, i *identity.Identity) error

func (Error) ExecutePostVerificationHook

func (e Error) ExecutePostVerificationHook(w http.ResponseWriter, r *http.Request, a *verification.Flow, i *identity.Identity) error

func (Error) ExecuteRecoveryPreHook added in v0.11.0

func (e Error) ExecuteRecoveryPreHook(w http.ResponseWriter, r *http.Request, a *recovery.Flow) error

func (Error) ExecuteRegistrationPreHook

func (e Error) ExecuteRegistrationPreHook(w http.ResponseWriter, r *http.Request, a *registration.Flow) error

func (Error) ExecuteSettingsPostPersistHook

func (e Error) ExecuteSettingsPostPersistHook(w http.ResponseWriter, r *http.Request, a *settings.Flow, id *identity.Identity, s *session.Session) error

func (Error) ExecuteSettingsPreHook added in v0.11.0

func (e Error) ExecuteSettingsPreHook(w http.ResponseWriter, r *http.Request, a *settings.Flow) error

func (Error) ExecuteSettingsPrePersistHook

func (e Error) ExecuteSettingsPrePersistHook(w http.ResponseWriter, r *http.Request, a *settings.Flow, s *identity.Identity) error

func (Error) ExecuteVerificationPreHook added in v0.11.0

func (e Error) ExecuteVerificationPreHook(w http.ResponseWriter, r *http.Request, a *verification.Flow) error

type PasswordMigration added in v1.3.0

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

func NewPasswordMigrationHook added in v1.3.0

func NewPasswordMigrationHook(deps webHookDependencies, conf json.RawMessage) *PasswordMigration

func (*PasswordMigration) Execute added in v1.3.0

func (p *PasswordMigration) Execute(ctx context.Context, data *PasswordMigrationRequest) (err error)

type PasswordMigrationRequest added in v1.3.0

type PasswordMigrationRequest struct {
	Identifier string `json:"identifier"`
	Password   string `json:"password"`
}

type PasswordMigrationResponse added in v1.3.0

type PasswordMigrationResponse struct {
	Status string `json:"status"`
}

type SessionDestroyer

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

func NewSessionDestroyer

func NewSessionDestroyer(r sessionDestroyerDependencies) *SessionDestroyer

func (*SessionDestroyer) ExecuteLoginPostHook

func (e *SessionDestroyer) ExecuteLoginPostHook(_ http.ResponseWriter, r *http.Request, _ node.UiNodeGroup, _ *login.Flow, s *session.Session) error

func (*SessionDestroyer) ExecutePostRecoveryHook

func (e *SessionDestroyer) ExecutePostRecoveryHook(_ http.ResponseWriter, r *http.Request, _ *recovery.Flow, s *session.Session) error

func (*SessionDestroyer) ExecuteSettingsPostPersistHook added in v1.1.0

func (e *SessionDestroyer) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, r *http.Request, _ *settings.Flow, i *identity.Identity, s *session.Session) error

type SessionIssuer

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

func NewSessionIssuer

func NewSessionIssuer(r sessionIssuerDependencies) *SessionIssuer

func (*SessionIssuer) ExecutePostRegistrationPostPersistHook

func (e *SessionIssuer) ExecutePostRegistrationPostPersistHook(w http.ResponseWriter, r *http.Request, a *registration.Flow, s *session.Session) error

type SessionIssuerProvider

type SessionIssuerProvider interface {
	HookSessionIssuer() *SessionIssuer
}

type ShowVerfificationUIProvider added in v0.13.0

type ShowVerfificationUIProvider interface {
	HookShowVerificationUI() *ShowVerificationUIHook
}

type ShowVerificationUIHook added in v0.13.0

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

ShowVerificationUIHook is a post registration hook that redirects browser clients to the verification UI.

func NewShowVerificationUIHook added in v0.13.0

func NewShowVerificationUIHook(d showVerificationUIDependencies) *ShowVerificationUIHook

func (*ShowVerificationUIHook) ExecuteLoginPostHook added in v1.2.0

ExecuteLoginPostHook adds redirect headers and status code if the request is a browser request. If the request is not a browser request, this hook does nothing.

func (*ShowVerificationUIHook) ExecutePostRegistrationPostPersistHook added in v0.13.0

func (e *ShowVerificationUIHook) ExecutePostRegistrationPostPersistHook(_ http.ResponseWriter, r *http.Request, f *registration.Flow, _ *session.Session) error

ExecutePostRegistrationPostPersistHook adds redirect headers and status code if the request is a browser request. If the request is not a browser request, this hook does nothing.

type TwoStepRegistration added in v1.2.0

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

func NewTwoStepRegistration added in v1.2.0

func NewTwoStepRegistration(d twoStepRegistrationDeps) *TwoStepRegistration

func (*TwoStepRegistration) ExecuteRegistrationPreHook added in v1.2.0

func (e *TwoStepRegistration) ExecuteRegistrationPreHook(_ http.ResponseWriter, _ *http.Request, regFlow *registration.Flow) (err error)

type Verifier

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

func NewVerifier

func NewVerifier(r verifierDependencies) *Verifier

func (*Verifier) ExecuteLoginPostHook added in v1.2.0

func (e *Verifier) ExecuteLoginPostHook(w http.ResponseWriter, r *http.Request, g node.UiNodeGroup, f *login.Flow, s *session.Session) (err error)

func (*Verifier) ExecutePostRegistrationPostPersistHook

func (e *Verifier) ExecutePostRegistrationPostPersistHook(w http.ResponseWriter, r *http.Request, f *registration.Flow, s *session.Session) error

func (*Verifier) ExecuteSettingsPostPersistHook

func (e *Verifier) ExecuteSettingsPostPersistHook(w http.ResponseWriter, r *http.Request, f *settings.Flow, i *identity.Identity, _ *session.Session) error

type WebHook

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

func NewWebHook

func NewWebHook(r webHookDependencies, c json.RawMessage) *WebHook

func (*WebHook) ExecuteLoginPostHook

func (e *WebHook) ExecuteLoginPostHook(_ http.ResponseWriter, req *http.Request, _ node.UiNodeGroup, flow *login.Flow, session *session.Session) error

func (*WebHook) ExecuteLoginPreHook

func (e *WebHook) ExecuteLoginPreHook(_ http.ResponseWriter, req *http.Request, flow *login.Flow) error

func (*WebHook) ExecutePostRecoveryHook

func (e *WebHook) ExecutePostRecoveryHook(_ http.ResponseWriter, req *http.Request, flow *recovery.Flow, session *session.Session) error

func (*WebHook) ExecutePostRegistrationPostPersistHook

func (e *WebHook) ExecutePostRegistrationPostPersistHook(_ http.ResponseWriter, req *http.Request, flow *registration.Flow, session *session.Session) error

func (*WebHook) ExecutePostRegistrationPrePersistHook added in v0.11.0

func (e *WebHook) ExecutePostRegistrationPrePersistHook(_ http.ResponseWriter, req *http.Request, flow *registration.Flow, id *identity.Identity) error

func (*WebHook) ExecutePostVerificationHook

func (e *WebHook) ExecutePostVerificationHook(_ http.ResponseWriter, req *http.Request, flow *verification.Flow, id *identity.Identity) error

func (*WebHook) ExecuteRecoveryPreHook added in v0.11.0

func (e *WebHook) ExecuteRecoveryPreHook(_ http.ResponseWriter, req *http.Request, flow *recovery.Flow) error

func (*WebHook) ExecuteRegistrationPreHook

func (e *WebHook) ExecuteRegistrationPreHook(_ http.ResponseWriter, req *http.Request, flow *registration.Flow) error

func (*WebHook) ExecuteSettingsPostPersistHook

func (e *WebHook) ExecuteSettingsPostPersistHook(_ http.ResponseWriter, req *http.Request, flow *settings.Flow, id *identity.Identity, _ *session.Session) error

func (*WebHook) ExecuteSettingsPreHook added in v0.11.0

func (e *WebHook) ExecuteSettingsPreHook(_ http.ResponseWriter, req *http.Request, flow *settings.Flow) error

func (*WebHook) ExecuteSettingsPrePersistHook added in v0.11.0

func (e *WebHook) ExecuteSettingsPrePersistHook(_ http.ResponseWriter, req *http.Request, flow *settings.Flow, id *identity.Identity) error

func (*WebHook) ExecuteVerificationPreHook added in v0.11.0

func (e *WebHook) ExecuteVerificationPreHook(_ http.ResponseWriter, req *http.Request, flow *verification.Flow) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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