Help us shape the future of Go! Take the 2026 Go Developer Survey

openbao

package
v0.4.21 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNotFound      = errors.New("credential not found")
	ErrAccessDenied  = errors.New("credential access denied")
	ErrInvalidReply  = errors.New("invalid OpenBao response")
	ErrRequestFailed = errors.New("OpenBao request failed")
	ErrInvalidRef    = errors.New("invalid credential ref")
)
View Source
var (
	ErrInvalidAddress = errors.New("invalid OpenBao address")
	ErrMissingToken   = errors.New("OpenBao token is required")
	ErrMissingMount   = errors.New("OpenBao KV mount is required")
)

Functions

This section is empty.

Types

type Client

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

Client resolves opaque BaseHarbor credential references from an OpenBao KV v2 mount. The ref is treated as a relative KV path. Scope is reserved for future policy/routing decisions and is deliberately not interpolated into the secret path.

func New

func New(cfg Config) (*Client, error)

func NewWithHTTPClient

func NewWithHTTPClient(cfg Config, httpClient *http.Client) (*Client, error)

NewWithHTTPClient exists for tests and controlled transports. The provided client is used as-is; callers remain responsible for secure TLS configuration.

func (*Client) Resolve

func (c *Client) Resolve(ctx context.Context, ref string, _ string) (credential.Data, error)

type Config

type Config struct {
	Address   string        `json:"address"`
	Token     string        `json:"-"`
	Namespace string        `json:"namespace,omitempty"`
	Mount     string        `json:"mount"`
	Timeout   time.Duration `json:"timeout,omitempty"`
}

Config contains the minimum information required by the OpenBao credential adapter. Token is intentionally excluded from JSON and must never be logged.

func (Config) Validate

func (c Config) Validate() error

Jump to

Keyboard shortcuts

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