kubernetes

package
v0.70.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2026 License: Apache-2.0 Imports: 10 Imported by: 1 module, 0 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

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