auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package auth resolves fal credentials and produces the Authorization header. It is consumed by the transport layer through the Manager type. Credential material (keys, tokens, refresh tokens) is held in unexported fields and is never exposed: the only surface is NewManager and the AuthHeader method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager resolves credentials once and serves the Authorization header, refreshing a file-based bearer token on expiry. It is safe for concurrent use.

func NewManager

func NewManager(key, authBase, tokenFilePath, userAgent string, httpClient *http.Client) *Manager

NewManager builds a Manager. key is an explicit fal key (overriding environment resolution) or ""; authBase is the Auth0 token host; tokenFilePath overrides the default login-token path (mainly for tests) or ""; userAgent is sent on the refresh request; httpClient performs the (un-retried) refresh call.

func (*Manager) AuthHeader

func (m *Manager) AuthHeader(ctx context.Context) (string, error)

AuthHeader returns the Authorization header value, refreshing a file-based bearer token if it is missing or near expiry.

Jump to

Keyboard shortcuts

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