Documentation
¶
Index ¶
- Variables
- func DefaultDirectory() (string, error)
- type ClientConfig
- type ConfigurationManager
- func (w *ConfigurationManager) Close()
- func (r *ConfigurationManager) GetConfigurationFilePath() string
- func (r *ConfigurationManager) GetStateDatabasePath() string
- func (r *ConfigurationManager) IsInitialized() (bool, error)
- func (r *ConfigurationManager) LoadConfiguration() (*ServerConfig, error)
- func (r *ConfigurationManager) OnServerChanged(changed func(x *ServerConfig))
- func (r *ConfigurationManager) SaveConfiguration(config ServerConfig) error
- type HostConfig
- type ServerConfig
- type User
- type UserClaims
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrDiscoveryFailed = errors.New("no configuration directory found")
)
Functions ¶
func DefaultDirectory ¶
Types ¶
type ClientConfig ¶
type ClientConfig struct {
Name string `yaml:"name"`
ClientID string `yaml:"client_id"`
AccessTokenType string `yaml:"access_token_type"` // bearer or jwt.
ApplicationType string `yaml:"application_type"` // web, native, or service.
AuthMethod string `yaml:"auth_method"` // client_secret_basic,client_secret_post,none,private_key_jwt
ClockSkew time.Duration `yaml:"clock_skew,omitempty"` // time in duration format
IDTokenLifetime time.Duration `yaml:"id_token_lifetime,omitempty"` // time in duration format
IDTokenOmitUserInfoClaims bool `yaml:"id_token_omit_userinfo_claims,omitempty"` // true to omit profile, email, phone, address scopes from ID tokens
GrantTypes []string `yaml:"grant_types"` // authorization_code,implicit,password,client_credentials,refresh_token etc
RedirectURIs []string `yaml:"redirect_uris"`
PostLogoutRedirectURIs []string `yaml:"post_logout_redirect_uris,omitempty"`
ResponseTypes []string `yaml:"response_types"`
ClientSecret string `yaml:"-"` // ignore when marshalling
CustomScopes map[string][]string `yaml:"custom_scopes,omitempty"`
}
type ConfigurationManager ¶
type ConfigurationManager struct {
// contains filtered or unexported fields
}
func NewConfigurationManager ¶
func NewConfigurationManager(dir string) (*ConfigurationManager, error)
func Resolve ¶
func Resolve(path string) (*ConfigurationManager, error)
func (*ConfigurationManager) Close ¶
func (w *ConfigurationManager) Close()
func (*ConfigurationManager) GetConfigurationFilePath ¶
func (r *ConfigurationManager) GetConfigurationFilePath() string
func (*ConfigurationManager) GetStateDatabasePath ¶
func (r *ConfigurationManager) GetStateDatabasePath() string
func (*ConfigurationManager) IsInitialized ¶
func (r *ConfigurationManager) IsInitialized() (bool, error)
func (*ConfigurationManager) LoadConfiguration ¶
func (r *ConfigurationManager) LoadConfiguration() (*ServerConfig, error)
func (*ConfigurationManager) OnServerChanged ¶
func (r *ConfigurationManager) OnServerChanged(changed func(x *ServerConfig))
func (*ConfigurationManager) SaveConfiguration ¶
func (r *ConfigurationManager) SaveConfiguration(config ServerConfig) error
type HostConfig ¶
type ServerConfig ¶
type ServerConfig struct {
Server HostConfig `yaml:"server"`
Clients []*ClientConfig `yaml:"clients"`
Users []*User `yaml:"users"`
}
ServerConfig is a struct that holds the server configuration and is generally stored in source control for shared use.
type User ¶
type User struct {
Subject string `yaml:"subject"`
LoginDisplay string `yaml:"login_display"`
Claims UserClaims `yaml:"claims"`
}
type UserClaims ¶
type UserClaims struct {
Email *string `yaml:"email,omitempty"`
EmailVerified *bool `yaml:"email_verified,omitempty"`
Phone *string `yaml:"phone,omitempty"`
PhoneVerified *bool `yaml:"phone_verified,omitempty"`
Name *string `yaml:"name,omitempty"`
PreferredUsername *string `yaml:"preferred_username,omitempty"`
Nickname *string `yaml:"nickname,omitempty"`
GivenName *string `yaml:"given_name,omitempty"`
MiddleName *string `yaml:"middle_name,omitempty"`
FamilyName *string `yaml:"family_name,omitempty"`
UpdatedAt *time.Time `yaml:"updated_at,omitempty"`
Custom map[string]interface{} `yaml:"custom,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.