auth

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package auth models OpenObserve credentials and applies them to outgoing HTTP requests. It is the pure, dependency-light core shared by the CLI and the desktop GUI; configuration and keychain wiring live in their callers.

Index

Constants

View Source
const (
	// SchemeBasic is HTTP Basic auth: email (username) + password.
	SchemeBasic = "basic"
	// SchemeToken is a pre-generated credential sent verbatim in the
	// Authorization header (the base64 portion of a Basic token, or a full
	// "Basic ..." / "Bearer ..." value).
	SchemeToken = "token"
)

Scheme identifies an authentication scheme.

Variables

This section is empty.

Functions

func AccountKey

func AccountKey(baseURL, scheme string) string

AccountKey derives the keychain account identifier for a base URL and scheme. It is stable across runs so credentials can be located later.

Types

type Credential

type Credential struct {
	Scheme   string
	Username string // basic only (the account email)
	Secret   string // password (basic) or token value (token)
}

Credential is a fully resolved credential ready to authenticate requests.

func (Credential) Decorator

func (c Credential) Decorator() transport.Decorator

Decorator returns a transport.Decorator that authenticates every request.

func (Credential) Header

func (c Credential) Header() string

Header returns the Authorization header value for the credential.

OpenObserve authenticates API requests with HTTP Basic auth. For the basic scheme we encode email:password; for the token scheme the user supplies a pre-generated credential — either the already-base64-encoded basic token, or a full "Basic ..." / "Bearer ..." header value, which we pass through verbatim.

func (Credential) Redacted

func (c Credential) Redacted() Credential

Redacted returns a copy safe for logging: the secret is masked.

func (Credential) Validate

func (c Credential) Validate() error

Validate reports whether the credential is internally consistent.

Jump to

Keyboard shortcuts

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