Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDefaultKeyringPath ¶
func GetDefaultKeyringPath() string
GetDefaultKeyringPath returns the default keyring file path
func GetKeyringPathWithGroup ¶
GetKeyringPathWithGroup returns the keyring path with instance group isolation
func GetMasterPasswordFromEnv ¶
func GetMasterPasswordFromEnv() string
GetMasterPasswordFromEnv gets master password from environment variable
func GetServiceNameWithGroup ¶
GetServiceNameWithGroup returns the service name with instance group isolation
Types ¶
type FileKeyring ¶
type FileKeyring struct {
// contains filtered or unexported fields
}
FileKeyring implements a file-based keyring for headless servers
func NewFileKeyring ¶
func NewFileKeyring(keyringPath, masterPassword string) *FileKeyring
NewFileKeyring creates a new file-based keyring
func (*FileKeyring) Delete ¶
func (fk *FileKeyring) Delete(service, user string) error
Delete removes an entry from the file keyring
func (*FileKeyring) Get ¶
func (fk *FileKeyring) Get(service, user string) (string, error)
Get retrieves an entry from the file keyring
func (*FileKeyring) Set ¶
func (fk *FileKeyring) Set(service, user, password string) error
Set stores an entry in the file keyring
type KeyringEntry ¶
type KeyringEntry struct {
Service string `json:"service"`
User string `json:"user"`
Data string `json:"data"` // encrypted data
}
KeyringEntry represents a stored keyring entry
type KeyringManager ¶
type KeyringManager struct {
// contains filtered or unexported fields
}
KeyringManager provides a unified interface for keyring operations
func NewKeyringManager ¶
func NewKeyringManager(keyringPath, masterPassword string) *KeyringManager
NewKeyringManager creates a new keyring manager that tries system keyring first, falls back to file
func NewKeyringManagerWithBackend ¶
func NewKeyringManagerWithBackend(keyringPath, masterPassword, backend string) *KeyringManager
NewKeyringManagerWithBackend creates a new keyring manager with a specific backend preference
func (*KeyringManager) Delete ¶
func (km *KeyringManager) Delete(service, user string) error
Delete removes a value from the keyring (system or file)
func (*KeyringManager) Get ¶
func (km *KeyringManager) Get(service, user string) (string, error)
Get retrieves a value from the keyring (system or file)
func (*KeyringManager) Set ¶
func (km *KeyringManager) Set(service, user, password string) error
Set stores a value in the keyring (system or file)