securestore

package
v0.1.442 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KindInternetPassword = "Internet password" // MacOS Keychain item kind
	ItemKey              = "RedHatSSO"
	CollectionName       = "login" // Common OS default collection name
	MaxWindowsByteSize   = 2500    // Windows Credential Manager has a 2500 byte limit
)

Variables

View Source
var (
	ErrKeyringUnavailable = fmt.Errorf("keyring is valid but is not available on the current OS")
	ErrKeyringInvalid     = fmt.Errorf("keyring is invalid, expected one of: [%v]", strings.Join(AllowedBackends, ", "))
	AllowedBackends       = []string{
		string(keyring.WinCredBackend),
		string(keyring.KeychainBackend),
		string(keyring.SecretServiceBackend),
		string(keyring.PassBackend),
	}
)

Functions

func AvailableBackends

func AvailableBackends() []string

AvailableBackends provides a slice of all available backend keys on the current OS.

func GetConfigFromKeyring

func GetConfigFromKeyring(backend string) ([]byte, error)

GetConfigFromKeyring will retrieve the credentials from the first priority OS secure store.

func IsBackendAvailable added in v0.1.402

func IsBackendAvailable(backend string) (isAvailable bool)

IsBackendAvailable provides validation that the desired backend is available on the current OS.

func RemoveConfigFromKeyring added in v0.1.399

func RemoveConfigFromKeyring(backend string) error

RemoveConfigFromKeyring will remove the credentials from the first priority OS secure store.

func UpsertConfigToKeyring

func UpsertConfigToKeyring(backend string, creds []byte) error

UpsertConfigToKeyring will upsert the provided credentials to the desired OS secure store.

func ValidateBackend added in v0.1.402

func ValidateBackend(backend string) error

Validates that the requested backend is valid and available, returns an error if not.

Types

This section is empty.

Jump to

Keyboard shortcuts

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