jwt

package
v0.0.1-14 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultClientCertPath = "/etc/conjur/ssl/client.pem"
	DefaultTokenFilePath  = "/run/conjur/access-token"

	// DefaultTokenRefreshTimeout is the default time the system waits to reauthenticate on error
	DefaultTokenRefreshTimeout = "6m0s"

	// DefaultClientCertRetryCountLimit is the amount of times we wait after successful
	// login for the client certificate file to exist, where each time we wait for a second.
	DefaultClientCertRetryCountLimit = "10"

	DefaultJWTTokenPath = "/var/run/secrets/kubernetes.io/serviceaccount/token"

	AuthnType = "authn-jwt"
)

Default settings (this comment added to satisfy linter)

Variables

This section is empty.

Functions

func AuthenticateRequest

func AuthenticateRequest(authnURL string, account string, username string, jwtToken string) (*http.Request, error)

AuthenticateRequest sends an authenticate request

Types

type Authenticator

type Authenticator struct {
	Config *Config
	// contains filtered or unexported fields
}

Authenticator contains the configuration and client for the authentication connection to Conjur

func NewWithAccessToken

func NewWithAccessToken(config Config, accessToken access_token.AccessToken) (*Authenticator, error)

NewWithAccessToken creates a new authenticator instance from a given access token

func (*Authenticator) Authenticate

func (auth *Authenticator) Authenticate() error

Authenticate sends Conjur an authenticate request and writes the response to the token file (after decrypting it if needed). It also manages state of certificates. @deprecated Use AuthenticateWithContext instead

func (*Authenticator) AuthenticateWithContext

func (auth *Authenticator) AuthenticateWithContext(ctx context.Context) error

func (*Authenticator) GetAccessToken

func (auth *Authenticator) GetAccessToken() access_token.AccessToken

GetAccessToken is getter for accessToken

type Config

type Config struct {
	Common           common.Config
	JWTTokenFilePath string
}

Config defines the configuration parameters for the authentication requests

func (*Config) GetContainerMode

func (config *Config) GetContainerMode() string

func (*Config) GetDefaultValues

func (config *Config) GetDefaultValues() map[string]string

func (*Config) GetEnvVariables

func (config *Config) GetEnvVariables() []string

func (*Config) GetRequiredVariables

func (config *Config) GetRequiredVariables() []string

func (*Config) GetTokenFilePath

func (config *Config) GetTokenFilePath() string

func (*Config) GetTokenTimeout

func (config *Config) GetTokenTimeout() time.Duration

func (*Config) LoadConfig

func (config *Config) LoadConfig(settings map[string]string)

Jump to

Keyboard shortcuts

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