auth

package
v0.0.0-...-0f879ca Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileTokenSource

type FileTokenSource struct {
	CredentialsLocation string
	OauthConfig         oauth2.Config
}

func (FileTokenSource) GetRequestMetadata

func (fileTokenSource FileTokenSource) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)

GetRequestMetadata gets the request metadata as a map from a TokenSource.

func (FileTokenSource) RequireTransportSecurity

func (fileTokenSource FileTokenSource) RequireTransportSecurity() bool

RequireTransportSecurity indicates whether the credentials requires transport security.

type OauthConfig

type OauthConfig struct {
	ClientId            string
	ClientSecret        string
	AuthServer          string
	CallbackPort        int32
	CredentialsLocation string
}

func (*OauthConfig) DeduceFlow

func (oauthConfig *OauthConfig) DeduceFlow() OauthFlow

Implicit configurations instead of explicitly set the desired flow ClientCredentials needs ClientId and ClientSecret AuthorizationCode only needs ClientId AuthServer is always mandatory

func (*OauthConfig) GetTokenSource

func (oauthConfig *OauthConfig) GetTokenSource() credentials.PerRPCCredentials

Returns an object that implements:

type PerRPCCredentials interface {
		GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error)
		RequireTransportSecurity() bool
}

func (*OauthConfig) IsAuthorizationCode

func (oauthConfig *OauthConfig) IsAuthorizationCode() bool

func (*OauthConfig) IsClientCredentials

func (oauthConfig *OauthConfig) IsClientCredentials() bool

func (*OauthConfig) IsEnabled

func (oauthConfig *OauthConfig) IsEnabled() bool

type OauthFlow

type OauthFlow int64
const (
	AuthorizationCode OauthFlow = iota
	ClientCredentials
	Undefined
)

Jump to

Keyboard shortcuts

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