Documentation
¶
Overview ¶
Package credentials stores Boxy operator credentials in the operating system's keyring rather than in Boxy configuration or state files.
Index ¶
- Variables
- type Backend
- type Store
- func (s *Store) Delete(server string) error
- func (s *Store) DeleteGuestCredential(server, sandboxID, resourceID string) error
- func (s *Store) Get(server string) (string, error)
- func (s *Store) GetCA(server string) ([]byte, error)
- func (s *Store) GetGuestCredential(server, sandboxID, resourceID string) (providersdk.GuestCredential, error)
- func (s *Store) Set(server, value string) error
- func (s *Store) SetCA(server string, certificate []byte) error
- func (s *Store) SetGuestCredential(server, sandboxID, resourceID string, credential providersdk.GuestCredential) error
Constants ¶
This section is empty.
Variables ¶
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 NewWithBackend ¶
NewWithBackend constructs a Store with an injected backend, primarily for tests and platform-specific integration tests.
func (*Store) DeleteGuestCredential ¶ added in v0.1.52
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) 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) 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.