auth

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2023 License: LGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthOptions

type AuthOptions struct {
	Provider string
	Config   any
}

AuthOptions represents the necessary data to create a HeadersProvider for authentication and authorization using supported auth providers.

type GoogleAuthOptions

type GoogleAuthOptions struct {
	// The type of authentication. Typically "service_account".
	Type string `yaml:"type"`
	// The Google Cloud project ID.
	ProjectID string `yaml:"project_id"`
	// The private key ID.
	PrivateKeyID string `yaml:"private_key_id"`
	// The private key associated with the service account.
	PrivateKey string `yaml:"private_key"`
	// The client email associated with the service account.
	ClientEmail string `yaml:"client_email"`
	// The client ID associated with the service account.
	ClientID string `yaml:"client_id"`
	// The authentication URI.
	AuthURI string `yaml:"auth_uri"`
	// The token URI.
	TokenURI string `yaml:"token_uri"`
	// The URL of the authentication provider's x.509 certificate.
	AuthProviderCertURL string `yaml:"auth_provider_x509_cert_url"`
	// The URL of the client's x.509 certificate.
	ClientCertURL string `yaml:"client_x509_cert_url"`
}

GoogleAuthOptions represents the necessary data to create a HeadersProvider for authentication and authorization using Google IAM.

type GoogleHeadersProvider

type GoogleHeadersProvider struct {
	// contains filtered or unexported fields
}

GoogleHeadersProvider implements go.temporal.io/sdk/client/internal.HeadersProvider to customize the authorization header when connecting to Temporal instance backed up by Google IAM auth.

func (*GoogleHeadersProvider) GetHeaders

func (h *GoogleHeadersProvider) GetHeaders(ctx context.Context) (map[string]string, error)

GetHeaders returns a map overwriting the authorization header.

type HeadersProvider

type HeadersProvider interface {
	GetHeaders(ctx context.Context) (map[string]string, error)
}

HeadersProvider returns a map of gRPC headers that should be used on every request.

func NewAuthHeadersProvider

func NewAuthHeadersProvider(opts *AuthOptions) (HeadersProvider, error)

NewAuthHeadersProvider creates an implementation of the HeadersProvider interface based on the provided AuthOptions.

func NewGoogleHeadersProvider

func NewGoogleHeadersProvider(configBytes []byte) (HeadersProvider, error)

NewGoogleheadersProvider returns a new GoogleHeadersProvider instance.

func NewMacaroonHeadersProvider

func NewMacaroonHeadersProvider(configBytes []byte) (HeadersProvider, error)

NewMacaroonHeadersProvider returns a new MacaroonHeadersProvider instance.

type MacaroonAuthOptions

type MacaroonAuthOptions struct {
	// MacaroonURL represents the HTTP endpoint from which to fetch minted
	// macaroons.
	MacaroonURL string `yaml:"macaroon_url"`
	// AgentKey represents the agent key that will be authenticated with Candid.
	AgentKey *bakery.KeyPair `yaml:"keys"`
	// AgentKey represents the agent user name that will be authenticated with Candid.
	AgentUsername string `yaml:"username"`
}

MacaroonAuthOptions represents the necessary data to create a HeadersProvider for authentication and authorization using Candid.

type MacaroonHeadersProvider

type MacaroonHeadersProvider struct {
	// contains filtered or unexported fields
}

MacaroonHeadersProvider implements go.temporal.io/sdk/client/internal.HeadersProvider to customize the authorization header when connecting to Temporal instance backed up by Candid auth.

func (*MacaroonHeadersProvider) GetHeaders

func (h *MacaroonHeadersProvider) GetHeaders(ctx context.Context) (map[string]string, error)

GetHeaders returns a map overwriting the authorization header.

Jump to

Keyboard shortcuts

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