auth

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package auth resolves OpenObserve credentials from configuration or secure storage. The pure credential model (header construction, validation, account keying) lives in the public pkg/auth; this package keeps the config/keychain-coupled resolution and re-exports the moved symbols so existing callers keep working unchanged.

Index

Constants

View Source
const (
	SchemeBasic   = pkgauth.SchemeBasic
	SchemeToken   = pkgauth.SchemeToken
	SchemeSession = pkgauth.SchemeSession
)

Auth scheme identifiers, re-exported from pkg/auth.

View Source
const (
	BackendKeychain = credstore.BackendKeychain
	BackendFile     = credstore.BackendFile
)

Backend names reported by Store.Save.

Variables

View Source
var ErrSecretNotFound = credstore.ErrSecretNotFound

ErrSecretNotFound is returned when no secret exists for an account.

Functions

func AccountKey

func AccountKey(baseURL, scheme string) string

AccountKey is re-exported from pkg/auth.

func Forget

func Forget(baseURL, scheme string, store *Store) error

Forget removes any stored secret for the base URL and scheme.

func Save

func Save(baseURL string, cred Credential, store *Store) (string, error)

Save stores a credential's secret for later resolution and returns the backend ("keychain" or "file") that accepted it.

Types

type Backend added in v0.9.0

type Backend = credstore.Backend

Backend is the OS keychain a Store writes to.

type Credential

type Credential = pkgauth.Credential

Credential is re-exported from pkg/auth. Its methods (Header, Decorator, Validate, Redacted) come with the aliased type.

func Resolve

func Resolve(cfg config.Config, secrets config.Secrets, store *Store) (Credential, error)

Resolve produces a Credential from configuration. A secret supplied via flags/env/.env (carried in secrets) takes precedence; otherwise the secret is loaded from the Store. The returned credential is validated.

type Store

type Store = credstore.Store

Store persists secrets, preferring the OS keychain over a protected file.

func NewStore

func NewStore(dir string) *Store

NewStore returns a Store whose file fallback lives in dir.

func NewStoreWithBackend added in v0.9.0

func NewStoreWithBackend(dir string, b Backend) *Store

NewStoreWithBackend returns a Store using the supplied keychain backend.

type StoreAccessError added in v0.7.0

type StoreAccessError = credstore.StoreAccessError

StoreAccessError means the credential store could not be inspected.

Jump to

Keyboard shortcuts

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