credentials

package
v0.22.0-alpha2 Latest Latest
Warning

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

Go to latest
Published: May 15, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultService is the OS keyring service name used for Obot CLI
	// credentials.
	DefaultService = "obot"
)

Variables

View Source
var ErrNotFound = errors.New("credential not found")

ErrNotFound is returned when no credential exists for the requested app URL.

Functions

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err means a credential is absent.

Types

type KeyringStore

type KeyringStore struct {
	// contains filtered or unexported fields
}

KeyringStore stores one bearer token per normalized Obot app URL.

func NewKeyringStore

func NewKeyringStore() *KeyringStore

NewKeyringStore returns a Store backed by the host OS keyring.

func (*KeyringStore) Delete

func (s *KeyringStore) Delete(appURL string) error

func (*KeyringStore) Get

func (s *KeyringStore) Get(appURL string) (string, error)

func (*KeyringStore) Set

func (s *KeyringStore) Set(appURL, token string) error

type Store

type Store interface {
	Get(appURL string) (string, error)
	Set(appURL, token string) error
	// Delete removes the credential for appURL. Missing credentials are
	// not an error.
	Delete(appURL string) error
}

Store is the credential storage boundary for Obot app URL scoped bearer tokens.

Jump to

Keyboard shortcuts

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