common

package
v0.6.3 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// ACKRRSAAnnotation is the annotation key for RRSA role ARN on ServiceAccount
	ACKRRSAAnnotation = "ack.alibabacloud.com/role-arn"
	// DefaultOIDCTokenFile is the default path for OIDC token file
	DefaultOIDCTokenFile = "/var/run/secrets/tokens/ack-secret-manager"
	// TokenAudience is the default value for RAM oidc token auth
	TokenAudience = "sts.aliyuncs.com"
)

Variables

View Source
var EnableCrossNamespaceAuthRef = true

EnableCrossNamespaceAuthRef controls whether cross namespace references are allowed for auth

Functions

func BuildAuthConfig

func BuildAuthConfig(
	ctx context.Context,
	store *v1alpha1.SecretStore,
	kube client.Client,
	authProvider AuthConfigProvider,
	clusterId string,
	uid string,
) (auth.AuthConfig, error)

BuildAuthConfig builds an auth.AuthConfig from a SecretStore and AuthConfigProvider

func BuildAuthConfigFromEnv

func BuildAuthConfigFromEnv() auth.AuthConfig

func ProcessExternalSecretData

func ProcessExternalSecretData(data *v1alpha1.DataSource, externalData []byte) (map[string][]byte, error)

ProcessExternalSecretData processes external secret data with JMESPath support

func ProcessExtractedExternalSecretData

func ProcessExtractedExternalSecretData(data *v1alpha1.DataProcess, externalData []byte) (map[string][]byte, error)

ProcessExtractedExternalSecretData processes extracted secret data from YAML/JSON Preserves the original format: JSON input -> JSON output, YAML input -> YAML output

Types

type AuthConfigProvider

type AuthConfigProvider interface {
	GetServiceAccountRef() *v1alpha1.ServiceAccountRef
	GetAccessKey() *v1alpha1.SecretRef
	GetAccessKeySecret() *v1alpha1.SecretRef
	GetRAMRoleARN() string
	GetRAMRoleSessionName() string
	GetOIDCProviderARN() string
	GetOIDCTokenFilePath() string
	GetRoleSessionExpiration() string
	GetRemoteRAMRoleARN() string
	GetRemoteRAMRoleSessionName() string
	GetSecretStoreName() string
}

AuthConfigProvider defines an interface for extracting authentication configuration from provider-specific auth structs (KMSAuth, OOSAuth, etc.)

type KMSAuthAdapter

type KMSAuthAdapter struct {
	*v1alpha1.KMSAuth
	StoreName string
}

KMSAuthAdapter adapts KMSAuth to AuthConfigProvider interface

func (*KMSAuthAdapter) GetAccessKey

func (a *KMSAuthAdapter) GetAccessKey() *v1alpha1.SecretRef

func (*KMSAuthAdapter) GetAccessKeySecret

func (a *KMSAuthAdapter) GetAccessKeySecret() *v1alpha1.SecretRef

func (*KMSAuthAdapter) GetOIDCProviderARN

func (a *KMSAuthAdapter) GetOIDCProviderARN() string

func (*KMSAuthAdapter) GetOIDCTokenFilePath

func (a *KMSAuthAdapter) GetOIDCTokenFilePath() string

func (*KMSAuthAdapter) GetRAMRoleARN

func (a *KMSAuthAdapter) GetRAMRoleARN() string

func (*KMSAuthAdapter) GetRAMRoleSessionName

func (a *KMSAuthAdapter) GetRAMRoleSessionName() string

func (*KMSAuthAdapter) GetRemoteRAMRoleARN

func (a *KMSAuthAdapter) GetRemoteRAMRoleARN() string

func (*KMSAuthAdapter) GetRemoteRAMRoleSessionName

func (a *KMSAuthAdapter) GetRemoteRAMRoleSessionName() string

func (*KMSAuthAdapter) GetRoleSessionExpiration

func (a *KMSAuthAdapter) GetRoleSessionExpiration() string

func (*KMSAuthAdapter) GetSecretStoreName

func (a *KMSAuthAdapter) GetSecretStoreName() string

func (*KMSAuthAdapter) GetServiceAccountRef

func (a *KMSAuthAdapter) GetServiceAccountRef() *v1alpha1.ServiceAccountRef

type OOSAuthAdapter

type OOSAuthAdapter struct {
	*v1alpha1.OOSAuth
	StoreName string
}

OOSAuthAdapter adapts OOSAuth to AuthConfigProvider interface

func (*OOSAuthAdapter) GetAccessKey

func (a *OOSAuthAdapter) GetAccessKey() *v1alpha1.SecretRef

func (*OOSAuthAdapter) GetAccessKeySecret

func (a *OOSAuthAdapter) GetAccessKeySecret() *v1alpha1.SecretRef

func (*OOSAuthAdapter) GetOIDCProviderARN

func (a *OOSAuthAdapter) GetOIDCProviderARN() string

func (*OOSAuthAdapter) GetOIDCTokenFilePath

func (a *OOSAuthAdapter) GetOIDCTokenFilePath() string

func (*OOSAuthAdapter) GetRAMRoleARN

func (a *OOSAuthAdapter) GetRAMRoleARN() string

func (*OOSAuthAdapter) GetRAMRoleSessionName

func (a *OOSAuthAdapter) GetRAMRoleSessionName() string

func (*OOSAuthAdapter) GetRemoteRAMRoleARN

func (a *OOSAuthAdapter) GetRemoteRAMRoleARN() string

func (*OOSAuthAdapter) GetRemoteRAMRoleSessionName

func (a *OOSAuthAdapter) GetRemoteRAMRoleSessionName() string

func (*OOSAuthAdapter) GetRoleSessionExpiration

func (a *OOSAuthAdapter) GetRoleSessionExpiration() string

func (*OOSAuthAdapter) GetSecretStoreName

func (a *OOSAuthAdapter) GetSecretStoreName() string

func (*OOSAuthAdapter) GetServiceAccountRef

func (a *OOSAuthAdapter) GetServiceAccountRef() *v1alpha1.ServiceAccountRef

Jump to

Keyboard shortcuts

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