psk

package
v0.0.0-...-feb181f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

README

Pre-Shared Key Authentication

The Pre-Shared Key Authenticator loads Identity objects keyed by pre-shared key. Should the look up be done instead against CRs that represent the reporters?

TODO: fsnotify to automatically reload the keys at runtime.

Documentation

Overview

Package psk provides an authenticator based on pre-shared keys

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CompletedConfig

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

type Config

type Config struct {
	PreSharedKeyFile string
	Keys             IdentityMap
}

func NewConfig

func NewConfig(o *Options) *Config

func (*Config) Complete

func (c *Config) Complete() (CompletedConfig, error)

type IdentityMap

type IdentityMap map[string]api.Identity

type Options

type Options struct {
	PreSharedKeyFile string `mapstructure:"pre-shared-key-file"`
}

func NewOptions

func NewOptions() *Options

func (*Options) AddFlags

func (o *Options) AddFlags(fs *pflag.FlagSet, prefix string)

func (*Options) Complete

func (o *Options) Complete() []error

func (*Options) Validate

func (o *Options) Validate() []error

type PreSharedKeyAuthenticator

type PreSharedKeyAuthenticator struct {
	Store IdentityMap
}

func (*PreSharedKeyAuthenticator) Authenticate

func (*PreSharedKeyAuthenticator) Lookup

func (a *PreSharedKeyAuthenticator) Lookup(key string) *api.Identity

Jump to

Keyboard shortcuts

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