Files
terraform-provider-vault-se…/test/docker-compose.yml
T
unkin-agent 986aecd28f Scaffold the ghp Vault secrets engine provider
Model the provider on terraform-provider-giteavaultsecret, adjusting the
schemas to the ghp engine (vault-plugin-secrets-ghp) so its mount, config,
and roles can be managed declaratively.

- Add provider (local name ghpvaultsecret, source
  git.unkin.net/unkin/ghpvaultsecret) with VAULT_ADDR/VAULT_TOKEN fallback.
- Add ghpvaultsecret_secret_backend: mounts the engine and writes config
  (base_url, write-only admin_token, write-only ca_cert, tls_skip_verify,
  request_timeout_seconds); read never returns the sensitive fields.
- Add ghpvaultsecret_secret_role: token_type, installation_id, app_record_id,
  repositories, scopes, session_prefix, ttl, max_ttl; validate that agent
  roles set installation_id.
- Add unit tests for the value conversions and the role/backend field mapping.
- Mirror the woodpecker pre-commit/build/test (PR) and tag release (package +
  PUT zip to the artifactapi terraform registry) pipelines, Makefile version
  bump/package targets, examples, README, and a Docker e2e harness.
2026-08-15 19:25:17 +10:00

48 lines
1.5 KiB
YAML

# E2E stack for the provider: a mock ghp REST API (run from the sibling plugin
# repo) + a Vault dev server with the ghp plugin mounted. Bind mounts use ":z"
# for SELinux (Fedora/RHEL). MOCKGHP_ADMIN_TOKEN is an ephemeral test fixture,
# not a real credential.
services:
ghp:
image: golang:1.25-alpine
working_dir: /src
environment:
MOCKGHP_ADDR: ":3000"
MOCKGHP_ADMIN_TOKEN: "ghpsvc_e2e_fixture"
GOFLAGS: "-mod=mod"
# PLUGIN_SRC is the sibling vault-plugin-secrets-ghp checkout, which ships
# the mock ghp server under test/mockghp.
command: ["go", "run", "./test/mockghp"]
volumes:
- ${PLUGIN_SRC:-../vault-plugin-secrets-ghp}:/src:ro,z
ports:
- "3000:3000"
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/healthz"]
interval: 3s
timeout: 3s
retries: 40
vault:
image: hashicorp/vault:1.18
depends_on:
ghp:
condition: service_healthy
cap_add:
- IPC_LOCK
environment:
VAULT_DEV_ROOT_TOKEN_ID: root
VAULT_ADDR: http://127.0.0.1:8200
VAULT_TOKEN: root
command: ["server", "-dev", "-dev-listen-address=0.0.0.0:8200", "-config=/vault/vault.hcl"]
volumes:
- ./plugins:/vault/plugins:ro,z
- ./vault/vault.hcl:/vault/vault.hcl:ro,z
ports:
- "8200:8200"
healthcheck:
test: ["CMD", "vault", "status", "-address=http://127.0.0.1:8200"]
interval: 3s
timeout: 3s
retries: 20