keyring

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package keyring stores Melange credentials in the OS keychain via zalando/go-keyring. Entries live under the "melange-cli" service, keyed by host (scheme stripped, port kept — see HostKey).

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no credentials found in keyring")

ErrNotFound is returned when no credential is stored for a host.

Functions

func Delete

func Delete(host string) error

Delete removes the token stored for host, or returns ErrNotFound.

func DeleteOAuth added in v0.5.0

func DeleteOAuth(host string) error

DeleteOAuth removes OAuth credentials for host.

func Get

func Get(host string) (string, error)

Get returns the token stored for host, or ErrNotFound.

func GetOAuth added in v0.5.0

func GetOAuth(host string) (*config.OAuthCredentials, error)

GetOAuth returns OAuth credentials for host or ErrNotFound.

func HostKey

func HostKey(host string) string

HostKey normalizes a host or URL into the keyring key: scheme and path are stripped, the port is kept ("https://api.zetic.ai:8443/v1" -> "api.zetic.ai:8443").

func Lookup

func Lookup(host string) (string, bool, error)

Lookup adapts Get to the config token-resolution lookup signature.

func LookupOAuth added in v0.5.0

func LookupOAuth(host string) (*config.OAuthCredentials, bool, error)

LookupOAuth adapts GetOAuth to the ResolveOAuth lookup signature.

func Set

func Set(host, token string) error

Set stores the token for host.

func SetOAuth added in v0.5.0

func SetOAuth(host string, creds config.OAuthCredentials) error

SetOAuth stores OAuth credentials for host on a separate key.

Types

This section is empty.

Jump to

Keyboard shortcuts

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