authclient

package
v0.179.0 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(httpOptions httpclient.Options, options AuthOptions) (client *http.Client, err error)

New auth client which is basically a http client but specific functionalities implemented depends on AuthMethod

Types

type AuthMethod

type AuthMethod string

AuthMethod defines the type of authentication method that needs to be use.

const (
	// AuthMethodOAuth2 is oauth2 type authentication.
	// Currently support client credentials and JWT type OAuth2 workflows.
	AuthMethodOAuth2 AuthMethod = "oauth2"
)

type AuthOptions

type AuthOptions struct {
	// AuthMethod ...
	AuthMethod AuthMethod
	// OAuth2Options ...
	OAuth2Options *OAuth2Options
}

AuthOptions Auth client options. Based on the AuthenticationMethod, further properties will be validated

type OAuth2Options

type OAuth2Options struct {
	OAuth2Type     OAuth2Type
	TokenURL       string
	Scopes         []string
	ClientID       string
	ClientSecret   string
	EndpointParams map[string]string
	Subject        string
	Email          string
	PrivateKey     []byte
	PrivateKeyID   string
}

OAuth2Options defines options for OAuth2 Client

type OAuth2Type

type OAuth2Type string

OAuth2Type defines type of oauth2 grant type

const (
	OAuth2TypeClientCredentials OAuth2Type = "client_credentials"
	OAuth2TypeJWT               OAuth2Type = "jwt"
)

Jump to

Keyboard shortcuts

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