server

package
v0.0.0-...-11acf48 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2018 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	*application.ServerAddress
	AllowRegistration bool `toml:"allow_registration,omitempty"`
}

An Address describes a server's connection. It makes the server connections configurable so that a key server implementation can easily be run by a first-party identity provider or a third-party communication service.

Allowing registration has to be specified explicitly for each connection. Other types of requests are allowed by default. One can think of a registration as a "write" to a key directory, while the other request types are "reads". So, by default, addresses are "read-only".

type Config

type Config struct {
	*application.CommonConfig
	// LoadedHistoryLength is the maximum number of
	// snapshots kept in memory.
	LoadedHistoryLength uint64 `toml:"loaded_history_length"`
	// Policies contains the server's CONIKS policies configuration.
	Policies *Policies `toml:"policies"`
	// Path to store the initial STR
	InitSTRPath string `toml:"init_str_path"`
	// Addresses contains the server's connections configuration.
	Addresses []*Address `toml:"addresses"`
	// The server's epoch interval for updating the directory
	EpochDeadline protocol.Timestamp `toml:"epoch_deadline"`
}

A Config contains configuration values which are read at initialization time from a TOML format configuration file.

func NewConfig

func NewConfig(file, encoding string, addrs []*Address,
	logConfig *application.LoggerConfig,
	loadedHistLen uint64, policies *Policies, initSTRPath string) *Config

NewConfig initializes a new server configuration at the given file path, with the given config encoding, server addresses, logger configuration, loaded history length and server application policies.

func (*Config) GetPath

func (conf *Config) GetPath() string

Path returns the server's configuration file path.

func (*Config) Load

func (conf *Config) Load(file, encoding string) error

Load initializes a server configuration at the given file path using the given encoding. It reads the siging key pair and the VRF key pair into the Config instance and updates the path of TLS certificate files of each Address to absolute path.

func (*Config) Save

func (conf *Config) Save() error

Save writes a server's configuration.

type ConiksServer

type ConiksServer struct {
	*application.ServerBase
	// contains filtered or unexported fields
}

A ConiksServer represents a CONIKS key server. It wraps a ConiksDirectory with a network layer which handles requests/responses and their encoding/decoding. A ConiksServer also supports concurrent handling of requests and a mechanism to update the underlying ConiksDirectory automatically at regular time intervals.

func NewConiksServer

func NewConiksServer(conf *Config) *ConiksServer

NewConiksServer creates a new reference implementation of a CONIKS key server.

func (*ConiksServer) HandleRequests

func (server *ConiksServer) HandleRequests(req *protocol.Request) *protocol.Response

HandleRequests validates the request message and passes it to the appropriate operation handler according to the request type.

func (*ConiksServer) Run

func (server *ConiksServer) Run(addrs []*Address)

Run implements the main functionality of the key server. It listens for all declared connections with corresponding permissions.

type Policies

type Policies struct {
	EpochDeadline protocol.Timestamp `toml:"epoch_deadline"`
	VRFKeyPath    string             `toml:"vrf_key_path"`
	SignKeyPath   string             `toml:"sign_key_path"` // it should be a part of policies, see #47
	// contains filtered or unexported fields
}

Policies contains a server's CONIKS policies configuration including paths to the VRF private key, the signing private key and the epoch deadline value in seconds.

func NewPolicies

func NewPolicies(epDeadline protocol.Timestamp, vrfKeyPath,
	signKeyPath string, vrfKey vrf.PrivateKey,
	signKey sign.PrivateKey) *Policies

NewPolicies initializes a new Policies struct.

Jump to

Keyboard shortcuts

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