auth_util

package
v0.2.2-alpha04 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2025 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LocationHeader string = "header"
	LocationQuery  string = "query"
	AuthTypeBasic  string = "BASIC"
	AuthTypeCustom string = "custom"
	AuthTypeBearer string = "Bearer"
	AuthTypeAPIKey string = "api_key"
)
View Source
const (
	ServiceAccountPathErrStr string = "[ERROR] credentialsfilepath not supplied or key file does not exist."
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AssistedTransport

type AssistedTransport interface {
	RoundTrip(req *http.Request) (*http.Response, error)
	// contains filtered or unexported methods
}

func NewTransport

func NewTransport(
	token []byte,
	authType,
	authValuePrefix,
	tokenLocation,
	key string,
	underlyingTransport http.RoundTripper,
) (AssistedTransport, error)

type AuthUtility

type AuthUtility interface {
	ActivateAuth(authCtx *dto.AuthCtx, principal string, authType string)
	DeactivateAuth(authCtx *dto.AuthCtx)
	AuthRevoke(authCtx *dto.AuthCtx) error
	ParseServiceAccountFile(ac *dto.AuthCtx) (serviceAccount, error)
	GetGoogleJWTConfig(
		provider string,
		credentialsBytes []byte,
		scopes []string,
		subject string,
	) (*jwt.Config, error)
	GetGenericClientCredentialsConfig(authCtx *dto.AuthCtx, scopes []string) (*clientcredentials.Config, error)
	GoogleOauthServiceAccount(
		provider string,
		authCtx *dto.AuthCtx,
		scopes []string,
		httpContext netutils.HTTPContext,
	) (*http.Client, error)
	GenericOauthClientCredentials(
		authCtx *dto.AuthCtx,
		scopes []string,
		httpContext netutils.HTTPContext,
	) (*http.Client, error)
	ApiTokenAuth(authCtx *dto.AuthCtx, httpContext netutils.HTTPContext, enforceBearer bool) (*http.Client, error)
	AwsSigningAuth(authCtx *dto.AuthCtx, httpContext netutils.HTTPContext) (*http.Client, error)
	BasicAuth(authCtx *dto.AuthCtx, httpContext netutils.HTTPContext) (*http.Client, error)
	CustomAuth(authCtx *dto.AuthCtx, httpContext netutils.HTTPContext) (*http.Client, error)
	AzureDefaultAuth(authCtx *dto.AuthCtx, httpContext netutils.HTTPContext) (*http.Client, error)
	GCloudOAuth(runtimeCtx dto.RuntimeCtx, authCtx *dto.AuthCtx, enforceRevokeFirst bool) (*http.Client, error)
	GetCurrentGCloudOauthUser() ([]byte, error)
}

func NewAuthUtility

func NewAuthUtility() AuthUtility

Jump to

Keyboard shortcuts

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