auth

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AttributeNotFound = errors.Errorf("Unable to find attribute in KeePass entry")
View Source
var AuthNotFound = errors.Errorf("Unable to find auth")
View Source
var PasswordNotFound = errors.Errorf("Unable to find a password in KeePass entry")
View Source
var UsernameNotFound = errors.Errorf("Unable to find a username in KeePass entry")

Functions

func GetDefaultClientConfig

func GetDefaultClientConfig() *ssh.ClientConfig

Types

type Auth

type Auth interface {
	GetSSHClientConfig() (*ssh.ClientConfig, error)
	GetAttribute(attr_name string) (string, error)
}

type KeePassAuth

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

func (*KeePassAuth) GetAttribute

func (t *KeePassAuth) GetAttribute(attr_name string) (string, error)

func (*KeePassAuth) GetSSHClientConfig

func (t *KeePassAuth) GetSSHClientConfig() (*ssh.ClientConfig, error)

type KeePassProvider

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

func NewKeePassProvider

func NewKeePassProvider(dbPath string, unlockPassword string) (*KeePassProvider, error)

func (*KeePassProvider) Init

func (t *KeePassProvider) Init() error

func (*KeePassProvider) Lookup

func (t *KeePassProvider) Lookup(path string) (Auth, error)

func (*KeePassProvider) ResolveEntryPath

func (t *KeePassProvider) ResolveEntryPath(path string) (*gokeepasslib.Entry, error)

type Provider

type Provider interface {
	Init() error
	Lookup(key string) (Auth, error)
}

type ProviderPool

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

ProviderPool: Instantiates and manages AuthProviders

func NewProviderPool

func NewProviderPool() *ProviderPool

NewProviderPool: Constructs a new ProviderPool

func (*ProviderPool) GetProvider

func (t *ProviderPool) GetProvider(name string) (Provider, error)

GetProvider: Retrieves a provider by name from the pool

func (*ProviderPool) RegisterProvider

func (t *ProviderPool) RegisterProvider(name string, provider Provider) error

RegisterProvider: Registers an auth provider with the pool

type StaticAuth

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

func (*StaticAuth) GetAttribute

func (t *StaticAuth) GetAttribute(attr_name string) (string, error)

func (*StaticAuth) GetSSHClientConfig

func (t *StaticAuth) GetSSHClientConfig() (*ssh.ClientConfig, error)

type StaticProvider

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

func NewStaticProvider

func NewStaticProvider() *StaticProvider

func (*StaticProvider) AddAuth

func (t *StaticProvider) AddAuth(path string, username string, password string, attributes map[string]string) error

func (*StaticProvider) Init

func (t *StaticProvider) Init() error

func (*StaticProvider) Lookup

func (t *StaticProvider) Lookup(path string) (Auth, error)

Jump to

Keyboard shortcuts

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