securestore

package
v0.1.403 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2024 License: Apache-2.0 Imports: 6 Imported by: 7

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.

Note: CGO_ENABLED=1 is required for darwin builds (enables OSX Keychain)

func GetConfigFromKeyring

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

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

Note: CGO_ENABLED=1 is required for darwin builds (enables OSX Keychain)

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.

Note: CGO_ENABLED=1 is required for darwin builds (enables OSX Keychain)

func RemoveConfigFromKeyring added in v0.1.399

func RemoveConfigFromKeyring(backend string) error

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

Note: CGO_ENABLED=1 is required for OSX Keychain and darwin builds

func UpsertConfigToKeyring

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

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

Note: CGO_ENABLED=1 is required for darwin builds (enables OSX Keychain)

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.

Note: CGO_ENABLED=1 is required for darwin builds (enables OSX Keychain)

Types

This section is empty.

Jump to

Keyboard shortcuts

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