auth

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIKeyAuthenticator

type APIKeyAuthenticator struct {
	Key string
}

Provides an Authenticator for use with an API key

func (*APIKeyAuthenticator) GetAuthToken

func (a *APIKeyAuthenticator) GetAuthToken() (string, error)

type Authenticator

type Authenticator interface {
	GetAuthToken() (string, error)
}

This must be provided to get the token to be used for API authentication. This can be an API key or an OpenID Connect token.

func GetOIDCAuthenticator

func GetOIDCAuthenticator(issuer string, scopes []string, clientId string, secret SecretFetcher, orgId string) Authenticator

type OIDCAuthenticator

type OIDCAuthenticator struct {
	Issuer         string
	Scopes         []string
	ClientID       string
	Secret         SecretFetcher
	PeacemakrOrgID string
}

func (*OIDCAuthenticator) GetAuthToken

func (a *OIDCAuthenticator) GetAuthToken() (string, error)

type PubKeyAuthenticator

type PubKeyAuthenticator struct {
	PrivateKeyPath string
	KeyId          string
	KeyType        string
	Expiration     time.Duration
}

func (*PubKeyAuthenticator) GetAuthToken

func (p *PubKeyAuthenticator) GetAuthToken() (string, error)

type SecretFetcher

type SecretFetcher func() (string, error)

Gets a secret token from storage - could be a function that returns a constant string or it could perform a network call to fetch a secret from a secret manager.

Jump to

Keyboard shortcuts

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