credential

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package credential stores Overgent's secrets in the operating system's own credential store: the hosted device credential, and the local backend's instance secret and deployment secrets key (docs/security-privacy.md, "Local"). Every platform is reached through the same unexported put/get/remove trio, so callers never branch on GOOS.

There is deliberately no file-based or passphrase-encrypted fallback. When no OS store is reachable the platform implementation returns an *UnavailableError naming what is missing and what the member should do; it never degrades to writing a secret under the profile root.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("no credential is stored for this account")

ErrNotFound reports that the OS credential store was reachable but holds no item for the account. Callers that treat "no credential yet" as an ordinary state (first run, after a revoke) can test for it with errors.Is rather than matching error text.

The macOS implementation shells out to the Security CLI and cannot classify its exit status reliably, so it returns an unclassified error instead. Treat any error from Get as "no usable credential"; treat ErrNotFound as the stronger, positively identified case.

Functions

func Delete

func Delete(ctx context.Context, account string) error

func Get

func Get(ctx context.Context, account string) (string, error)

func Put

func Put(ctx context.Context, account, secret string) error

Types

type UnavailableError added in v0.1.1

type UnavailableError struct {
	// Platform is the GOOS the message was written for.
	Platform string
	// Reason names what is missing, in the member's terms.
	Reason string
	// Remedy is the concrete next step.
	Remedy string
	// Cause is the underlying transport error, if there was one.
	Cause error
}

UnavailableError reports that this machine exposes no usable OS credential store. It is deliberately distinct from an ordinary read or write failure: the remedy is to install or start a credential store, not to retry.

Reason and Remedy are written for a member reading a CLI error, and neither ever carries a secret value.

func (*UnavailableError) Error added in v0.1.1

func (e *UnavailableError) Error() string

func (*UnavailableError) Unwrap added in v0.1.1

func (e *UnavailableError) Unwrap() error

Jump to

Keyboard shortcuts

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