Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( Bootstrap = BootstrapConfig{ DbFilePath: "./db/autentico.db", AppURL: "http://localhost:9999", AppOAuthPath: "/oauth2", AppEnableCORS: true, AppDomain: "localhost", AppHost: "localhost:9999", AppPort: "9999", AppAuthIssuer: "http://localhost:9999/oauth2", AuthAccessTokenSecret: "your-secret-here", AuthRefreshTokenSecret: "your-secret-here", AuthCSRFProtectionSecretKey: "your-secret-here", AuthCSRFSecureCookie: false, AuthJwkCertKeyID: "autentico-key-1", AuthRefreshTokenCookieName: "autentico_refresh_token", AuthRefreshTokenAsSecureCookie: false, AuthIdpSessionCookieName: "autentico_idp_session", AuthIdpSessionSecureCookie: false, } Values = defaultConfig )
Functions ¶
func InitBootstrap ¶ added in v1.0.0
func InitBootstrap()
InitBootstrap loads environment variables (from .env file if present, then OS env) and populates Bootstrap. AppDomain, AppHost, AppPort and AppAuthIssuer are derived from AppURL — they do not need to be set manually.
Types ¶
type BootstrapConfig ¶ added in v1.0.0
type BootstrapConfig struct {
DbFilePath string
AppURL string // AUTENTICO_APP_URL
AppOAuthPath string // AUTENTICO_APP_OAUTH_PATH
AppEnableCORS bool // AUTENTICO_APP_ENABLE_CORS
// Derived from AppURL — not set by env vars
AppDomain string
AppHost string
AppPort string
AppAuthIssuer string
// Secrets and cookies
AuthAccessTokenSecret string
AuthRefreshTokenSecret string
AuthCSRFProtectionSecretKey string
AuthCSRFSecureCookie bool
AuthJwkCertKeyID string
AuthRefreshTokenCookieName string
AuthRefreshTokenAsSecureCookie bool
AuthIdpSessionCookieName string
AuthIdpSessionSecureCookie bool
// Private key (base64-encoded PEM). If empty, an ephemeral key is used.
PrivateKeyBase64 string
}
BootstrapConfig holds immutable infrastructure settings loaded from environment variables at startup. AppDomain, AppHost, AppPort, and AppAuthIssuer are derived from AppURL and AppOAuthPath — they are not read from env vars directly.
func GetBootstrap ¶ added in v1.0.0
func GetBootstrap() *BootstrapConfig
type ClientOverrides ¶ added in v1.0.0
type ClientOverrides struct {
AccessTokenExpiration *string
RefreshTokenExpiration *string
AuthorizationCodeExpiration *string
AllowedAudiences []string
AllowSelfSignup *bool
SsoSessionIdleTimeout *string
TrustDeviceEnabled *bool
TrustDeviceExpiration *string
}
ClientOverrides holds nullable per-client config fields. A nil pointer means "use the global setting"; a non-nil pointer overrides it.
type Config ¶
type Config struct {
AuthAccessTokenExpiration time.Duration
AuthAccessTokenExpirationStr string
AuthRefreshTokenExpiration time.Duration
AuthRefreshTokenExpirationStr string
AuthAuthorizationCodeExpiration time.Duration
AuthAuthorizationCodeExpirationStr string
AuthAccessTokenAudience []string
AuthAllowSelfSignup bool
AuthSsoSessionIdleTimeout time.Duration
AuthSsoSessionIdleTimeoutStr string
AuthAccountLockoutMaxAttempts int
AuthAccountLockoutDuration time.Duration
AuthAccountLockoutDurationStr string
AuthMode string
PasskeyRPName string
TrustDeviceEnabled bool
TrustDeviceExpiration time.Duration
TrustDeviceExpirationStr string
CleanupInterval time.Duration
CleanupIntervalStr string
CleanupRetention time.Duration
CleanupRetentionStr string
MfaEnabled bool
MfaMethod string
SmtpHost string
SmtpPort string
SmtpUsername string
SmtpPassword string
SmtpFrom string
ValidationMinUsernameLength int
ValidationMaxUsernameLength int
ValidationMinPasswordLength int
ValidationMaxPasswordLength int
ValidationUsernameIsEmail bool
ValidationEmailRequired bool
Theme ThemeConfig
ThemeCssResolved string
}
Config holds soft settings loaded from the settings DB table. These can be updated at runtime via the admin-ui without restarting the server.
func GetForClient ¶ added in v1.0.0
func GetForClient(overrides ClientOverrides) Config
GetForClient returns a copy of the current soft Config with any non-nil per-client overrides applied. Pass the overrides as a ClientOverrides struct.
func GetOriginal ¶
func GetOriginal() Config
GetOriginal returns the default soft config for test override purposes.