Documentation
¶
Overview ¶
Package config reads the configuration from environment variables. Invalid or contradictory settings are errors, so a misconfigured function fails at startup instead of misbehaving on a user's sign-up.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
LogLevel slog.Level
PreSignUp PreSignUp
PostConfirmation PostConfirmation
PreAuthentication PreAuthentication
EmailVerification EmailVerification
SendGrid SendGrid
}
Config is the function's configuration.
type EmailVerification ¶
type EmailVerification struct {
Enabled bool
// Triggers are the PreSignUp trigger sources to verify addresses for.
Triggers []string
// Allowlist holds domains that are treated as valid without calling
// SendGrid.
Allowlist []string
}
EmailVerification configures email verification for the PreSignUp hook.
type PasswordRotation ¶ added in v1.1.0
type PasswordRotation struct {
Enabled bool
// RotateBefore is the cutoff: a password the hooks haven't replaced
// since this time is replaced at the user's next sign-in.
RotateBefore time.Time
// Table is the DynamoDB table that records each replacement.
Table string
}
PasswordRotation configures the PreAuthentication hook's password rotation. Its settings are only required when it is enabled.
type PostConfirmation ¶
type PostConfirmation struct {
Enabled bool
// PolicyPath is optional; without a policy every native user's password
// is replaced.
PolicyPath string
// RotationTable is optional. When set, each replacement is recorded in
// the table of the PreAuthentication hook's password rotation.
RotationTable string
}
PostConfirmation configures the PostConfirmation hook.
type PreAuthentication ¶ added in v1.1.0
type PreAuthentication struct {
Enabled bool
// PolicyPath is optional.
PolicyPath string
// PasswordRotation is off by default.
PasswordRotation PasswordRotation
}
PreAuthentication configures the PreAuthentication hook.
Click to show internal directories.
Click to hide internal directories.