auth

package
v2.1.3 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBadAuth = key.ErrBadAuth

ErrBadAuth is an error because of incorrect auth

View Source
var ErrInternalError = errors.New("internal error")

ErrInternalError is an error because of internal error

View Source
var ErrMissingProductListClaim = errors.New("api_product_list claim is required")

ErrMissingProductListClaim is an error when missing api_product_list claim

View Source
var ErrNoAuth = errors.New("missing authentication")

ErrNoAuth is an error because of missing auth

Functions

This section is empty.

Types

type Context

type Context struct {
	context.Context
	ClientID         string
	AccessToken      string
	Application      string
	APIProducts      []string
	Expires          time.Time
	DeveloperEmail   string
	Scopes           []string
	APIKey           string
	CustomAttributes string
	AnalyticsProduct string // A single product to attatch to analytics records based on matched operations.
}

A Context wraps all the various information that is needed to make requests through the Apigee adapter.

type Manager

type Manager interface {
	Close()
	Authenticate(ctx context.Context, apiKey string, claims map[string]interface{}, apiKeyClaimKey string) (*Context, error)
}

A Manager wraps all things related to auth processing

func NewManager

func NewManager(options Options) (Manager, error)

NewManager constructs a new Manager for JWT functions. Call Close() when done.

type Options

type Options struct {
	// Client is a configured HTTPClient
	Client *http.Client
	// APIKeyCacheDuration is the length of time APIKeys are cached when unable to refresh
	APIKeyCacheDuration time.Duration
	// Org is organization
	Org string
	// JWKSProviders
	JWTProviders []jwt.Provider
}

Options allows us to specify options for how this auth manager will run

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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