Documentation
¶
Index ¶
- Constants
- func Run(ctx context.Context, args []string) error
- type Alert
- type Config
- type DatabaseType
- type DurationSpec
- type LDAPMapping
- type NetworkSpec
- type OAuth2Client
- type Server
- type ServerProtocol
- type SigningKeyAlgorithm
- type TracingProtocol
- type URLSpec
- type UserInfo
- type UserStoreType
- type UserTOTPRegistrationRequest
- type UserVerificationLog
Constants ¶
View Source
const DefaultConfig string = "/etc/idpd/idpd.toml"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Logging struct {
Level string `toml:"level"`
Target string `toml:"target"`
Color int `toml:"color"`
FileName string `toml:"file_name"`
FileSizeLimit int64 `toml:"file_size_limit"`
SyslogNetwork string `toml:"syslog_network"`
SyslogAddress string `toml:"syslog_address"`
SyslogEncoding string `toml:"syslog_encoding"`
SyslogFacility int `toml:"syslog_facility"`
} `toml:"logging"`
Server struct {
Address string `toml:"address"`
Protocol ServerProtocol `toml:"protocol"`
AccessLog bool `toml:"access_log"`
CertFile string `toml:"cert_file"`
KeyFile string `toml:"key_file"`
PublicURL URLSpec `toml:"public_url"`
SessionCookie string `toml:"session_cookie"`
SessionCookieDomain string `toml:"session_cookie_domain"`
SessionLifetime DurationSpec `toml:"session_lifetime"`
RequestLifetime DurationSpec `toml:"request_lifetime"`
TokenLifetime DurationSpec `toml:"token_lifetime"`
AllowedOrigins []string `toml:"allowed_origins"`
} `toml:"server"`
AccessPolicies struct {
Trusted []NetworkSpec `toml:"trusted"`
Private []NetworkSpec `toml:"private"`
} `toml:"access_policies"`
Mail struct {
Address string `toml:"address"`
User string `toml:"user"`
Password string `toml:"password"`
FromAddress string `toml:"from_address"`
FromName string `toml:"from_name"`
} `toml:"mail"`
TOTP struct {
Issuer string `toml:"issuer"`
} `toml:"totp"`
GeoIP struct {
CityDB string `toml:"city_db"`
Mappings []struct {
Networks []NetworkSpec `toml:"networks"`
Host string `toml:"host"`
} `toml:"mapping"`
} `toml:"geoip"`
Database struct {
Type DatabaseType `toml:"type"`
Memory struct {
} `toml:"memory"`
SQLite struct {
File string `toml:"file"`
} `toml:"sqlite"`
Postgres struct {
Address string `toml:"address"`
DB string `toml:"db"`
User string `toml:"user"`
Password string `toml:"password"`
} `toml:"postgres"`
} `toml:"database"`
UserStore struct {
Type UserStoreType `toml:"type"`
LDAP struct {
URLs []URLSpec `toml:"urls"`
BindDN string `toml:"bind_dn"`
BindPassword string `toml:"bind_password"`
UserBaseDN string `toml:"user_base_dn"`
UserFilter string `toml:"user_filter"`
GroupBaseDN string `toml:"group_base_dn"`
GroupFilter string `toml:"group_filter"`
Mapping LDAPMapping `toml:"mapping"`
CustomMapping struct {
User struct {
Profile struct {
Name string `toml:"name"`
GivenName string `toml:"given_name"`
FamilyName string `toml:"family_name"`
MiddleName string `toml:"middle_name"`
Nickname string `toml:"nickname"`
Profile string `toml:"profile"`
Picture string `toml:"picture"`
Website string `toml:"website"`
Birthdate string `toml:"birthdate"`
Zoneinfo string `toml:"zoneinfo"`
Locale string `toml:"locale"`
PreferredUsername string `toml:"preferred_username"`
UpdatedAt string `toml:"update_at"`
} `toml:"profile"`
Address struct {
Formatted string `toml:"formatted"`
Street string `toml:"street"`
Locality string `toml:"locality"`
Region string `toml:"region"`
PostalCode string `toml:"postal_code"`
Country string `toml:"country"`
} `toml:"address"`
Phone struct {
Number string `toml:"number"`
} `toml:"phone"`
Email struct {
Address string `toml:"address"`
} `toml:"email"`
Groups string `toml:"groups"`
} `toml:"user"`
Group struct {
Name string `toml:"name"`
Members string `toml:"members"`
} `toml:"group"`
} `toml:"custom_mapping"`
} `toml:"ldap"`
Static []struct {
Subject string `toml:"subject"`
Password string `toml:"password"`
Profile struct {
Name string `toml:"name"`
GivenName string `toml:"given_name"`
FamilyName string `toml:"family_name"`
MiddleName string `toml:"middle_name"`
Nickname string `toml:"nickname"`
Profile string `toml:"profile"`
Picture string `toml:"picture"`
Website string `toml:"website"`
Birthdate string `toml:"birthdate"`
Zoneinfo string `toml:"zoneinfo"`
Locale string `toml:"locale"`
PreferredUsername string `toml:"preferred_username"`
} `toml:"profile"`
Address struct {
Formatted string `toml:"formatted"`
Street string `toml:"street"`
Locality string `toml:"locality"`
Region string `toml:"region"`
PostalCode string `toml:"postal_code"`
Country string `toml:"country"`
} `toml:"address"`
Phone struct {
Number string `toml:"number"`
} `toml:"phone"`
Email struct {
Address string `toml:"address"`
} `toml:"email"`
Groups []string `toml:"groups"`
} `toml:"static"`
} `toml:"userstore"`
OAuth2 struct {
DefaultLogoutRedirectURL string `toml:"default_logout_redirect_url"`
SigningKeyAlgorithm SigningKeyAlgorithm `toml:"signing_key_algorithm"`
SigningKeyLifetime DurationSpec `toml:"signing_key_lifetime"`
SigningKeyExpiry DurationSpec `toml:"signing_key_expiry"`
Clients []OAuth2Client `toml:"client"`
} `toml:"oauth2"`
Mock struct {
Enabled bool `toml:"enabled"`
Subject string `toml:"subject"`
Password string `toml:"password"`
Rembemer bool `toml:"remember"`
} `toml:"mock"`
Tracing struct {
Enabled bool `toml:"enabled"`
EndpointURL URLSpec `toml:"endpoint_url"`
Protocol TracingProtocol `toml:"protocol"`
Headers map[string]string `toml:"headers"`
BatchTimeout DurationSpec `toml:"batch_timeout"`
ExportTimeout DurationSpec `toml:"export_timeout"`
} `toml:"tracing"`
}
type DatabaseType ¶
type DatabaseType string
const ( DatabaseTypeMemory DatabaseType = "memory" DatabaseTypeSqlite DatabaseType = "sqlite" DatabaseTypePostgres DatabaseType = "postgres" )
func (*DatabaseType) MarshalTOML ¶
func (t *DatabaseType) MarshalTOML() ([]byte, error)
func (*DatabaseType) UnmarshalTOML ¶
func (t *DatabaseType) UnmarshalTOML(value any) error
func (*DatabaseType) Value ¶
func (t *DatabaseType) Value() string
type DurationSpec ¶
func (*DurationSpec) MarshalTOML ¶
func (d *DurationSpec) MarshalTOML() ([]byte, error)
func (*DurationSpec) UnmarshalTOML ¶
func (d *DurationSpec) UnmarshalTOML(value any) error
func (*DurationSpec) Value ¶
func (d *DurationSpec) Value() string
type LDAPMapping ¶
type LDAPMapping string
const ( LDAPMappingActiveDirectory LDAPMapping = "active_directory" LDAPMappingOpenLDAP LDAPMapping = "openldap" LDAPMappingCustom LDAPMapping = "custom" )
func (*LDAPMapping) MarshalTOML ¶
func (m *LDAPMapping) MarshalTOML() ([]byte, error)
func (*LDAPMapping) UnmarshalTOML ¶
func (m *LDAPMapping) UnmarshalTOML(value any) error
func (*LDAPMapping) Value ¶
func (m *LDAPMapping) Value() string
type NetworkSpec ¶
func (*NetworkSpec) MarshalTOML ¶
func (network *NetworkSpec) MarshalTOML() ([]byte, error)
func (*NetworkSpec) UnmarshalTOML ¶
func (network *NetworkSpec) UnmarshalTOML(value any) error
func (*NetworkSpec) Value ¶
func (network *NetworkSpec) Value() string
type OAuth2Client ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) AddOAuth2Client ¶
func (s *Server) AddOAuth2Client(client *OAuth2Client) error
func (*Server) OAuth2IssuerURL ¶
func (*Server) WaitStopped ¶
func (s *Server) WaitStopped()
type ServerProtocol ¶
type ServerProtocol string
const ( ServerProtocolHttp ServerProtocol = "http" ServerProtocolHttps ServerProtocol = "https" )
func (*ServerProtocol) MarshalTOML ¶
func (p *ServerProtocol) MarshalTOML() ([]byte, error)
func (*ServerProtocol) UnmarshalTOML ¶
func (p *ServerProtocol) UnmarshalTOML(value any) error
func (*ServerProtocol) Value ¶
func (p *ServerProtocol) Value() string
type SigningKeyAlgorithm ¶
type SigningKeyAlgorithm string
const ( SigningKeyAlgorithmRS256 SigningKeyAlgorithm = "RS256" SigningKeyAlgorithmES256 SigningKeyAlgorithm = "ES256" SigningKeyAlgorithmPS256 SigningKeyAlgorithm = "PS256" )
func (*SigningKeyAlgorithm) MarshalTOML ¶
func (a *SigningKeyAlgorithm) MarshalTOML() ([]byte, error)
func (*SigningKeyAlgorithm) UnmarshalTOML ¶
func (a *SigningKeyAlgorithm) UnmarshalTOML(value any) error
func (*SigningKeyAlgorithm) Value ¶
func (a *SigningKeyAlgorithm) Value() string
type TracingProtocol ¶
type TracingProtocol string
const ( TracingProtocolHttp TracingProtocol = "http" TracingProtocolGRPC TracingProtocol = "gRPC" )
func (*TracingProtocol) MarshalTOML ¶
func (p *TracingProtocol) MarshalTOML() ([]byte, error)
func (*TracingProtocol) UnmarshalTOML ¶
func (p *TracingProtocol) UnmarshalTOML(value any) error
func (*TracingProtocol) Value ¶
func (p *TracingProtocol) Value() string
type UserInfo ¶
type UserInfo struct {
Name string `json:"name"`
Subject string `json:"subject"`
Email string `json:"email"`
EmailVerification UserVerificationLog `json:"email_verification"`
TOTPVerification UserVerificationLog `json:"totp_verification"`
PasskeyVerification UserVerificationLog `json:"passkey_verification"`
WebAuthnVerification UserVerificationLog `json:"webauthn_verification"`
ClientID string `json:"client_id"`
RequestedScopes []string `json:"requested_scopes"`
}
type UserStoreType ¶
type UserStoreType string
const ( UserStoreTypeLDAP UserStoreType = "ldap" UserStoreTypeStatic UserStoreType = "static" )
func (*UserStoreType) MarshalTOML ¶
func (t *UserStoreType) MarshalTOML() ([]byte, error)
func (*UserStoreType) UnmarshalTOML ¶
func (t *UserStoreType) UnmarshalTOML(value any) error
func (*UserStoreType) Value ¶
func (t *UserStoreType) Value() string
type UserVerificationLog ¶
type UserVerificationLog struct {
Registration time.Time `json:"registration,omitzero"`
LastUsed time.Time `json:"last_used,omitzero"`
Host string `json:"host"`
Country string `json:"country,omitempty"`
CountryCode string `json:"country_code,omitempty"`
City string `json:"city,omitempty"`
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.