config

package
v0.0.0-...-8d63230 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SessionCookieName    string = "__thor_session"
	SessionCookieNameSSO string = "__thor_sso_session"
)
View Source
const DataDir string = "/data/thor"

Variables

This section is empty.

Functions

func Overwrite

func Overwrite(filename string, data []byte, perm os.FileMode) error

Types

type Admin

type Admin struct {
	Email    string `yaml:"email"`
	Password string `yaml:"password"`
	TotpKey  string `yaml:"totp"`
}

type Agent

type Agent struct {
	VaultAddr string     `yaml:"vaultServer"`
	ThorAddr  string     `yaml:"thorServer"`
	Paths     []string   `yaml:"paths"`
	Namespace string     `yaml:"namespace"`
	TLS       *TlsConfig `yaml:"tls"`
	Edge      bool       `yaml:"edge" default:"false"`
	ApiKey    string     `yaml:"-"`
}

type Config

type Config struct {
	TLS            *TlsConfig   `yaml:"tls"`
	Vault          *VaultConfig `yaml:"vault"`
	Loki           *LokiConfig  `yaml:"loki"`
	Ldap           *LdapConfig  `yaml:"ldap"`
	Saml           *SamlConfig  `yaml:"saml"`
	Admin          *Admin       `yaml:"admin"`
	Agent          *Agent       `yaml:"agent"`
	Configured     bool         `yaml:"configured"`
	TrustedInbound []string     `yaml:"trustedInbound"`
	AdminOTP       *otp.Key     `yaml:"-"`
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(filename string) (*Config, error)

func (*Config) GenerateTOTP

func (c *Config) GenerateTOTP() (*otp.Key, error)

func (*Config) Lock

func (c *Config) Lock()

func (*Config) RLock

func (c *Config) RLock()

func (*Config) RUnlock

func (c *Config) RUnlock()

func (*Config) ResetTotp

func (c *Config) ResetTotp() (*otp.Key, error)

func (*Config) Save

func (c *Config) Save() error

func (*Config) Unlock

func (c *Config) Unlock()

type LdapConfig

type LdapConfig struct {
	Server      string `yaml:"server"`
	Port        int    `yaml:"port"`
	BindAccount string `yaml:"bindAccount"`
	Password    string `yaml:"password"`
	BaseDN      string `yaml:"baseDn"`
	FilterDN    string `yaml:"filterDn"`
}

func (*LdapConfig) Configure

func (ldap *LdapConfig) Configure()

type LokiConfig

type LokiConfig struct {
	Server   string `yaml:"server"`
	Port     int    `yaml:"port"`
	Username string `yaml:"username"`
	Password string `yaml:"password"`
}

func (*LokiConfig) Configure

func (loki *LokiConfig) Configure()

type Policy

type Policy struct {
	ExcludeCharacters string `yaml:"excludeCharacters"`
	Length            int    `yaml:"length"`
}

type SamlConfig

type SamlConfig struct {
	IDPMetadata string             `yaml:"idpMetadata"`
	PrivateKey  []byte             `yaml:"privateKey"`
	Certificate []byte             `yaml:"certificate"`
	SamlSP      *samlsp.Middleware `yaml:"-"`
}

func (*SamlConfig) Configure

func (s *SamlConfig) Configure(hostname string) error

type TlsConfig

type TlsConfig struct {
	HostName    string `yaml:"hostname"`
	Port        int    `yaml:"port"`
	Cacert      string `yaml:"cacert"`
	Cakey       string `yaml:"cakey"`
	LetsEncrypt bool   `yaml:"letsencrypt"`
}

type User

type User struct {
	Admin  bool
	Email  string
	Groups []string
}

type VaultConfig

type VaultConfig struct {
	Address string `yaml:"address"`
	AppRole *struct {
		RoleId              string `yaml:"roleId"`
		SecretId            string `yaml:"secretId"`
		ResponseWrapped     bool   `yaml:"wrapped"`
		InitialisationToken string `yaml:"InitialisationToken"`
	} `yaml:"appRole,omitempty"`
	AzureRole *struct {
		RoleName string `yaml:"role"`
	} `yaml:"azureRole,omitempty"`
	AwsRole *struct {
		RoleName string `yaml:"role"`
	} `yaml:"awsRole,omitempty"`
	Namespace       string  `yaml:"namespace"`
	SecureTokenPath string  `yaml:"securePath"`
	EncryptionKey   string  `yaml:"encryptionkey"`
	PasswordPolicy  *Policy `yaml:"passwordPolicy"`
	//
	// Replaceable is a list of keys likely to be found under
	// a given vault path whose value can/should be replaced by
	// automation.
	//
	// This is only relevant to an Ex-Employee search type.
	Replaceable []string      `yaml:"replaceableKeys"`
	VaultConfig *vault.Config `yaml:"-"`
	TokenPolicy *Policy       `yaml:"-"`
}

func (*VaultConfig) Configure

func (c *VaultConfig) Configure()

Jump to

Keyboard shortcuts

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