Documentation
¶
Overview ¶
Package util implements helper functions for the api
Index ¶
- func GetCrossNodeClientTLSConfig() (*tls.Config, error)
- func GetDCAAuthToken() string
- func InitDCAAuthToken(config model.Reader) error
- func IsForbidden(ip string) bool
- func IsIPv6(ip string) bool
- func SetCrossNodeClientTLSConfig(config *tls.Config)
- func TestOnlyResetCrossNodeClientTLSConfig()
- func TokenValidator(tokenGetter func() string) func(w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetCrossNodeClientTLSConfig ¶ added in v0.70.0
GetCrossNodeClientTLSConfig returns the TLS configuration for cross-node communication.
func InitDCAAuthToken ¶
InitDCAAuthToken initialize the session token for the Cluster Agent based on config options Requires that the config has been set up before calling
func IsForbidden ¶
IsForbidden returns whether the cluster check runner server is allowed to listen on a given ip The function is a non-secure helper to help avoiding setting an IP that's too permissive. The function doesn't guarantee any security feature
func SetCrossNodeClientTLSConfig ¶ added in v0.70.0
SetCrossNodeClientTLSConfig sets the TLS configuration for cross-node communication if not already set.
func TestOnlyResetCrossNodeClientTLSConfig ¶ added in v0.70.0
func TestOnlyResetCrossNodeClientTLSConfig()
TestOnlyResetCrossNodeClientTLSConfig resets the TLS configuration for cross-node communication. This is used for testing purposes only.
func TokenValidator ¶ added in v0.69.0
TokenValidator is a middleware that validates the session token for the DCA. It checks the "Authorization" header for a Bearer token and compares it to the session token stored in the configuration.
Types ¶
This section is empty.