credentials

package
v0.0.0-...-48947c8 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

View Source
const (
	// KubernetesSecretType is the name of a SDS secret stored in Kubernetes. Secrets here take the form
	// kubernetes://secret-name. They will be pulled from the same namespace and cluster as the requesting proxy lives in.
	KubernetesSecretType    = "kubernetes"
	KubernetesSecretTypeURI = KubernetesSecretType + "://"
	// KubernetesGatewaySecretType is the name of a SDS secret stored in Kubernetes, used by the gateway-api. Secrets here
	// take the form kubernetes-gateway://namespace/name. They are pulled from the config cluster.
	KubernetesGatewaySecretType = "kubernetes-gateway"

	// BuiltinGatewaySecretType is the name of a SDS secret that uses the workloads own mTLS certificate
	BuiltinGatewaySecretType    = "builtin"
	BuiltinGatewaySecretTypeURI = BuiltinGatewaySecretType + "://"
	// SdsCaSuffix is the suffix of the sds resource name for root CA.
	SdsCaSuffix = "-cacert"
)

Variables

This section is empty.

Functions

func ToKubernetesGatewayResource

func ToKubernetesGatewayResource(namespace, name string) string

func ToResourceName

func ToResourceName(name string) string

ToResourceName turns a `credentialName` into a resource name used for SDS

Types

type SecretResource

type SecretResource struct {
	// ResourceType is the type of secret. One of KubernetesSecretType or KubernetesGatewaySecretType
	ResourceType string
	// Name is the name of the secret
	Name string
	// Namespace is the namespace the secret resides in. For implicit namespace references (such as in KubernetesSecretType),
	// this will be resolved to the appropriate namespace. As a result, this should never be empty.
	Namespace string
	// ResourceName is the original name of the resource
	ResourceName string
	// Cluster is the cluster the secret should be fetched from.
	Cluster cluster.ID
}

SecretResource defines a reference to a secret

func ParseResourceName

func ParseResourceName(resourceName string, proxyNamespace string, proxyCluster cluster.ID, configCluster cluster.ID) (SecretResource, error)

ParseResourceName parses a raw resourceName string.

func (SecretResource) Key

func (sr SecretResource) Key() string

func (SecretResource) KubernetesResourceName

func (sr SecretResource) KubernetesResourceName() string

Jump to

Keyboard shortcuts

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