Documentation
¶
Index ¶
- Constants
- Variables
- type AccessPolicy
- type Admin
- type AdminPolicy
- type AdminPolicyReader
- type AdminPolicyReaderFunc
- type AllowlistPolicy
- type AllowlistPolicyReader
- type AllowlistPolicyReaderFunc
- type Authentication
- type AuthenticationPolicy
- type AuthenticationPolicyReader
- type AuthenticationPolicyReaderFunc
- type Cache
- type Challenge
- type ChallengePolicy
- type ChallengePolicyReader
- type Config
- type Control
- type DB
- type Definition
- type Description
- type Email
- type EmailPolicy
- type EmailPolicyReader
- type EmailPolicyReaderFunc
- type EnvironmentVariable
- type InternalAPI
- type Key
- type Logging
- type Mutation
- type OAuth
- type Observability
- type Organization
- type OrganizationPolicy
- type OrganizationPolicyReader
- type OrganizationPolicyReaderFunc
- type PersistedOverride
- type PersistedState
- type RateLimit
- type RateLimitPolicy
- type Reload
- type RuntimeSettingsStore
- type Service
- func (s *Service) Clear(ctx context.Context, key Key, actorID uuid.UUID, expectedRevision int64) (Description, error)
- func (s *Service) Current() ChallengePolicy
- func (s *Service) CurrentAdmin() AdminPolicy
- func (s *Service) CurrentAllowlist() AllowlistPolicy
- func (s *Service) CurrentAuthentication() AuthenticationPolicy
- func (s *Service) CurrentChallenge() ChallengePolicy
- func (s *Service) CurrentEmail() EmailPolicy
- func (s *Service) CurrentOrganization() OrganizationPolicy
- func (s *Service) CurrentRateLimits() RateLimitPolicy
- func (s *Service) CurrentSession() SessionPolicy
- func (s *Service) CurrentSessionCookies() SessionCookiePolicy
- func (s *Service) CurrentToken() TokenPolicy
- func (s *Service) CurrentUI() UIPolicy
- func (s *Service) CurrentWebhook() WebhookPolicy
- func (s *Service) Describe(key Key) (Description, error)
- func (s *Service) List() []Description
- func (s *Service) Reconcile(ctx context.Context) error
- func (s *Service) Set(ctx context.Context, key Key, rawValue string, actorID uuid.UUID, ...) (Description, error)
- func (s *Service) StartReconciler(ctx context.Context)
- func (s *Service) Startup() *Config
- type ServiceOptions
- type Session
- type SessionCookiePolicy
- type SessionCookiePolicyReader
- type SessionCookiePolicyReaderFunc
- type SessionPolicy
- type SessionPolicyReader
- type SessionPolicyReaderFunc
- type Source
- type StaticChallengePolicy
- type Token
- type TokenPolicy
- type TokenPolicyReader
- type TokenPolicyReaderFunc
- type UI
- type UIPolicy
- type UIPolicyReader
- type UIPolicyReaderFunc
- type ValueType
- type Values
- type Webhook
- type WebhookPolicy
- type WebhookPolicyReader
- type WebhookPolicyReaderFunc
Constants ¶
const ( OrgModePersonal = "personal" OrgModeSingle = "single" OrgModeMulti = "multi" )
const DefaultReconcileInterval = 2 * time.Second
Variables ¶
var ( ErrUnknownSetting = errors.New("unknown runtime setting") ErrSettingLocked = errors.New("runtime setting is locked") ErrRevisionConflict = configruntime.ErrRevisionConflict ErrInvalidValue = errors.New("invalid runtime setting value") ErrMissingActor = errors.New("runtime setting actor is missing") )
Functions ¶
This section is empty.
Types ¶
type AccessPolicy ¶ added in v0.1.10
type AccessPolicy struct {
AllowedEmailEnabled bool `env:"AUTHARA_ACCESS_POLICY_ALLOWLIST_ENABLED,default=false"`
}
type Admin ¶ added in v0.1.23
type Admin struct {
AuditRetentionDays int `env:"AUTHARA_ADMIN_AUDIT_RETENTION_DAYS,default=180"`
}
type AdminPolicy ¶ added in v0.21.0
type AdminPolicyReader ¶ added in v0.21.0
type AdminPolicyReader interface {
CurrentAdmin() AdminPolicy
}
type AdminPolicyReaderFunc ¶ added in v0.21.0
type AdminPolicyReaderFunc func() AdminPolicy
func (AdminPolicyReaderFunc) CurrentAdmin ¶ added in v0.21.0
func (f AdminPolicyReaderFunc) CurrentAdmin() AdminPolicy
type AllowlistPolicy ¶ added in v0.21.0
type AllowlistPolicy struct {
AllowlistEnabled bool
}
type AllowlistPolicyReader ¶ added in v0.21.0
type AllowlistPolicyReader interface {
CurrentAllowlist() AllowlistPolicy
}
type AllowlistPolicyReaderFunc ¶ added in v0.21.0
type AllowlistPolicyReaderFunc func() AllowlistPolicy
func (AllowlistPolicyReaderFunc) CurrentAllowlist ¶ added in v0.21.0
func (f AllowlistPolicyReaderFunc) CurrentAllowlist() AllowlistPolicy
type Authentication ¶ added in v0.17.0
type Authentication struct {
UsernameLoginEnabled bool `env:"AUTHARA_USERNAME_LOGIN_ENABLED,default=false"`
}
type AuthenticationPolicy ¶ added in v0.21.0
type AuthenticationPolicy struct {
UsernameLoginEnabled bool
}
type AuthenticationPolicyReader ¶ added in v0.21.0
type AuthenticationPolicyReader interface {
CurrentAuthentication() AuthenticationPolicy
}
type AuthenticationPolicyReaderFunc ¶ added in v0.21.0
type AuthenticationPolicyReaderFunc func() AuthenticationPolicy
func (AuthenticationPolicyReaderFunc) CurrentAuthentication ¶ added in v0.21.0
func (f AuthenticationPolicyReaderFunc) CurrentAuthentication() AuthenticationPolicy
type Challenge ¶ added in v0.1.12
type Challenge struct {
Enabled bool `env:"AUTHARA_CHALLENGE_ENABLED,default=false"`
TTL time.Duration `env:"AUTHARA_CHALLENGE_TTL,default=30m"`
VerificationCodeTTL time.Duration `env:"AUTHARA_CHALLENGE_VERIFICATION_CODE_TTL,default=10m"`
MaxAttempts int `env:"AUTHARA_CHALLENGE_MAX_ATTEMPTS,default=5"`
MaxResends int `env:"AUTHARA_CHALLENGE_MAX_RESENDS,default=3"`
MinResendInterval time.Duration `env:"AUTHARA_CHALLENGE_MIN_RESEND_INTERVAL,default=30s"`
}
type ChallengePolicy ¶ added in v0.21.0
type ChallengePolicy struct {
Enabled bool
TTL time.Duration
VerificationCodeTTL time.Duration
MaxAttempts int
MaxResends int
MinimumResendInterval time.Duration
}
ChallengePolicy is published as one immutable value so an operation cannot observe a mixture of revisions while reading related settings.
type ChallengePolicyReader ¶ added in v0.21.0
type ChallengePolicyReader interface {
CurrentChallenge() ChallengePolicy
}
type Config ¶
type Config struct {
Values Values
DB DB
Cache Cache
Logging Logging
Observability Observability
UI UI
OAuth OAuth
Token Token
Session Session
RateLimit RateLimit
Webhook Webhook
AccessPolicy AccessPolicy
Admin Admin
InternalAPI InternalAPI
Organization Organization
Authentication Authentication
Challenge Challenge
Email Email
}
type DB ¶
type DB struct {
Host string `env:"POSTGRESQL_HOST,required"`
Port int `env:"POSTGRESQL_PORT,required"`
Username string `env:"POSTGRESQL_USERNAME,required"`
Password string `env:"POSTGRESQL_PASSWORD,required"`
Database string `env:"POSTGRESQL_DATABASE,required"`
Schema string `env:"POSTGRESQL_SCHEMA,default=authara"`
Timezone string `env:"POSTGRESQL_TIMEZONE,default=UTC"`
LogSQL bool `env:"POSTGRESQL_LOG_SQL,default=false"`
MaxOpenConns int `env:"AUTHARA_DB_MAX_OPEN_CONNS,default=40"`
MaxIdleConns int `env:"AUTHARA_DB_MAX_IDLE_CONNS,default=20"`
ConnMaxLifetime time.Duration `env:"AUTHARA_DB_CONN_MAX_LIFETIME,default=30m"`
ConnMaxIdleTime time.Duration `env:"AUTHARA_DB_CONN_MAX_IDLE_TIME,default=5m"`
}
type Definition ¶ added in v0.21.0
type Definition struct {
Key Key
Name string
Description string
Environment string
Control Control
Reload Reload
Sensitive bool
Group string
Type ValueType
DefaultValue string
Required bool
HasDefault bool
Minimum string
Maximum string
Allowed []string
Impact string
// contains filtered or unexported fields
}
func LookupDefinition ¶ added in v0.21.0
func LookupDefinition(key Key) (Definition, bool)
type Description ¶ added in v0.21.0
type Email ¶ added in v0.1.12
type Email struct {
Provider string `env:"AUTHARA_EMAIL_PROVIDER,default=noop"`
From string `env:"AUTHARA_EMAIL_FROM"`
SMTPHost string `env:"AUTHARA_EMAIL_SMTP_HOST"`
SMTPPort int `env:"AUTHARA_EMAIL_SMTP_PORT,default=587"`
SMTPUsername string `env:"AUTHARA_EMAIL_SMTP_USERNAME"`
SMTPPassword string `env:"AUTHARA_EMAIL_SMTP_PASSWORD"`
SMTPTLS bool `env:"AUTHARA_EMAIL_SMTP_TLS,default=true"`
SMTPTimeout time.Duration `env:"AUTHARA_EMAIL_SMTP_TIMEOUT,default=10s"`
WorkerCount int `env:"AUTHARA_EMAIL_WORKER_COUNT,default=2"`
WorkerPollInterval time.Duration `env:"AUTHARA_EMAIL_WORKER_POLL_INTERVAL,default=2s"`
JobMaxAttempts int `env:"AUTHARA_EMAIL_JOB_MAX_ATTEMPTS,default=10"`
CleanupSentAfter time.Duration `env:"AUTHARA_EMAIL_CLEANUP_SENT_AFTER,default=720h"` // 30d
CleanupFailedAfter time.Duration `env:"AUTHARA_EMAIL_CLEANUP_FAILED_AFTER,default=2160h"` // 90d
}
type EmailPolicy ¶ added in v0.21.0
type EmailPolicyReader ¶ added in v0.21.0
type EmailPolicyReader interface {
CurrentEmail() EmailPolicy
}
type EmailPolicyReaderFunc ¶ added in v0.21.0
type EmailPolicyReaderFunc func() EmailPolicy
func (EmailPolicyReaderFunc) CurrentEmail ¶ added in v0.21.0
func (f EmailPolicyReaderFunc) CurrentEmail() EmailPolicy
type EnvironmentVariable ¶ added in v0.21.0
type EnvironmentVariable struct {
Name string
DisplayName string
Group string
Type string
Default string
Required bool
HasDefault bool
Sensitive bool
}
EnvironmentVariable describes one environment variable consumed by Config. The catalog is derived from the same struct tags used by go-envconfig so new variables cannot silently disappear from the operator settings overview.
func EnvironmentVariables ¶ added in v0.21.0
func EnvironmentVariables() []EnvironmentVariable
EnvironmentVariables returns every environment variable in declaration order, grouped by the top-level Config section that owns it.
type InternalAPI ¶ added in v0.1.24
type InternalAPI struct {
Token string `env:"AUTHARA_INTERNAL_API_TOKEN"`
}
type Key ¶ added in v0.21.0
type Key = configruntime.Key
const ( KeyUIDefaultReturnTo Key = "ui.default_return_to" KeyAuthenticationUsernameLoginEnabled Key = "authentication.username_login_enabled" KeyTokenAccessTTL Key = "token.access_ttl" KeySessionTTL Key = "session.ttl" KeySessionRefreshTokenTTL Key = "session.refresh_token_ttl" KeySessionRotation Key = "session.refresh_token_rotation" KeyOrganizationPublicManagementEnabled Key = "organization.public_management_enabled" KeyOrganizationInvitationTTL Key = "organization.invitation_ttl" KeyAccessPolicyAllowlistEnabled Key = "access_policy.allowlist_enabled" KeyAdminAuditRetention Key = "admin.audit_retention" KeyEmailJobMaxAttempts Key = "email.job_max_attempts" KeyEmailCleanupSentAfter Key = "email.cleanup_sent_after" KeyEmailCleanupFailedAfter Key = "email.cleanup_failed_after" KeyWebhookEnabledEvents Key = "webhook.enabled_events" KeyWebhookTimeout Key = "webhook.timeout" KeyWebhookMaxDeliveryAttempts Key = "webhook.max_delivery_attempts" KeyWebhookProcessingStaleAfter Key = "webhook.processing_stale_after" KeyWebhookDeliveredRetention Key = "webhook.delivered_retention" KeyWebhookFailedRetention Key = "webhook.failed_retention" KeyWebhookMaintenanceBatchSize Key = "webhook.maintenance_batch_size" KeyChallengeEnabled Key = "challenge.enabled" KeyChallengeTTL Key = "challenge.ttl" KeyChallengeVerificationCodeTTL Key = "challenge.verification_code_ttl" KeyChallengeMaxAttempts Key = "challenge.max_attempts" KeyChallengeMaxResends Key = "challenge.max_resends" KeyChallengeMinimumResendInterval Key = "challenge.minimum_resend_interval" KeyRateLimitLoginIPLimit Key = "rate_limit.login.ip.limit" KeyRateLimitLoginIPWindow Key = "rate_limit.login.ip.window" KeyRateLimitLoginEmailLimit Key = "rate_limit.login.email.limit" KeyRateLimitLoginEmailWindow Key = "rate_limit.login.email.window" KeyRateLimitSignupIPLimit Key = "rate_limit.signup.ip.limit" KeyRateLimitSignupIPWindow Key = "rate_limit.signup.ip.window" KeyRateLimitSignupEmailLimit Key = "rate_limit.signup.email.limit" KeyRateLimitSignupEmailWindow Key = "rate_limit.signup.email.window" KeyRateLimitPasswordResetIPLimit Key = "rate_limit.password_reset.ip.limit" KeyRateLimitPasswordResetIPWindow Key = "rate_limit.password_reset.ip.window" KeyRateLimitPasswordResetEmailLimit Key = "rate_limit.password_reset.email.limit" KeyRateLimitPasswordResetEmailWindow Key = "rate_limit.password_reset.email.window" KeyRateLimitPasskeyLoginIPLimit Key = "rate_limit.passkey_login.ip.limit" KeyRateLimitPasskeyLoginIPWindow Key = "rate_limit.passkey_login.ip.window" KeyRateLimitChallengeVerifyIPLimit Key = "rate_limit.challenge_verify.ip.limit" KeyRateLimitChallengeVerifyIPWindow Key = "rate_limit.challenge_verify.ip.window" KeyRateLimitChallengeResendIPLimit Key = "rate_limit.challenge_resend.ip.limit" KeyRateLimitChallengeResendIPWindow Key = "rate_limit.challenge_resend.ip.window" KeyRateLimitCleanupEvery Key = "rate_limit.cleanup_every" KeyRateLimitMaxEntries Key = "rate_limit.max_entries" )
type Mutation ¶ added in v0.21.0
type Mutation = configruntime.Mutation
type Observability ¶ added in v0.19.0
type Observability struct {
Enabled bool `env:"AUTHARA_METRICS_ENABLED,default=false"`
}
type Organization ¶ added in v0.1.24
type OrganizationPolicy ¶ added in v0.21.0
type OrganizationPolicyReader ¶ added in v0.21.0
type OrganizationPolicyReader interface {
CurrentOrganization() OrganizationPolicy
}
type OrganizationPolicyReaderFunc ¶ added in v0.21.0
type OrganizationPolicyReaderFunc func() OrganizationPolicy
func (OrganizationPolicyReaderFunc) CurrentOrganization ¶ added in v0.21.0
func (f OrganizationPolicyReaderFunc) CurrentOrganization() OrganizationPolicy
type PersistedOverride ¶ added in v0.21.0
type PersistedOverride = configruntime.PersistedOverride
type PersistedState ¶ added in v0.21.0
type PersistedState = configruntime.PersistedState
type RateLimit ¶
type RateLimit struct {
LoginIPLimit int `env:"AUTHARA_RATE_LIMIT_LOGIN_IP_LIMIT,default=5"`
LoginIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_LOGIN_IP_WINDOW,default=1m"`
LoginEmailLimit int `env:"AUTHARA_RATE_LIMIT_LOGIN_EMAIL_LIMIT,default=10"`
LoginEmailWindowRaw string `env:"AUTHARA_RATE_LIMIT_LOGIN_EMAIL_WINDOW,default=1h"`
SignupIPLimit int `env:"AUTHARA_RATE_LIMIT_SIGNUP_IP_LIMIT,default=3"`
SignupIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_SIGNUP_IP_WINDOW,default=1h"`
SignupEmailLimit int `env:"AUTHARA_RATE_LIMIT_SIGNUP_EMAIL_LIMIT,default=3"`
SignupEmailWindowRaw string `env:"AUTHARA_RATE_LIMIT_SIGNUP_EMAIL_WINDOW,default=24h"`
PasswordResetIPLimit int `env:"AUTHARA_RATE_LIMIT_PASSWORD_RESET_IP_LIMIT,default=5"`
PasswordResetIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_PASSWORD_RESET_IP_WINDOW,default=1h"`
PasswordResetEmailLimit int `env:"AUTHARA_RATE_LIMIT_PASSWORD_RESET_EMAIL_LIMIT,default=3"`
PasswordResetEmailWindowRaw string `env:"AUTHARA_RATE_LIMIT_PASSWORD_RESET_EMAIL_WINDOW,default=24h"`
PasskeyLoginIPLimit int `env:"AUTHARA_RATE_LIMIT_PASSKEY_LOGIN_IP_LIMIT,default=30"`
PasskeyLoginIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_PASSKEY_LOGIN_IP_WINDOW,default=10m"`
ChallengeVerifyIPLimit int `env:"AUTHARA_RATE_LIMIT_CHALLENGE_VERIFY_IP_LIMIT,default=30"`
ChallengeVerifyIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_CHALLENGE_VERIFY_IP_WINDOW,default=10m"`
ChallengeResendIPLimit int `env:"AUTHARA_RATE_LIMIT_CHALLENGE_RESEND_IP_LIMIT,default=10"`
ChallengeResendIPWindowRaw string `env:"AUTHARA_RATE_LIMIT_CHALLENGE_RESEND_IP_WINDOW,default=1h"`
CleanupEvery int `env:"AUTHARA_RATE_LIMIT_CLEANUP_EVERY,default=200"`
MaxEntries int `env:"AUTHARA_RATE_LIMIT_MAX_ENTRIES,default=50000"`
LoginIPWindow time.Duration
LoginEmailWindow time.Duration
SignupIPWindow time.Duration
SignupEmailWindow time.Duration
PasswordResetIPWindow time.Duration
PasswordResetEmailWindow time.Duration
PasskeyLoginIPWindow time.Duration
ChallengeVerifyIPWindow time.Duration
ChallengeResendIPWindow time.Duration
}
type RateLimitPolicy ¶ added in v0.21.0
type RateLimitPolicy struct {
LoginIPLimit int
LoginIPWindow time.Duration
LoginEmailLimit int
LoginEmailWindow time.Duration
SignupIPLimit int
SignupIPWindow time.Duration
SignupEmailLimit int
SignupEmailWindow time.Duration
PasswordResetIPLimit int
PasswordResetIPWindow time.Duration
PasswordResetEmailLimit int
PasswordResetEmailWindow time.Duration
PasskeyLoginIPLimit int
PasskeyLoginIPWindow time.Duration
ChallengeVerifyIPLimit int
ChallengeVerifyIPWindow time.Duration
ChallengeResendIPLimit int
ChallengeResendIPWindow time.Duration
CleanupEvery int
MaxEntries int
}
RateLimitPolicy is published atomically so one limiter call observes a consistent set of thresholds, windows, and in-memory safety controls.
type RuntimeSettingsStore ¶ added in v0.21.0
type Service ¶ added in v0.21.0
type Service struct {
*Config
// contains filtered or unexported fields
}
func NewService ¶ added in v0.21.0
func NewService(ctx context.Context, cfg ServiceOptions) (*Service, error)
func (*Service) Current ¶ added in v0.21.0
func (s *Service) Current() ChallengePolicy
Current is retained for compatibility with the initial challenge-policy API. New consumers should use the service-specific CurrentChallenge method.
func (*Service) CurrentAdmin ¶ added in v0.21.0
func (s *Service) CurrentAdmin() AdminPolicy
func (*Service) CurrentAllowlist ¶ added in v0.21.0
func (s *Service) CurrentAllowlist() AllowlistPolicy
func (*Service) CurrentAuthentication ¶ added in v0.21.0
func (s *Service) CurrentAuthentication() AuthenticationPolicy
func (*Service) CurrentChallenge ¶ added in v0.21.0
func (s *Service) CurrentChallenge() ChallengePolicy
func (*Service) CurrentEmail ¶ added in v0.21.0
func (s *Service) CurrentEmail() EmailPolicy
func (*Service) CurrentOrganization ¶ added in v0.21.0
func (s *Service) CurrentOrganization() OrganizationPolicy
func (*Service) CurrentRateLimits ¶ added in v0.21.0
func (s *Service) CurrentRateLimits() RateLimitPolicy
func (*Service) CurrentSession ¶ added in v0.21.0
func (s *Service) CurrentSession() SessionPolicy
func (*Service) CurrentSessionCookies ¶ added in v0.21.0
func (s *Service) CurrentSessionCookies() SessionCookiePolicy
func (*Service) CurrentToken ¶ added in v0.21.0
func (s *Service) CurrentToken() TokenPolicy
func (*Service) CurrentWebhook ¶ added in v0.21.0
func (s *Service) CurrentWebhook() WebhookPolicy
func (*Service) Describe ¶ added in v0.21.0
func (s *Service) Describe(key Key) (Description, error)
func (*Service) List ¶ added in v0.21.0
func (s *Service) List() []Description
func (*Service) StartReconciler ¶ added in v0.21.0
type ServiceOptions ¶ added in v0.21.0
type ServiceOptions struct {
Startup *Config
Store RuntimeSettingsStore
LookupEnvironment func(string) (string, bool)
Environment []EnvironmentVariable
Logger *slog.Logger
ReconcileInterval time.Duration
}
type Session ¶
type Session struct {
SessionTTLDays int `env:"AUTHARA_SESSION_TTL_DAYS,default=60"`
RefreshTokenTTLDays int `env:"AUTHARA_REFRESH_TOKEN_TTL_DAYS,default=14"`
RefreshTokenRotationRaw string `env:"AUTHARA_REFRESH_TOKEN_ROTATION_INTERVAL,default=24h"`
SessionTTL time.Duration
RefreshTokenTTL time.Duration
RefreshTokenRotation time.Duration
}
type SessionCookiePolicy ¶ added in v0.21.0
SessionCookiePolicy is an HTTP-consumer snapshot combining the two policy groups needed to write a consistent access/refresh cookie pair.
type SessionCookiePolicyReader ¶ added in v0.21.0
type SessionCookiePolicyReader interface {
CurrentSessionCookies() SessionCookiePolicy
}
type SessionCookiePolicyReaderFunc ¶ added in v0.21.0
type SessionCookiePolicyReaderFunc func() SessionCookiePolicy
func (SessionCookiePolicyReaderFunc) CurrentSessionCookies ¶ added in v0.21.0
func (f SessionCookiePolicyReaderFunc) CurrentSessionCookies() SessionCookiePolicy
type SessionPolicy ¶ added in v0.21.0
type SessionPolicyReader ¶ added in v0.21.0
type SessionPolicyReader interface {
CurrentSession() SessionPolicy
}
type SessionPolicyReaderFunc ¶ added in v0.21.0
type SessionPolicyReaderFunc func() SessionPolicy
func (SessionPolicyReaderFunc) CurrentSession ¶ added in v0.21.0
func (f SessionPolicyReaderFunc) CurrentSession() SessionPolicy
type StaticChallengePolicy ¶ added in v0.21.0
type StaticChallengePolicy struct {
Policy ChallengePolicy
}
func (StaticChallengePolicy) CurrentChallenge ¶ added in v0.21.0
func (s StaticChallengePolicy) CurrentChallenge() ChallengePolicy
type Token ¶
type Token struct {
Issuer string `env:"AUTHARA_JWT_ISSUER,required"`
ActiveKeyID string `env:"AUTHARA_JWT_ACTIVE_KEY_ID,required"`
Keys map[string]string `env:"AUTHARA_JWT_KEYS,required"`
AccessTokenTTLMinutes int `env:"AUTHARA_ACCESS_TOKEN_TTL_MINUTES,default=10"`
AccessTokenTTL time.Duration
KeySet *token.KeySet
}
type TokenPolicy ¶ added in v0.21.0
type TokenPolicyReader ¶ added in v0.21.0
type TokenPolicyReader interface {
CurrentToken() TokenPolicy
}
type TokenPolicyReaderFunc ¶ added in v0.21.0
type TokenPolicyReaderFunc func() TokenPolicy
func (TokenPolicyReaderFunc) CurrentToken ¶ added in v0.21.0
func (f TokenPolicyReaderFunc) CurrentToken() TokenPolicy
type UI ¶ added in v0.10.0
type UI struct {
DefaultReturnTo string `env:"AUTHARA_DEFAULT_RETURN_TO,default=/"`
}
type UIPolicyReader ¶ added in v0.21.0
type UIPolicyReader interface {
CurrentUI() UIPolicy
}
type UIPolicyReaderFunc ¶ added in v0.21.0
type UIPolicyReaderFunc func() UIPolicy
func (UIPolicyReaderFunc) CurrentUI ¶ added in v0.21.0
func (f UIPolicyReaderFunc) CurrentUI() UIPolicy
type Webhook ¶ added in v0.1.3
type Webhook struct {
URLRaw string `env:"AUTHARA_WEBHOOK_URL"`
Secret string `env:"AUTHARA_WEBHOOK_SECRET"`
EnabledEvents []string `env:"AUTHARA_WEBHOOK_ENABLED_EVENTS"`
Timeout time.Duration `env:"AUTHARA_WEBHOOK_TIMEOUT,default=5s"`
WorkerCount int `env:"AUTHARA_WEBHOOK_WORKER_COUNT,default=2"`
MaxDeliveryAttempts int `env:"AUTHARA_WEBHOOK_MAX_DELIVERY_ATTEMPTS,default=3"`
ProcessingStaleAfter time.Duration `env:"AUTHARA_WEBHOOK_PROCESSING_STALE_AFTER,default=2m"`
StaleReaperInterval time.Duration `env:"AUTHARA_WEBHOOK_STALE_REAPER_INTERVAL,default=1m"`
DeliveredRetention time.Duration `env:"AUTHARA_WEBHOOK_DELIVERED_RETENTION,default=24h"`
FailedRetention time.Duration `env:"AUTHARA_WEBHOOK_FAILED_RETENTION,default=720h"`
CleanupInterval time.Duration `env:"AUTHARA_WEBHOOK_CLEANUP_INTERVAL,default=1h"`
MaintenanceBatchSize int `env:"AUTHARA_WEBHOOK_MAINTENANCE_BATCH_SIZE,default=1000"`
URL string
EnabledEventSet map[string]struct{}
}
func (*Webhook) EventEnabled ¶ added in v0.1.3
type WebhookPolicy ¶ added in v0.21.0
type WebhookPolicyReader ¶ added in v0.21.0
type WebhookPolicyReader interface {
CurrentWebhook() WebhookPolicy
}
type WebhookPolicyReaderFunc ¶ added in v0.21.0
type WebhookPolicyReaderFunc func() WebhookPolicy
func (WebhookPolicyReaderFunc) CurrentWebhook ¶ added in v0.21.0
func (f WebhookPolicyReaderFunc) CurrentWebhook() WebhookPolicy