tlslib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KubeTLSSecretLocation = "/var/run/secrets/gauntletwizard.net/tls/"
	KubeTLSKeyLocation    = KubeTLSSecretLocation + "tls.key"
	KubeTLSCertLocation   = KubeTLSSecretLocation + "tls.crt"
	KubeTLSCALocation     = "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt"
)

Variables

This section is empty.

Functions

func KubeHTTPClient

func KubeHTTPClient() (c http.Client, err error)

func ListenAndServeMTLS

func ListenAndServeMTLS(addr string, Handler http.Handler) error

ListenAndServeMTLS is a wrapper like http.ListenAndServe but with sane defaults for use with KubeTLS. Specifically, it sets the TlS configuration to

func NewKubeClientTLSWithoutM

func NewKubeClientTLSWithoutM() (credentials.TransportCredentials, error)

NewKubeClientTLSWithoutM is credentials.NewClientTLSFromFile with KubeTLS defaults

func NewKubeTLS

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

NewKubeTLS constructs a TLS Configuration for use with KubeTLS, suitable for use in both client and server contexts

func NewKubeTLSCredentials

func NewKubeTLSCredentials() (credentials.TransportCredentials, error)

NewKubeServerTLS is credentials.NewServerTLSFromFile with KubeTLS defaults

func NewKubeTLSCredentialsOrDie

func NewKubeTLSCredentialsOrDie() credentials.TransportCredentials

NewKubeServerTLS is credentials.NewServerTLSFromFile with KubeTLS defaults

func UserFromConnectionState

func UserFromConnectionState(conn *tls.ConnectionState) (string, error)

func UserFromGrpcContext

func UserFromGrpcContext(ctx context.Context) (string, error)

func UserFromHTTPRequest

func UserFromHTTPRequest(r http.Request) (string, error)

func WithKubeTLSClientCreds

func WithKubeTLSClientCreds() grpc.DialOption

WithKubeTLSClientCreds is like grpc.WithTransportCredentials using KubeTLS's supplied It panics if the Kubernetes Credentials are not available

func WithKubeTLSClientCredsWithoutM

func WithKubeTLSClientCredsWithoutM() grpc.DialOption

WithKubeTLSClientCreds is like grpc.WithTransportCredentials using KubeTLS's supplied It panics if the Kubernetes Credentials are not available

func WithKubeTLSServerCreds

func WithKubeTLSServerCreds() grpc.ServerOption

WithKubeTLSServerCreds is like grpc.WithTransportCredentials using KubeTLS's supplied It panics if the Kubernetes Credentials are not available

Types

This section is empty.

Jump to

Keyboard shortcuts

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