util

package
v0.73.2 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2025 License: Apache-2.0 Imports: 11 Imported by: 35

Documentation

Overview

Package util implements helper functions for the api

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCrossNodeClientTLSConfig added in v0.70.0

func GetCrossNodeClientTLSConfig() (*tls.Config, error)

GetCrossNodeClientTLSConfig returns the TLS configuration for cross-node communication.

func GetDCAAuthToken

func GetDCAAuthToken() string

GetDCAAuthToken gets the session token

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 SetCrossNodeClientTLSConfig added in v0.70.0

func SetCrossNodeClientTLSConfig(config *tls.Config)

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

func TokenValidator(tokenGetter func() string) func(w http.ResponseWriter, r *http.Request) error

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.

Jump to

Keyboard shortcuts

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