config

package
v0.2.16 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KDFIterations     = 2
	KDFMemory         = 2 * 1024 * 1024
	KDFThreads        = 8
	DefaultConfigPath = "~/.config/goldwarden/goldwarden.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfigFile ConfigFile
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig(useMemguard bool) Config

func ReadConfig

func ReadConfig(rtCfg RuntimeConfig) (Config, error)

func (*Config) GetClientID added in v0.2.8

func (c *Config) GetClientID() (string, error)

func (*Config) GetClientSecret added in v0.2.8

func (c *Config) GetClientSecret() (string, error)

func (*Config) GetMasterKey

func (c *Config) GetMasterKey() ([]byte, error)

func (*Config) GetMasterPasswordHash

func (c *Config) GetMasterPasswordHash() ([]byte, error)

func (*Config) GetToken

func (c *Config) GetToken() (LoginToken, error)

func (*Config) GetUserSymmetricKey

func (c *Config) GetUserSymmetricKey() ([]byte, error)

func (*Config) HasPin

func (c *Config) HasPin() bool

func (*Config) IsLocked

func (c *Config) IsLocked() bool

func (*Config) IsLoggedIn

func (c *Config) IsLoggedIn() bool

func (*Config) Lock

func (c *Config) Lock()

func (*Config) Purge

func (c *Config) Purge()

func (*Config) SetClientID added in v0.2.8

func (c *Config) SetClientID(clientID string) error

func (*Config) SetClientSecret added in v0.2.8

func (c *Config) SetClientSecret(clientSecret string) error

func (*Config) SetMasterKey

func (c *Config) SetMasterKey(key []byte) error

func (*Config) SetMasterPasswordHash

func (c *Config) SetMasterPasswordHash(hash []byte) error

func (*Config) SetToken

func (c *Config) SetToken(token LoginToken) error

func (*Config) SetUserSymmetricKey

func (c *Config) SetUserSymmetricKey(key []byte) error

func (*Config) TryUnlock

func (cfg *Config) TryUnlock(vault *vault.Vault) error

func (*Config) Unlock

func (c *Config) Unlock(password string) bool

func (*Config) UpdatePin

func (c *Config) UpdatePin(password string, write bool)

func (*Config) VerifyPin added in v0.1.7

func (c *Config) VerifyPin(password string) bool

func (*Config) WriteConfig

func (config *Config) WriteConfig() error

type ConfigFile

type ConfigFile struct {
	IdentityUrl                 string
	ApiUrl                      string
	NotificationsUrl            string
	VaultUrl                    string
	EncryptedClientID           string
	EncryptedClientSecret       string
	DeviceUUID                  string
	ConfigKeyHash               string
	EncryptedToken              string
	EncryptedUserSymmetricKey   string
	EncryptedMasterPasswordHash string
	EncryptedMasterKey          string
	RuntimeConfig               RuntimeConfig `json:"-"`
}

type LockedBuffer added in v0.2.0

type LockedBuffer interface {
	Bytes() []byte
	Wipe()
}

func NewBuffer added in v0.2.0

func NewBuffer(size int, useMemguard bool) LockedBuffer

func NewBufferFromBytes added in v0.2.0

func NewBufferFromBytes(bytes []byte, useMemguard bool) LockedBuffer

type LoginToken

type LoginToken struct {
	AccessToken  string `json:"access_token"`
	ExpiresIn    int    `json:"expires_in"`
	TokenType    string `json:"token_type"`
	RefreshToken string `json:"refresh_token"`
	Key          string `json:"key"`
}

type MemGuardLockedBuffer added in v0.2.0

type MemGuardLockedBuffer struct {
	// contains filtered or unexported fields
}

func (MemGuardLockedBuffer) Bytes added in v0.2.0

func (b MemGuardLockedBuffer) Bytes() []byte

func (MemGuardLockedBuffer) Wipe added in v0.2.0

func (b MemGuardLockedBuffer) Wipe()

type MemoryLockedBuffer added in v0.2.0

type MemoryLockedBuffer struct {
	// contains filtered or unexported fields
}

func (MemoryLockedBuffer) Bytes added in v0.2.0

func (b MemoryLockedBuffer) Bytes() []byte

func (MemoryLockedBuffer) Wipe added in v0.2.0

func (b MemoryLockedBuffer) Wipe()

type RuntimeConfig added in v0.1.4

type RuntimeConfig struct {
	AuthMethod           string
	DoNotPersistConfig   bool
	ConfigDirectory      string
	DisableSSHAgent      bool
	WebsocketDisabled    bool
	DeviceUUID           string
	User                 string
	Password             string
	Pin                  string
	UseMemguard          bool
	SSHAgentSocketPath   string
	GoldwardenSocketPath string
	DaemonAuthToken      string
}

Jump to

Keyboard shortcuts

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