config

package
v1.1.7 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validator

func Validator() *validator.Validate

Types

type AuthorizedKeys

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

AuthorizedKeys keeps list of authorized public keys

func (*AuthorizedKeys) List

func (a *AuthorizedKeys) List() []crypt.PublicKey

List returns all keys as a string slice

func (*AuthorizedKeys) UnmarshalYAML

func (a *AuthorizedKeys) UnmarshalYAML(value *yaml.Node) (err error)

UnmarshalYAML implements yaml.Unmarshaler

type Config

type Config struct {
	Vaults     map[string]*VaultConfig `yaml:"vaults" validate:"dive,required"`
	Tezos      TezosConfig             `yaml:"tezos"`
	Server     ServerConfig            `yaml:"server"`
	PolicyHook *PolicyHook             `yaml:"policy_hook"`
	BaseDir    string                  `yaml:"base_dir" validate:"required"`
}

Config contains all the configuration necessary to run the signatory

func Default

func Default() *Config

func (*Config) Read

func (c *Config) Read(file string) error

Read read the config from a file

type PolicyHook

type PolicyHook struct {
	Address        string          `yaml:"address"`
	AuthorizedKeys *AuthorizedKeys `yaml:"authorized_keys"`
}

PolicyHook is an external service for secondary validation of sign requests

type ServerConfig

type ServerConfig struct {
	Address        string           `yaml:"address" validate:"hostname_port"`
	UtilityAddress string           `yaml:"utility_address" validate:"hostname_port"`
	AuthorizedKeys *AuthorizedKeys  `yaml:"authorized_keys"`
	JWTConfig      *middlewares.JWT `yaml:"jwt"`
}

ServerConfig contains the information necessary to the tezos signing server

type TezosConfig

type TezosConfig = hashmap.PublicKeyHashMap[*TezosPolicy]

TezosConfig contains the configuration related to tezos network

type TezosPolicy

type TezosPolicy struct {
	Allow             map[string][]string `yaml:"allow"`
	AllowedOperations []string            `yaml:"allowed_operations"`
	AllowedKinds      []string            `yaml:"allowed_kinds"`
	LogPayloads       bool                `yaml:"log_payloads"`
	AuthorizedKeys    *AuthorizedKeys     `yaml:"authorized_keys"`
	JwtUsers          []string            `yaml:"jwt_users"`
}

TezosPolicy contains policy definition for a specific address

type VaultConfig

type VaultConfig struct {
	Driver string    `yaml:"driver" validate:"required"`
	Config yaml.Node `yaml:"config"`
}

VaultConfig represents single vault instance

Jump to

Keyboard shortcuts

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