Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractSecretObject ¶
func ExtractSecretObject(v *secretsmanager.GetSecretValueOutput, secret any) error
ExtractSecretObject deserializes secret value to a Go object of the secret type.
Types ¶
type Config ¶
type Config struct {
// SecretsmanagerClient the client's instance to communicate with the secretsmanager.
SecretsmanagerClient SecretsmanagerClient
// ServiceClient the client's instance to communicate with the service delegated credentials storage.
ServiceClient ServiceClient
// SecretObj defines the interface of the secret to rotate.
SecretObj any
// Debug set to `true` to activate debug level logs.
Debug bool
}
Config defines the rotation lambda's configuration.
type SecretsmanagerClient ¶
type SecretsmanagerClient interface {
GetSecretValue(
ctx context.Context, input *secretsmanager.GetSecretValueInput, optFns ...func(*secretsmanager.Options),
) (*secretsmanager.GetSecretValueOutput, error)
PutSecretValue(
ctx context.Context, input *secretsmanager.PutSecretValueInput, optFns ...func(*secretsmanager.Options),
) (*secretsmanager.PutSecretValueOutput, error)
DescribeSecret(
ctx context.Context, input *secretsmanager.DescribeSecretInput, optFns ...func(*secretsmanager.Options),
) (
*secretsmanager.DescribeSecretOutput, error,
)
UpdateSecretVersionStage(
ctx context.Context, input *secretsmanager.UpdateSecretVersionStageInput,
optFns ...func(*secretsmanager.Options),
) (*secretsmanager.UpdateSecretVersionStageOutput, error)
}
SecretsmanagerClient client to communicate with the secretsmanager.
type ServiceClient ¶
type ServiceClient interface {
// Create generates the secret and mutates the `secret` value.
Create(ctx context.Context, secret any) error
// Set sets newly generated credentials in the system delegated credentials storage.
Set(ctx context.Context, secretCurrent, secretPending, secretPrevious any) error
// Test tries to connect to the system delegated credentials storage using newly generated secret.
Test(ctx context.Context, secret any) error
}
ServiceClient defines the interface to communicate with the service (e.g. database) to rotate the access credentials.
Click to show internal directories.
Click to hide internal directories.