Skip to content

feat(team_vault_folder): add archestra_team_vault_folder resource (EE) - #102

Open
priyanshu0x wants to merge 1 commit into
archestra-ai:mainfrom
priyanshu0x:feat/archestra-team-vault-folder
Open

priyanshu0x wants to merge 1 commit into
archestra-ai:mainfrom
priyanshu0x:feat/archestra-team-vault-folder

Conversation

@priyanshu0x

Copy link
Copy Markdown
Contributor

Closes #101.

Summary

  • Adds archestra_team_vault_folder (CRUD + Import) mapping to the EE per-team Vault folder endpoints (POST/GET/DELETE /api/teams/:teamId/vault-folder). Each team can mount exactly one Vault KV folder; team members gain read access to secrets under that path in BYOS mode.
  • Un-excludes the Vault OpenAPI tag in oapi-config.yaml and regenerates internal/client/archestra_client.go.
  • Updates the bring-up-order + BYOS-vault guides and the complete example module.

Design notes

  • The backend's SetTeamVaultFolder is an idempotent upsert on (teamId, vaultPath), so Create and Update share one setFolder helper. team_id is RequiresReplace because the one-to-one relationship is keyed on team.
  • vault_path ships a plan-time format validator (vaultPathFormatValidator) that mirrors the backend's rejections (.., leading /, trailing /). The backend returns 400 Invalid Vault path otherwise; the validator surfaces the failure before any apply round-trip.
  • Test setup gates on both testAccRequireEnterprise and testAccRequireByosEnabled. The backend's assertByosEnabled() returns 403 Readonly Vault is not enabled when BYOS isn't active, so an EE-only stack would 403-fail mysteriously without the second gate.
  • ImportState uses the bare team_id; Read populates the rest.

Adds `archestra_team_vault_folder` mapping to the EE per-team Vault
folder endpoints (`POST/GET/DELETE /api/teams/:teamId/vault-folder`).
Each team can mount exactly one Vault folder; secrets stored under
that path become readable by team members in BYOS mode.

Design notes:
- The backend's `SetTeamVaultFolder` is an idempotent upsert on
  (teamId, vaultPath), so Create and Update share one `setFolder`
  helper. `team_id` is `RequiresReplace` since the one-to-one
  relationship is keyed on team.
- `vault_path` ships a plan-time format validator that mirrors the
  backend's checks (rejects `..`, leading `/`, trailing `/`) — the
  backend returns 400 with "Invalid Vault path" otherwise. The
  validator surfaces the failure before any apply round-trip.
- Test setup gates on both `testAccRequireEnterprise` and
  `testAccRequireByosEnabled` — the backend's `assertByosEnabled()`
  returns 403 "Readonly Vault is not enabled" when BYOS isn't
  active, so an EE-only stack would 403-fail mysteriously without
  the second gate.
- ImportState uses the bare `team_id` (the resource is 1:1-keyed on
  team), and Read populates the rest.

Acceptance coverage:
- Happy-path Create + Read + Update + Import with idempotent re-apply.
- Plan-time validator sub-tests for each of the three rejected
  path shapes.
- Read-404 recovery test (out-of-band delete → next refresh drops →
  plan recreates).

Un-excludes the `Vault` OpenAPI tag in `oapi-config.yaml` and
regenerates the client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add archestra_team_vault_folder resource (Enterprise Edition)

1 participant