util

package
v0.0.28 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBearerToken

func GetBearerToken(r *http.Request) (string, error)

GetBearerToken returns the Bearer token or an error

func GetCertificate

func GetCertificate(ctx context.Context, path string) (*x509.CertPool, error)

GetCertificate returns a *x509.CertPool or error

func GetEncodedHash

func GetEncodedHash(s string) string

GetEncodedHash returns the hex encoded sha256 sum of the input string

func GetStringFromFile

func GetStringFromFile(ctx context.Context, path string) (string, error)

GetStringFromFile returns a string or error

func SliceContains added in v0.0.9

func SliceContains(s []string, str string) bool

SliceContains checks if a slice contains a string

func StripWebSocketBearer added in v0.0.8

func StripWebSocketBearer(old string) string

StripWebSocketBearer takes the string from the header Sec-WebSocket-Protocol (r.Header.Get("Sec-WebSocket-Protocol")) and removes any bearer (base64url.bearer.authorization.k8s.io.<bearer>)

Types

This section is empty.

Jump to

Keyboard shortcuts

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