authenticator

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2023 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Overview

Package authenticator is responsible for handling the authentication of users with third party identity providers.

Index

Constants

This section is empty.

Variables

View Source
var ErrOAuthCredentialsIncomplete = errors.New("must specify both client ID and client secret")

Functions

func NewAuthenticatorService

func NewAuthenticatorService(opts Options) (*service, error)

func NewOIDCIssuer

func NewOIDCIssuer(t *testing.T, username, aud, name string) string

NewOIDCIssuer creates an oidc issuer server and returns its url. For testing purposes.

Types

type OAuthClient

type OAuthClient struct {
	internal.HostnameService // for retrieving otf system hostname for use in redirects back to otf

	*oauth2.Config
	// contains filtered or unexported fields
}

OAuthClient performs the client role in an oauth handshake, requesting authorization from the user to access their account details on a particular cloud.

func NewOAuthClient

func NewOAuthClient(cfg OAuthClientConfig) (*OAuthClient, error)

func (*OAuthClient) CallbackHandler

func (a *OAuthClient) CallbackHandler(r *http.Request) (*oauth2.Token, error)

func (*OAuthClient) CallbackPath

func (a *OAuthClient) CallbackPath() string

func (*OAuthClient) NewClient

func (a *OAuthClient) NewClient(ctx context.Context, token *oauth2.Token) (cloud.Client, error)

NewClient constructs a cloud client configured with the given oauth token for authentication.

func (*OAuthClient) RequestHandler

func (a *OAuthClient) RequestHandler(w http.ResponseWriter, r *http.Request)

RequestHandler initiates the oauth flow, redirecting user to the auth server

func (*OAuthClient) RequestPath

func (a *OAuthClient) RequestPath() string

func (*OAuthClient) String

func (a *OAuthClient) String() string

String provides a human-readable identifier for the oauth client, using the name of its underlying cloud provider

type OAuthClientConfig

type OAuthClientConfig struct {
	cloud.CloudOAuthConfig
	// contains filtered or unexported fields
}

OAuthClientConfig is configuration for constructing an OAuth client

Jump to

Keyboard shortcuts

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