64d9b89dcd
Mints ephemeral, scoped ghp access tokens via ghp's admin token API
(POST /api/tokens), bound to a Vault lease and revoked on lease
expiry (DELETE /api/tokens/{id}).
- config: base_url + write-only admin_token (ghpsvc_ service token),
TLS settings; verifies the token is a ghp admin on write. No
rotate-root: the service token is static and operator-managed.
- roles: token_type (agent/proxy), installation_id, app_record_id,
repositories, scopes (permission:level), session_prefix, ttl/max_ttl.
- creds: mint a lease-bound token; ghp-side duration bounded by the
lease ceiling as defence in depth.
- secret ghp_token: idempotent revoke + lease renew.
- Unit tests (config/role/creds/client/scopes/revocation), mock-ghp
e2e on Vault + OpenBao, Woodpecker pre-commit/build/test/release,
Makefile patch/minor/major, nfpm RPM packaging.
64 lines
1.8 KiB
YAML
64 lines
1.8 KiB
YAML
# End-to-end test stack. A mock ghp admin API (in-memory, no db/GitHub) plus two
|
|
# secrets-engine hosts running the exact same plugin binary: HashiCorp Vault and
|
|
# OpenBao. Bind mounts use ":z" so they work under SELinux.
|
|
services:
|
|
ghp:
|
|
image: golang:1.25-alpine
|
|
working_dir: /src
|
|
environment:
|
|
MOCKGHP_ADDR: ":3000"
|
|
MOCKGHP_ADMIN_TOKEN: "ghpsvc_seed"
|
|
GOFLAGS: "-mod=mod"
|
|
command: ["go", "run", "./test/mockghp"]
|
|
volumes:
|
|
- ..:/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:
|
|
- ../dist:/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
|
|
|
|
openbao:
|
|
image: openbao/openbao:latest
|
|
depends_on:
|
|
ghp:
|
|
condition: service_healthy
|
|
cap_add: [IPC_LOCK]
|
|
environment:
|
|
BAO_DEV_ROOT_TOKEN_ID: root
|
|
BAO_ADDR: http://127.0.0.1:8200
|
|
BAO_TOKEN: root
|
|
command: ["server", "-dev", "-dev-listen-address=0.0.0.0:8200", "-config=/openbao/bao.hcl"]
|
|
volumes:
|
|
- ../dist:/openbao/plugins:ro,z
|
|
- ./openbao/bao.hcl:/openbao/bao.hcl:ro,z
|
|
ports: ["8300:8200"]
|
|
healthcheck:
|
|
test: ["CMD", "bao", "status", "-address=http://127.0.0.1:8200"]
|
|
interval: 3s
|
|
timeout: 3s
|
|
retries: 20
|