Help us shape the future of Go! Take the 2026 Go Developer Survey

kubernetes

package
v0.66.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateJWT

func CreateJWT(ctx context.Context, c client.Client,
	saRef *ServiceAccountReference, aud []string, exp time.Duration) (string, error)

CreateJWT generates a JSON Web Token (JWT) for the specified service account in the given namespace with the provided audiences. If no audiences are provided, an error is returned. The function also loads the controller ServiceAccount token to know which audiences the controller token is intended for to also reject those. These rejections force created tokens to always target external services instead of the local Kubernetes cluster, which is the only use case for the auth library. A nil saRef means creating the token for the controller ServiceAccount.

Types

type ServiceAccountReference

type ServiceAccountReference struct {
	Name      string
	Namespace string
}

ServiceAccountReference represents a reference to a Kubernetes ServiceAccount, including its name and namespace.

func (*ServiceAccountReference) String

func (r *ServiceAccountReference) String() string

String implements the fmt.Stringer interface.

Jump to

Keyboard shortcuts

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