auth

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package auth turns resolved credentials into request headers.

Index

Constants

View Source
const RefreshWindow = 60 * time.Second

RefreshWindow is how close to expiry a cached token may get before blip replaces it.

Variables

This section is empty.

Functions

func Fingerprint

func Fingerprint(secret string) string

Fingerprint identifies a secret without revealing it, so two runs can be compared.

Types

type Authenticator

type Authenticator interface {
	// Apply sets whatever headers the mechanism needs.
	Apply(ctx context.Context, req *http.Request) error
	// Describe reports the mechanism and how the secret was obtained. Never secret.
	Describe(ctx context.Context) (string, error)
	// Secrets lists values that must be redacted from any output.
	Secrets() []string
	// PermitsHost reports whether this credential may be sent to a host.
	PermitsHost(host string) bool
	// Pinned reports whether the profile named the hosts it trusts.
	Pinned() bool
}

Authenticator applies a credential to outgoing requests.

func New

func New(r *creds.Resolved, client *http.Client) (Authenticator, error)

New builds an authenticator for a resolved profile. client is used only by oauth2_cc, which has to make a request of its own.

func None

func None() Authenticator

None is the authenticator for environments with no auth configured.

Jump to

Keyboard shortcuts

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