okta

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FetchStrategy added in v0.5.0

type FetchStrategy int64
const (
	Lazy FetchStrategy = iota // Fetch new metadata inline with requests (when not cached)
	// Background Fetch new metadata in the background regardless of requests being made. This option was designed
	// for eliminating in-line metadata calls and minimizing latency in production use. Warning: this option will
	// attempt to seed metadata on initialization and block.
	Background

	DefaultCacheTtl = 5 * time.Minute
)

type MetadataProvider

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

MetadataProvider is an implementation of metadata.Provider that retrieves metadata from Okta's well known openid configuration

func NewMetadataProvider

func NewMetadataProvider(issuer string, options ...Option) (*MetadataProvider, error)

NewMetadataProvider creates a new MetadataProvider for the specified Okta issuer.

func (*MetadataProvider) GetMetadata

func (mp *MetadataProvider) GetMetadata(ctx context.Context) (metadata.Metadata, error)

GetMetadata gets metadata for the specified Okta issuer.

type Option

type Option func(*Options)

Option for the MetadataProvider.

func WithBackgroundCtx added in v0.5.0

func WithBackgroundCtx(ctx context.Context) Option

WithBackgroundCtx specified the context to use in order to control the lifecycle of the background fetching goroutine.

func WithCacheTtl

func WithCacheTtl(ttl time.Duration) Option

WithCacheTtl specifies the TTL on the Okta JWK set.

func WithFetchStrategy added in v0.5.0

func WithFetchStrategy(fetchStrategy FetchStrategy) Option

WithFetchStrategy specifies a strategy for fetching new metadata.

func WithHttpClient

func WithHttpClient(httpClient *http.Client) Option

WithHttpClient allows for a configurable http client.

type Options

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

Options are configurable options for the MetadataProvider.

Jump to

Keyboard shortcuts

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