credentials

package
v0.1.62 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Overview

Package credentials stores Boxy operator credentials in the operating system's keyring rather than in Boxy configuration or state files.

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Get(service, user string) (string, error)
	Set(service, user, value string) error
	Delete(service, user string) error
}

Backend is the small keyring API used by Store. Tests can inject an in-memory implementation without touching a host keychain or secret service.

type Store

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

Store is a keyring-backed operator credential store.

func New

func New() *Store

New returns a Store backed by the host operating system's keyring.

func NewWithBackend

func NewWithBackend(service string, backend Backend) *Store

NewWithBackend constructs a Store with an injected backend, primarily for tests and platform-specific integration tests.

func (*Store) Delete

func (s *Store) Delete(server string) error

func (*Store) DeleteGuestCredential added in v0.1.52

func (s *Store) DeleteGuestCredential(server, sandboxID, resourceID string) error

DeleteGuestCredential removes a previously saved guest credential from the keyring. A missing entry is a no-op success, the same way Delete already treats a missing API credential/CA entry — not every sandbox is created with --save-guest-cred, so callers (sandbox delete) don't need to check existence first.

func (*Store) Get

func (s *Store) Get(server string) (string, error)

func (*Store) GetCA

func (s *Store) GetCA(server string) ([]byte, error)

func (*Store) GetGuestCredential added in v0.1.40

func (s *Store) GetGuestCredential(server, sandboxID, resourceID string) (providersdk.GuestCredential, error)

GetGuestCredential retrieves a previously saved guest credential.

func (*Store) Set

func (s *Store) Set(server, value string) error

func (*Store) SetCA

func (s *Store) SetCA(server string, certificate []byte) error

func (*Store) SetGuestCredential added in v0.1.40

func (s *Store) SetGuestCredential(server, sandboxID, resourceID string, credential providersdk.GuestCredential) error

SetGuestCredential stores a one-time-delivered guest credential for a sandbox resource. Guest credentials use a separate keyring namespace from API keys and CA certificates, and are stored as the opaque provider envelope so the CLI does not need to understand provider-specific fields.

Jump to

Keyboard shortcuts

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