Documentation
¶
Index ¶
- Variables
- func AgentAuthenticationMiddleware(config []project.AgentConfig, lookup EnvLookupFunc, next http.HandlerFunc) http.HandlerFunc
- func BuildAgentSecrets(agents []project.AgentConfig, lookup EnvLookupFunc) (map[string]cstr.MaskedString, error)
- func InterpolateAgentConfig(config []project.AgentConfig, lookup EnvLookupFunc) []project.AgentConfig
- func NewBearerToken(sharedSecret string, opts ...TokenOpt) (string, error)
- func ValidateAgentAuthentication(config project.AgentConfig, lookup EnvLookupFunc, headers http.Header) bool
- func ValidateToken(sharedSecret string, auth string) error
- type EnvLookupFunc
- type TokenOpt
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTokenExpired = errors.New("token expired") ErrInvalidToken = errors.New("invalid token") )
OSEnvLookup is a function that looks up environment variables.
Functions ¶
func AgentAuthenticationMiddleware ¶ added in v1.0.97
func AgentAuthenticationMiddleware(config []project.AgentConfig, lookup EnvLookupFunc, next http.HandlerFunc) http.HandlerFunc
AgentAuthenticationMiddleware returns HTTP middleware that authenticates agents.
func BuildAgentSecrets ¶ added in v1.0.97
func BuildAgentSecrets(agents []project.AgentConfig, lookup EnvLookupFunc) (map[string]cstr.MaskedString, error)
BuildAgentSecrets will build a map of secrets for the given agents based on their authentication type.
func InterpolateAgentConfig ¶ added in v1.0.97
func InterpolateAgentConfig(config []project.AgentConfig, lookup EnvLookupFunc) []project.AgentConfig
InterpolateAgentConfig interpolates environment variables in agent configurations and returns them as non-interpolated values replaced using the provided lookup function.
func NewBearerToken ¶
NewBearerToken generates a new bearer token
func ValidateAgentAuthentication ¶ added in v1.0.97
func ValidateAgentAuthentication(config project.AgentConfig, lookup EnvLookupFunc, headers http.Header) bool
ValidateAgentAuthentication validates the authentication of an agent.
func ValidateToken ¶
Types ¶
type EnvLookupFunc ¶ added in v1.0.97
Click to show internal directories.
Click to hide internal directories.