Documentation
¶
Index ¶
- Variables
- type Cfg
- type CfgLDAP
- type CfgLDAPAddr
- type CfgLimiter
- type CfgOIDC
- type CfgSAML
- type CfgSSO
- type Configurator
- func (c *Configurator) Action() string
- func (c *Configurator) AfterUpdate(data []byte) error
- func (c *Configurator) Check(newData, lastData []byte) ([]byte, error)
- func (c *Configurator) Init() ([]byte, error)
- func (c *Configurator) Transform(data []byte) ([]byte, error)
- func (c *Configurator) Unmarshal(data []byte) (any, error)
- func (c *Configurator) Watch() <-chan Cfg
- type Request
- type Transformer
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidOIDCSecret = apperr.New("invalid_oidc_secret", apperr.WithTextTranslate(translator.Translate{translator.RU: "Не задан OIDC секрет", translator.EN: "OIDC secret not set"}))
)
Functions ¶
This section is empty.
Types ¶
type CfgLDAP ¶
type CfgLDAP struct {
Domain string `json:"key"`
Addrs []CfgLDAPAddr `json:"addrs"`
}
type CfgLDAPAddr ¶
type CfgLimiter ¶
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
func NewConfigurator ¶
func NewConfigurator() *Configurator
func (*Configurator) Action ¶
func (c *Configurator) Action() string
func (*Configurator) AfterUpdate ¶
func (c *Configurator) AfterUpdate(data []byte) error
func (*Configurator) Init ¶
func (c *Configurator) Init() ([]byte, error)
func (*Configurator) Watch ¶
func (c *Configurator) Watch() <-chan Cfg
type Request ¶
type Request struct {
Key *string `json:"key" binding:"omitempty,min=8,max=256"`
AccessTokenTTL *float64 `json:"access_token_ttl" binding:"omitempty,min=1"`
RefreshTokenTTL *float64 `json:"refresh_token_ttl" binding:"omitempty,min=1"`
LDAP []struct {
Domain string `json:"domain" binding:"required,min=1,max=256"`
Addrs []struct {
Addr string `json:"addr" binding:"required,min=1,max=256"`
Secured bool `json:"secured"`
} `json:"addrs" binding:"required,min=1,max=10,dive"`
} `json:"ldap" binding:"omitempty,unique=Domain,dive"`
SSO *struct {
Enabled string `json:"enabled" binding:"required,oneof=oidc saml none"`
OIDC *struct {
ConfigURL string `json:"config_url" binding:"required"`
ClientID string `json:"client_id" binding:"required"`
ClientSecret *string `json:"client_secret" binding:"omitempty,min=1"`
RootURL string `json:"root_url" binding:"required,min=1,max=1024"`
LoginAttr string `json:"login_attr" binding:"required"`
ValidRedirectURLs []string `json:"valid_redirect_urls" binding:"required,max=10,dive,min=1,max=256"`
} `json:"oidc,omitempty" binding:"required_if=Enabled oidc"`
SAML *struct {
RootURL string `json:"root_url" binding:"required,min=1,max=1024"`
LoginAttr string `json:"login_attr" binding:"required"`
ValidRedirectURLs []string `json:"valid_redirect_urls" binding:"required,max=10,dive,min=1,max=256"`
} `json:"saml,omitempty" binding:"required_if=Enabled saml"`
} `json:"sso" binding:"omitempty"`
Limiter *struct {
MaxAttempts int `json:"max_attempts" binding:"required,min=1"`
TTL float64 `json:"ttl" binding:"required,min=1"`
} `json:"limiter" binding:"omitempty"`
}
type Transformer ¶
type Transformer struct {
AccessTokenTTL float64 `json:"access_token_ttl"`
RefreshTokenTTL float64 `json:"refresh_token_ttl"`
LDAP []struct {
Domain string `json:"key"`
Addrs []struct {
Addr string `json:"addr"`
Secured bool `json:"secured"`
} `json:"addrs"`
} `json:"ldap"`
SSO *struct {
Enabled string `json:"enabled"`
OIDC *struct {
ConfigURL string `json:"config_url"`
ClientID string `json:"client_id"`
RootURL string `json:"root_url"`
LoginAttr string `json:"login_attr"`
ValidRedirectURLs []string `json:"valid_redirect_urls"`
} `json:"oidc,omitempty"`
SAML *struct {
MetadataUploaded bool `json:"metadata_uploaded"`
CertUploaded bool `json:"cert_uploaded"`
KeyUploaded bool `json:"key_uploaded"`
RootURL string `json:"root_url"`
LoginAttr string `json:"login_attr"`
ValidRedirectURLs []string `json:"valid_redirect_urls"`
} `json:"saml,omitempty"`
} `json:"sso"`
Limiter *struct {
MaxAttempts int `json:"max_attempts"`
TTL float64 `json:"ttl"`
} `json:"limiter"`
}
Click to show internal directories.
Click to hide internal directories.