k8s

package
v0.23.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

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

	DefaultConjurVersion = "5"

	// 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"
	AuthnType                        = "authn-k8s"
)

Default settings (this comment added to satisfy linter)

Variables

This section is empty.

Functions

func AuthenticateRequest

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

AuthenticateRequest sends an authenticate request

func LoginRequest

func LoginRequest(authnURL string, conjurVersion string, csrBytes []byte, usernamePrefix string) (*http.Request, error)

LoginRequest sends a login request

Types

type Authenticator

type Authenticator struct {
	PublicCert *x509.Certificate
	// 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

func (*Authenticator) IsLoggedIn

func (auth *Authenticator) IsLoggedIn() bool

IsLoggedIn returns true if we are logged in (have a cert)

type Config

type Config struct {
	Common            common.Config
	InjectCertLogPath string
	PodName           string
	PodNamespace      string
	ConjurVersion     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