6 Commits

Author SHA1 Message Date
benvin 97c3d7fdeb Merge pull request 'Return status.bearerToken from minted tokens (fix 401s)' (#2) from benvin/fix-bearer-token into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #2
v0.1.1
2026-07-18 16:31:05 +10:00
Ben Vincent 22c036d930 Return status.bearerToken, not status.value, from minted tokens
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/test Pipeline was successful
ci/woodpecker/pr/pre-commit Pipeline was successful
ext.cattle.io token creation returns TWO fields: status.value (just the secret
fragment) and status.bearerToken (the full usable credential, formatted
ext/<name>:<secret>). The plugin was returning status.value, so every minted
credential and every rotated root token was non-functional (401 against
Rancher). Verified: bearerToken authenticates (HTTP 200), value alone does not.

- client.go: MintToken returns status.bearerToken, falling back to status.value
  only if a Rancher build omits it.
- Reflect bearerToken in the mock Rancher and unit-test fake; assert the minted
  token is the ext/ bearer form.
2026-07-18 16:27:05 +10:00
benvin 67989d9768 Merge pull request 'Initial Rancher token secrets engine' (#1) from benvin/plugin-scaffold into main
ci/woodpecker/tag/release Pipeline was successful
Reviewed-on: #1
v0.1.0
2026-07-16 22:18:19 +10:00
unkinben f45b549a9e Merge auto-initialized main 2026-07-16 00:01:31 +10:00
gitadmin 7e280f83e8 Initial commit 2026-07-15 23:59:12 +10:00
Ben Vincent c46641dafb Initial vault-plugin-secrets-rancher scaffold
Vault/OpenBao secrets engine managing Rancher API tokens via the public
tokens.ext.cattle.io API.

- config: Rancher connection (URL + TLS)
- service-accounts/<name>: seeded root tokens, auto-rotated before Rancher's
  TTL cap via a PeriodicFunc (default 45d rotation, 90d token TTL); the current
  token mints its own replacement. Manual /rotate endpoint too.
- roles/<name>: mint policy referencing a service account; cluster_name + TTL
  scoping (Rancher tokens inherit the seeding user's RBAC).
- creds/<role>: dynamic, lease-bound tokens deleted from Rancher on revoke.

Ports the bind-tsig Woodpecker RPM release, nfpm packaging, and a mock-Rancher
e2e (Vault + OpenBao). Unit tests cover the full lifecycle.
2026-07-15 22:11:31 +10:00