Documentation ¶
Index ¶
- Variables
- func DumpCerts(config *ServerConfig)
- func DumpPerms(perms *Permissions)
- func InitStores(ctx context.Context, stores []*Store) ([]e2wtypes.Store, error)
- type CertificateInfo
- type CertificatePerms
- type Config
- type KeysConfig
- type Permissions
- type Rule
- type RuleDefinition
- type RulesResult
- type ServerConfig
- type Store
Constants ¶
This section is empty.
Variables ¶
var ErrNotFound = errors.New("not found")
ErrErrNotFound is used when an item is not found, usually when attempting to fetch it from storage.
Functions ¶
func DumpCerts ¶ added in v0.1.1
func DumpCerts(config *ServerConfig)
func DumpPerms ¶ added in v0.1.1
func DumpPerms(perms *Permissions)
DumpPerms dumps information about our permissions to stdout.
Types ¶
type CertificateInfo ¶ added in v0.1.1
type CertificateInfo struct { Name string `json:"name"` Perms []*CertificatePerms `json:"permissions"` }
CertificateInfo contains information related to client certificates.
type CertificatePerms ¶ added in v0.1.1
CertificatePerms contains information about the operations allowed by the certificate.
type Config ¶
type Config struct { Verbosity string `json:"verbosity"` Server *ServerConfig `json:"server"` Stores []*Store `json:"stores"` Rules []*RuleDefinition `json:"rules"` }
Config is the configuration for the daemon.
type KeysConfig ¶ added in v0.1.1
type KeysConfig struct {
Keys []string `json:"keys"`
}
KeysConfig provides information about keys for automatic unlocking.
func FetchKeysConfig ¶ added in v0.1.1
func FetchKeysConfig() (*KeysConfig, error)
FetchKeysConfig fetches keys from the JSON configuration file.
type Permissions ¶ added in v0.1.1
type Permissions struct {
Certs []*CertificateInfo `json:"certificates"`
}
Permissions provides information about per-client permissions.
func FetchPermissions ¶ added in v0.1.1
func FetchPermissions() (*Permissions, error)
FetchPermissions fetches permissions from the JSON configuration file.
type Rule ¶
type Rule struct {
// contains filtered or unexported fields
}
Rule contains a ready-to-run rule script.
func InitRules ¶
func InitRules(ctx context.Context, defs []*RuleDefinition) ([]*Rule, error)
InitRules initialises the rules from a configuration.
func NewRule ¶
func NewRule(def *RuleDefinition) (*Rule, error)
NewRule creates a new rule from its definition.
type RuleDefinition ¶
type RuleDefinition struct { Name string `json:"name"` Request string `json:"request"` Account string `json:"account"` Script string `json:"script"` }
RuleDefinition defines a rule.
type RulesResult ¶ added in v0.1.1
type RulesResult int
RulesResult represents the result of running a set of rules.
const ( UNKNOWN RulesResult = iota APPROVED DENIED FAILED )