util

package
v0.68.0 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2025 License: Apache-2.0 Imports: 16 Imported by: 28

Documentation

Overview

Package util implements helper functions for the api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateAndSetAuthToken

func CreateAndSetAuthToken(config model.Reader) error

CreateAndSetAuthToken creates and sets the authorization token and IPC certificate Requires that the config has been set up before calling

func GetAuthToken

func GetAuthToken() string

GetAuthToken gets the session token

func GetDCAAuthToken

func GetDCAAuthToken() string

GetDCAAuthToken gets the session token

func GetTLSClientConfig added in v0.62.0

func GetTLSClientConfig() *tls.Config

GetTLSClientConfig gets the certificate and key used for IPC

func GetTLSServerConfig added in v0.62.0

func GetTLSServerConfig() *tls.Config

GetTLSServerConfig gets the certificate and key used for IPC

func InitDCAAuthToken

func InitDCAAuthToken(config model.Reader) error

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

func IsForbidden(ip string) bool

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 IsIPv6

func IsIPv6(ip string) bool

IsIPv6 is used to differentiate between ipv4 and ipv6 addresses.

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

func SetAuthToken(config model.Reader) error

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.

Jump to

Keyboard shortcuts

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