iamauth

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2026 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package iamauth builds cloud-provider credential providers for authenticating to managed Redis/Valkey (for example GCP Memorystore) with short-lived IAM access tokens instead of a static password.

It is the single place the provider-specific cloud SDKs live. Components (Gateway, Pump, MDCB, Dashboard) call NewProvider with their configured provider and pass the result to the storage connector's model.WithCredentialsProvider option. A new cloud (for example AWS ElastiCache) is added by implementing another sub-package and one extra case in NewProvider, without touching any consumer.

Index

Constants

View Source
const (
	ProviderGCP = "gcp"
)

Supported provider identifiers for Config.Provider.

Variables

This section is empty.

Functions

func NewProvider

func NewProvider(ctx context.Context, cfg Config) (model.CredentialsProviderFunc, error)

NewProvider builds the credentials provider for cfg.Provider, suitable for the storage connector's model.WithCredentialsProvider option. It returns an error when the provider is unset or unsupported, or when the underlying provider fails to initialize (for example unresolved credentials).

Types

type Config

type Config struct {
	// Provider is the cloud provider identifier, for example "gcp".
	Provider string
	// ServiceAccount, when set, is the service account to impersonate. When
	// empty the workload's own identity is used (GKE Workload Identity or
	// GOOGLE_APPLICATION_CREDENTIALS for GCP). Optional.
	ServiceAccount string
	// RefreshBeforeExpiry is how far ahead of expiry tokens are refreshed,
	// expressed as a Go duration string (for example "5m"). This mirrors the
	// consumer's raw config value so callers don't each re-implement parsing.
	// Empty applies the provider-specific default. Optional.
	RefreshBeforeExpiry string
}

Config selects and configures an IAM credentials provider.

Directories

Path Synopsis
Package gcp provides a credentials provider for authenticating to GCP Memorystore (Valkey and Redis Cluster) using IAM access tokens instead of a static Redis password.
Package gcp provides a credentials provider for authenticating to GCP Memorystore (Valkey and Redis Cluster) using IAM access tokens instead of a static Redis password.

Jump to

Keyboard shortcuts

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