Gcp Sm
Read, write, and delete secrets stored in Google Cloud Secret Manager, with
support for vault annotations (swamp vault annotate / swamp vault inspect).
Emits OpenTelemetry spans for vault operations so failures and latency are
attributable in traces when a TracerProvider is configured.
Deletion is immediate and irreversible — GCP Secret Manager has no recovery window. The secret and all its versions are permanently removed.
Authentication
Uses the standard GCP credential chain via the gcloud CLI — no credentials in config. Provide credentials via one of:
- Environment variable:
GCP_ACCESS_TOKEN(pre-obtained OAuth2 token) - Inline JSON:
GOOGLE_APPLICATION_CREDENTIALS_JSON - File path:
GOOGLE_APPLICATION_CREDENTIALS - Application Default Credentials:
gcloud auth application-default login
Required IAM Permissions
secretmanager.secrets.createsecretmanager.secrets.getsecretmanager.secrets.listsecretmanager.secrets.updatesecretmanager.secrets.deletesecretmanager.versions.addsecretmanager.versions.access
Annotations
Annotations map to native GCP Secret Manager primitives:
- notes → secret
annotationsfield (swamp-noteskey) - url → secret
annotationsfield (swamp-urlkey) - labels → secret
labelsfield (swamp-prefixed keys)
swamp vault annotate my-gcp-sm API_KEY \
--url https://console.cloud.google.com/security/secret-manager \
--note "Production API key" \
--label env=prod --label team=infra
swamp vault inspect my-gcp-sm API_KEY --jsonUsage
swamp vault create @swamp/gcp-sm my-gcp-sm \
--config '{"project_id": "my-project"}' --json
swamp vault read-secret my-gcp-sm my-secret --json
swamp vault put my-gcp-sm my-secret "s3cr3t" --json
swamp vault delete my-gcp-sm my-secret --json
swamp vault list-keys my-gcp-sm --jsonEmulator Support
For local development and testing, set api_endpoint to point at a GCP
Secret Manager emulator (e.g. floci-gcp). Authentication is skipped when
a custom endpoint is configured.
swamp vault create @swamp/gcp-sm my-local-sm \
--config '{"project_id": "floci-local", "api_endpoint": "http://localhost:4588"}' --jsonSecret Key Format
Secret keys are mapped to GCP secret IDs. Slashes in key names are replaced
with hyphens (/ → -) since GCP secret IDs only allow [a-zA-Z0-9_-].
Google Cloud Secret Manager vault provider. Uses Application Default Credentials (ADC) for authentication.
Config Fields
| Field | Type | Description |
|---|---|---|
| project_id? | string | GCP project ID (falls back to GOOGLE_CLOUD_PROJECT env var or ADC default) |
| secret_prefix? | string | Prefix to namespace secrets within the project |
| api_endpoint? | string | Custom API endpoint for emulators (e.g. http://localhost:4588 for floci-gcp) |
- Has README or module doc2/2earned
- README has a code example1/1earned
- README is substantive1/1earned
- Most symbols documented1/1earned
- No slow types (deprecated)1/1earned
- Dependencies pass trust audit2/2earned
- Has description1/1earned
- Platform support declared (or universal)2/2earned
- License declared1/1earned
- Verified public repository2/2earned