auth

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAuthTokenProvider

func NewAuthTokenProvider(
	appCtx context.Context,
	clientID, clientSecret string,
	options *Options,
) (*authTokenProvider, error)

NewAuthTokenProvider creates a new AuthTokenProvider with the given context and options. If options is set to nil then the default options will be used.

The supplied app context will be passed when performing background operations such as refreshing the access token, which ensures that no operation outlives the lifetime of the application.

By default the AuthTokenProvider will fetch the client ID and client secret from the environment variables `STATELY_CLIENT_ID` and `STATELY_CLIENT_SECRET`, however these can be explicitly overridden by passing credentials in the options. If no credentials are found, NewAuthTokenProvider will return an error.

Types

type Options

type Options struct {
	// Domain is the domain to query for auth tokens.
	// Defaults to https://oauth.stately.cloud
	Domain string
	// Audience is the audience that the provider will request tokens for.
	// Defaults to api.stately.cloud
	Audience string
}

Options is a struct of options to be passed to NewAuthTokenProvider. This can be omitted to use the default options or can be passed explicitly with any overrides.

Jump to

Keyboard shortcuts

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