util

package
v0.85.0 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: Apache-2.0 Imports: 12 Imported by: 10 modules, 28 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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