configuration

package
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDiscoveryFailed = errors.New("no configuration directory found")
)

Functions

func DefaultDirectory

func DefaultDirectory() (string, error)

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
	IDTokenUserinfoClaimsAssertion bool                `yaml:"id_token_userinfo_claims_assertion,omitempty"`
	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 HostConfig struct {
	Port      int    `yaml:"port"`
	KeyPhrase string `yaml:"keyphrase"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL