config

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2023 License: AGPL-3.0 Imports: 16 Imported by: 10

Documentation

Overview

Package config implements the configuration for the Katzenpost client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	// User is the account user name.
	User string

	// Provider is the provider identifier used by this account.
	Provider string

	// ProviderKeyPin is the optional pinned provider signing key.
	ProviderKeyPin *eddsa.PublicKey
}

Account is a provider account configuration.

type Config

type Config struct {
	Logging            *Logging
	UpstreamProxy      *UpstreamProxy
	Debug              *Debug
	NonvotingAuthority *NonvotingAuthority
	VotingAuthority    *VotingAuthority
	Account            *Account
	Registration       *Registration
	Panda              *Panda
	Reunion            *Reunion
	// contains filtered or unexported fields
}

Config is the top level client configuration.

func Load

func Load(b []byte) (*Config, error)

Load parses and validates the provided buffer b as a config file body and returns the Config.

func LoadFile

func LoadFile(f string) (*Config, error)

LoadFile loads, parses, and validates the provided file and returns the Config.

func (*Config) FixupAndMinimallyValidate added in v0.0.3

func (c *Config) FixupAndMinimallyValidate() error

FixupAndMinimallyValidate applies defaults to config entries and validates the all but the Account and Registration configuration sections.

func (*Config) FixupAndValidate

func (c *Config) FixupAndValidate() error

FixupAndValidate applies defaults to config entries and validates the supplied configuration. Most people should call one of the Load variants instead.

func (*Config) NewPKIClient

func (c *Config) NewPKIClient(l *log.Backend, pCfg *proxy.Config) (pki.Client, error)

NewPKIClient returns a voting or nonvoting implementation of pki.Client or error

func (*Config) UpstreamProxyConfig

func (c *Config) UpstreamProxyConfig() *proxy.Config

UpstreamProxyConfig returns the configured upstream proxy, suitable for internal use. Most people should not use this.

type Debug

type Debug struct {
	DisableDecoyTraffic bool

	// SessionDialTimeout is the number of seconds that a session dial
	// is allowed to take until it is canceled.
	SessionDialTimeout int

	// InitialMaxPKIRetrievalDelay is the initial maximum number of seconds
	// we are willing to wait for the retreival of the PKI document.
	InitialMaxPKIRetrievalDelay int

	// CaseSensitiveUserIdentifiers disables the forced lower casing of
	// the Account `User` field.
	CaseSensitiveUserIdentifiers bool

	// PollingInterval is the interval in seconds that will be used to
	// poll the receive queue.  By default this is 10 seconds.  Reducing
	// the value too far WILL result in unnecessary Provider load, and
	// increasing the value too far WILL adversely affect large message
	// transmit performance.
	PollingInterval int

	// PreferedTransports is a list of the transports will be used to make
	// outgoing network connections, with the most prefered first.
	PreferedTransports []pki.Transport
}

Debug is the debug configuration.

type Logging

type Logging struct {
	// Disable disables logging entirely.
	Disable bool

	// File specifies the log file, if omitted stdout will be used.
	File string

	// Level specifies the log level.
	Level string
}

Logging is the logging configuration.

type NonvotingAuthority

type NonvotingAuthority struct {
	// Address is the IP address/port combination of the authority.
	Address string

	// PublicKey is the authority's public key.
	PublicKey *eddsa.PublicKey
}

NonvotingAuthority is a non-voting authority configuration.

func (*NonvotingAuthority) New

func (nvACfg *NonvotingAuthority) New(l *log.Backend, pCfg *proxy.Config) (pki.Client, error)

New constructs a pki.Client with the specified non-voting authority config.

type Panda

type Panda struct {
	// Receiver is the recipient ID that shall receive the Sphinx packets destined
	// for this PANDA service.
	Receiver string
	// Provider is the Provider on this mix network which is hosting this PANDA service.
	Provider string
	// BlobSize is the size of the PANDA blobs that clients will use.
	BlobSize int
}

Panda is the PANDA configuration needed by clients in order to use the PANDA service

type Registration

type Registration struct {
	Address string
	Options *registration.Options
}

Registration is used for the client's Provider account registration.

type Reunion added in v0.0.8

type Reunion struct {
	// Enable indicates that the reunion protocol should be used
	Enable bool
}

Reunion is the Reunion configuration needed by clients in order to use the Reunion service

type UpstreamProxy

type UpstreamProxy struct {
	// Type is the proxy type (Eg: "none"," socks5").
	Type string

	// Network is the proxy address' network (`unix`, `tcp`).
	Network string

	// Address is the proxy's address.
	Address string

	// User is the optional proxy username.
	User string

	// Password is the optional proxy password.
	Password string
}

UpstreamProxy is the outgoing connection proxy configuration.

type VotingAuthority

type VotingAuthority struct {
	Peers []*vServerConfig.AuthorityPeer
}

VotingAuthority is a voting authority configuration.

func (*VotingAuthority) New

func (vACfg *VotingAuthority) New(l *log.Backend, pCfg *proxy.Config) (pki.Client, error)

New constructs a pki.Client with the specified non-voting authority config.

Jump to

Keyboard shortcuts

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