Documentation
¶
Overview ¶
Package util implements helper functions for the api
Index ¶
- func CreateAndSetAuthToken(config model.Reader) error
- func GetAuthToken() string
- func GetDCAAuthToken() string
- func GetTLSClientConfig() *tls.Config
- func GetTLSServerConfig() *tls.Config
- func InitDCAAuthToken(config model.Reader) error
- func IsForbidden(ip string) bool
- func IsIPv6(ip string) bool
- func IsInitialized() bool
- func SetAuthToken(config model.Reader) error
- func Validate(w http.ResponseWriter, r *http.Request) error
- func ValidateDCARequest(w http.ResponseWriter, r *http.Request) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateAndSetAuthToken ¶
CreateAndSetAuthToken creates and sets the authorization token and IPC certificate Requires that the config has been set up before calling
func GetTLSClientConfig ¶ added in v0.62.0
GetTLSClientConfig gets the certificate and key used for IPC
func GetTLSServerConfig ¶ added in v0.62.0
GetTLSServerConfig gets the certificate and key used for IPC
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 IsInitialized ¶ added in v0.62.0
func IsInitialized() bool
IsInitialized return true if the auth_token and IPC cert/key pair have been initialized with SetAuthToken or CreateAndSetAuthToken functions
func SetAuthToken ¶
SetAuthToken sets the session token and IPC certificate Requires that the config has been set up before calling
func Validate ¶
func Validate(w http.ResponseWriter, r *http.Request) error
Validate validates an http request TODO IPC: Deprecate this function
func ValidateDCARequest ¶
func ValidateDCARequest(w http.ResponseWriter, r *http.Request) error
ValidateDCARequest is used for the exposed endpoints of the DCA. It is different from Validate as we want to have different validations.
Types ¶
This section is empty.