credentials

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: MIT Imports: 4 Imported by: 1

Documentation

Overview

Package credentials describes credentials.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetLogin

func GetLogin() string

Types

type Credentials

type Credentials interface {
	GetUsername() (string, error)
	GetPasswords() []Secret
	GetPrivateKey() []byte
	GetPassphrase() Secret
	AgentEnabled() bool
}

type CredentialsOption

type CredentialsOption func(*SimpleCredentials)

func WithLogger

func WithLogger(logger *zap.Logger) CredentialsOption

func WithPassphrase

func WithPassphrase(passphrase Secret) CredentialsOption

func WithPassword

func WithPassword(password Secret) CredentialsOption

func WithPasswords

func WithPasswords(password []Secret) CredentialsOption

func WithPrivateKey

func WithPrivateKey(key []byte) CredentialsOption

func WithSSHAgent

func WithSSHAgent() CredentialsOption

func WithUsername

func WithUsername(username string) CredentialsOption

type Secret

type Secret string

func (Secret) MarshalText

func (Secret) MarshalText() ([]byte, error)

func (Secret) String

func (Secret) String() string

func (Secret) Value

func (m Secret) Value() string

type SimpleCredentials

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

func NewSimpleCredentials

func NewSimpleCredentials(opts ...CredentialsOption) *SimpleCredentials

func (SimpleCredentials) AgentEnabled

func (m SimpleCredentials) AgentEnabled() bool

func (SimpleCredentials) GetPassphrase

func (m SimpleCredentials) GetPassphrase() Secret

func (SimpleCredentials) GetPasswords

func (m SimpleCredentials) GetPasswords() []Secret

func (SimpleCredentials) GetPrivateKey

func (m SimpleCredentials) GetPrivateKey() []byte

func (SimpleCredentials) GetUsername

func (m SimpleCredentials) GetUsername() (string, error)

Jump to

Keyboard shortcuts

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