password

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyringStorage

type KeyringStorage struct{}

KeyringStorage implements password storage using system keyring

func (*KeyringStorage) Get

func (k *KeyringStorage) Get(service api.Service) (string, error)

func (*KeyringStorage) GetStorageResult

func (k *KeyringStorage) GetStorageResult(err error, password string) PasswordStorageResult

func (*KeyringStorage) Remove

func (k *KeyringStorage) Remove(service api.Service) error

func (*KeyringStorage) Save

func (k *KeyringStorage) Save(service api.Service, password string) error

type NoStorage

type NoStorage struct{}

NoStorage implements no password storage (passwords are not saved)

func (*NoStorage) Get

func (n *NoStorage) Get(service api.Service) (string, error)

func (*NoStorage) GetStorageResult

func (n *NoStorage) GetStorageResult(err error, password string) PasswordStorageResult

func (*NoStorage) Remove

func (n *NoStorage) Remove(service api.Service) error

func (*NoStorage) Save

func (n *NoStorage) Save(service api.Service, password string) error

type PasswordStorage

type PasswordStorage interface {
	Save(service api.Service, password string) error
	Get(service api.Service) (string, error)
	Remove(service api.Service) error
	GetStorageResult(err error, password string) PasswordStorageResult
}

PasswordStorage defines the interface for password storage implementations

func GetPasswordStorage

func GetPasswordStorage() PasswordStorage

GetPasswordStorage returns the appropriate PasswordStorage implementation based on configuration

type PasswordStorageResult

type PasswordStorageResult struct {
	Success bool   `json:"success"`
	Method  string `json:"method"`  // "keyring", "pgpass", or "none"
	Message string `json:"message"` // Human-readable message
}

PasswordStorageResult contains the result of password storage operations

func SavePasswordWithResult

func SavePasswordWithResult(service api.Service, password string) (PasswordStorageResult, error)

SavePasswordWithResult handles saving a password and returns both error and result info

type PgpassStorage

type PgpassStorage struct{}

PgpassStorage implements password storage using ~/.pgpass file

func (*PgpassStorage) Get

func (p *PgpassStorage) Get(service api.Service) (string, error)

func (*PgpassStorage) GetStorageResult

func (p *PgpassStorage) GetStorageResult(err error, password string) PasswordStorageResult

func (*PgpassStorage) Remove

func (p *PgpassStorage) Remove(service api.Service) error

func (*PgpassStorage) Save

func (p *PgpassStorage) Save(service api.Service, password string) error

Jump to

Keyboard shortcuts

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