authenticators

package
v0.23.8 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Apache-2.0, BSD-3-Clause, MIT Imports: 17 Imported by: 2

Documentation

Overview

Package authenticators contains logic for setting up an Open ID Connect authenticator

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasicOSBAuthenticator added in v0.11.0

func BasicOSBAuthenticator(request *web.Request, repository storage.Repository, username, password string) (*web.UserContext, httpsec.Decision, error)

BasicOSBAuthenticator attempts to authenticate basic auth requests with provided broker platform credentials

func BasicPlatformAuthenticator added in v0.11.0

func BasicPlatformAuthenticator(request *web.Request, repository storage.Repository, username, password string) (*web.UserContext, httpsec.Decision, error)

BasicPlatformAuthenticator attempts to authenticate basic auth requests with provided platform credentials

func NewOIDCAuthenticator

func NewOIDCAuthenticator(ctx context.Context, options *OIDCOptions) (httpsec.Authenticator, string, error)

NewOIDCAuthenticator returns a new OpenID authenticator or an error if one couldn't be configured

Types

type Basic added in v0.9.7

type Basic struct {
	Repository             storage.Repository
	BasicAuthenticatorFunc BasicAuthenticatorFunc
}

Basic for basic security

func (*Basic) Authenticate added in v0.9.7

func (a *Basic) Authenticate(request *web.Request) (*web.UserContext, httpsec.Decision, error)

Authenticate authenticates by using the provided Basic credentials

type BasicAuthenticatorFunc added in v0.11.0

type BasicAuthenticatorFunc func(request *web.Request, repository storage.Repository, username, password string) (*web.UserContext, httpsec.Decision, error)

BasicAuthenticatorFunc defines a function which attempts to authenticate a basic auth request

type OIDCOptions

type OIDCOptions struct {
	// IssuerURL is the base URL of the token issuer
	IssuerURL string

	// ClientID is the id of the oauth client used to verify the tokens
	ClientID string

	// ReadConfigurationFunc is the function used to call the token issuer. If one is not provided, http.DefaultClient.Do will be used
	ReadConfigurationFunc util.DoRequestFunc
}

OIDCOptions is the configuration used to construct a new OIDC authenticator

type OauthAuthenticator

type OauthAuthenticator struct {
	Verifier httpsec.TokenVerifier
}

OauthAuthenticator is the OpenID implementation of security.Authenticator

func (*OauthAuthenticator) Authenticate

func (a *OauthAuthenticator) Authenticate(request *web.Request) (*web.UserContext, httpsec.Decision, error)

Authenticate returns information about the user by obtaining it from the bearer token, or an error if security is unsuccessful

Jump to

Keyboard shortcuts

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