auth

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeOIDC string = "oidc"
	TypeUser string = "user"
)

supported list of authentication types.

Variables

This section is empty.

Functions

func Load

func Load(configFilePath string) (*models.UserPermissions, error)

Load loads user configuration from given configuration file.

Types

type Config

type Config struct {
	AuthType                  string
	AuthUsername              string
	AuthPassword              string
	AuthUsersConfig           string
	AuthOIDCClientID          string
	AuthOIDCClientSecret      string
	AuthOIDCScopes            []string
	AuthOIDCAdminRole         string
	AuthOIDCClaimRoles        string
	AuthOIDCProviderEndpoint  string
	AuthParsedUserPermissions *models.UserPermissions
}

func (*Config) IsAuthTypeOIDC

func (c *Config) IsAuthTypeOIDC() bool

IsAuthTypeOIDC makes check that current auth is TypeOIDC.

func (*Config) IsAuthTypeUser

func (c *Config) IsAuthTypeUser() bool

IsAuthTypeUser makes check that current auth is TypeUser.

func (*Config) NormalizeConfiguration

func (c *Config) NormalizeConfiguration() error

NormalizeConfiguration normalizes auth configuration parameters.

func (*Config) ValidateConfiguration

func (c *Config) ValidateConfiguration() error

ValidateConfiguration validates service configuration for correctness.

type YamlConfig

type YamlConfig struct {
	Users []YamlUserConfig `yaml:"users"`
}

YamlConfig represents users configuration in YAML format.

type YamlUserConfig

type YamlUserConfig struct {
	Name     string   `yaml:"name"`
	Password string   `yaml:"password"`
	Roles    []string `yaml:"roles"`
}

YamlUserConfig partial object of YamlConfig.

Jump to

Keyboard shortcuts

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