end2end

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SetupAWSSecret

func SetupAWSSecret(ctx context.Context, t *testing.T, localstack *LocalStackContainer, secretName string, secretData map[string]string)

SetupAWSSecret creates a secret in AWS Secrets Manager (LocalStack)

func SetupAllContainers

func SetupAllContainers(ctx context.Context, t *testing.T) (*LocalStackContainer, *VaultContainer, *GCSMContainer)

SetupAllContainers sets up LocalStack, Vault, and GCSM containers

func SetupAzureKeyVaultSecret

func SetupAzureKeyVaultSecret(ctx context.Context, t *testing.T, akvContainer *AzureKeyVaultContainer, secretName string, secretData map[string]interface{})

SetupAzureKeyVaultSecret creates a secret in Azure Key Vault emulator

func SetupContainers

func SetupContainers(ctx context.Context, t *testing.T) (*LocalStackContainer, *VaultContainer)

SetupContainers sets up both LocalStack and Vault containers

func SetupVaultSecret

func SetupVaultSecret(ctx context.Context, t *testing.T, vaultContainer *VaultContainer, vaultPath string, secretData map[string]interface{})

SetupVaultSecret enables KV v2 engine (if needed) and writes a secret to Vault

func VerifyGCSMSecretExists

func VerifyGCSMSecretExists(ctx context.Context, t *testing.T, gcsmContainer *GCSMContainer, projectID, secretID string)

VerifyGCSMSecretExists checks if a secret exists in Google Cloud Secret Manager This is used to verify that predefined secrets are available for testing

Types

type AzureKeyVaultContainer

type AzureKeyVaultContainer struct {
	Container testcontainers.Container
	VaultURL  string
	Client    *azsecrets.Client
	Cleanup   func() error
}

AzureKeyVaultContainer wraps Azure Key Vault emulator container and client

func SetupAzureKeyVault

func SetupAzureKeyVault(ctx context.Context, t *testing.T) *AzureKeyVaultContainer

SetupAzureKeyVault starts a Lowkey Vault container Lowkey Vault is a test double for Azure Key Vault that's compatible with Azure Key Vault REST APIs Lowkey Vault is chosen over james-gould emulator because it doesn't require pre-generated SSL certificates, making it much simpler to use in automated test environments

type GCSMContainer

type GCSMContainer struct {
	Container testcontainers.Container // nil for real API
	Endpoint  string                   // empty for real API
	Client    *secretmanager.Client
	ProjectID string // GCP project ID for real API
	Cleanup   func() error
}

GCSMContainer wraps GCSM client for real API testing

func SetupGCSM

func SetupGCSM(ctx context.Context, t *testing.T) *GCSMContainer

SetupGCSM creates a client for real Google Cloud Secret Manager API Requires GOOGLE_APPLICATION_CREDENTIALS or gcloud auth to be configured

type LocalStackContainer

type LocalStackContainer struct {
	Container *localstack.LocalStackContainer
	Endpoint  string
	Cleanup   func() error
}

LocalStackContainer wraps LocalStack container and its endpoint

func SetupLocalStack

func SetupLocalStack(ctx context.Context, t *testing.T) *LocalStackContainer

SetupLocalStack starts a LocalStack container and returns the container info

type VaultContainer

type VaultContainer struct {
	Container *vault.VaultContainer
	Address   string
	Client    *api.Client
	Cleanup   func() error
}

VaultContainer wraps Vault container, address, and client

func SetupVault

func SetupVault(ctx context.Context, t *testing.T) *VaultContainer

SetupVault starts a Vault container and returns the container info

Jump to

Keyboard shortcuts

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