Skip to content

feat(vault): extract shared AppRole env helper module - #281

Merged
patrick-hermann-sva merged 1 commit into
mainfrom
feat/vault-approle-helper
May 28, 2026
Merged

feat(vault): extract shared AppRole env helper module#281
patrick-hermann-sva merged 1 commit into
mainfrom
feat/vault-approle-helper

Conversation

@patrick-hermann-sva

Copy link
Copy Markdown
Contributor

Summary

  • Adds a thin vault/ Dagger module exposing WithAppRoleEnv(ctr, roleID?, secretID?, addr?) that attaches VAULT_ROLE_ID, VAULT_SECRET_ID, VAULT_ADDR as masked secrets on a container.
  • Wires it as a Dagger dependency in ansible/dagger.json + helm/dagger.json and replaces the duplicated three-if env blocks in ansible/execute.go and helm/helmfile.go with a single dag.Vault().WithAppRoleEnv(...) call.
  • Re-pins dagger.io/dagger v0.20.8 in vault/, ansible/, helm/ go.mod — dagger develop had regressed all three to the v0.20.6-0.20260415192040-7058e9313c72 pseudo-version (same scaffold bug fixed for six modules in feat: align all modules to dagger engine + sdk v0.20.8 #264).

The helper does no Vault login — it's plumbing for downstream tools (vals, ansible playbooks) that read those envs. Designed as a home for future Vault helpers (e.g. vals get, KV2 fetch, token renewal).

Refs #262 — P3 "Extract shared Vault AppRole helper".

Why a separate module

Cross-module Go imports are awkward inside Dagger; the established pattern for sharing across modules is a thin Dagger module declared as a dependency (precedent: argocd → helm). Consumers get a typed dag.Vault() binding through generated code.

Test plan

  • go build ./... clean in vault/, ansible/, helm/
  • go vet ./... clean in vault/, ansible/, helm/ (one pre-existing fmt.Println %v warning in ansible/pipeline.go is on main, unrelated)
  • dagger functions -m ./vault lists with-app-role-env
  • dagger functions -m ./ansible and -m ./helm still list their full function set — no schema regression
  • End-to-end run of task test-ansible / task test-helm against a live Vault — requires creds, recommend running before merge

🤖 Generated with Claude Code

Adds a thin `vault/` Dagger module exposing `WithAppRoleEnv(ctr,
roleID?, secretID?, addr?)` that attaches VAULT_ROLE_ID,
VAULT_SECRET_ID, VAULT_ADDR as masked secrets on a container. The
helper does no Vault login itself — it's plumbing for downstream
tools (vals, ansible playbooks) that read those envs.

Wires the new module as a Dagger dependency in `ansible/dagger.json`
and `helm/dagger.json`, then replaces the duplicated three-`if` env
blocks in `ansible/execute.go` and `helm/helmfile.go` with a single
`dag.Vault().WithAppRoleEnv(...)` call.

Also re-pins `dagger.io/dagger` to v0.20.8 in vault/, ansible/ and
helm/ go.mod — `dagger develop` had regressed all three to the
pseudo-version `v0.20.6-0.20260415192040-7058e9313c72` (same bug
fixed for six modules in #264).

Refs #262 (P3 — extract shared Vault AppRole helper).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@patrick-hermann-sva
patrick-hermann-sva merged commit 8f38d23 into main May 28, 2026
5 checks passed
@patrick-hermann-sva
patrick-hermann-sva deleted the feat/vault-approle-helper branch May 28, 2026 06:56
patrick-hermann-sva pushed a commit that referenced this pull request May 28, 2026
# [0.115.0](v0.114.0...v0.115.0) (2026-05-28)

### Features

* **ci:** add .golangci.yml and wire into per-module CI ([#274](#274)) ([bda97c9](bda97c9)), closes [#262](#262) [#262](#262)
* **ci:** add per-module PR test workflow ([#273](#273)) ([dd58cae](dd58cae)), closes [#262](#262)
* **crossplane:** add Verify for offline Configuration checks ([#278](#278)) ([210c6e0](210c6e0)), closes [#277](#277)
* feat/add-update-vault-module ([ac9631e](ac9631e))
* **vault:** extract shared AppRole env helper module ([#281](#281)) ([8f38d23](8f38d23)), closes [#264](#264) [#262](#262)
@patrick-hermann-sva

Copy link
Copy Markdown
Contributor Author

🎉 This PR is included in version 0.115.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant