feat(backup): wire the real Mokosh backup/restore client (BUNYIP-356) #357
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/BUNYIP-356-mokosh-backup-adapter"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Replaces the pending
MokoshBackupAdapterstub (BUNYIP-353) with a real HTTP client that calls mokosh-server's tenant data API, so an account backup captures - and restores - the account's Mokosh PSA data instead of recording Mokosh as "unavailable" (BUNYIP-356).How it works
at+jwtfor the acting admin viaOidcProvider::mint_access_token, sourcing the audience + TTL from the seeded mokosh-apps OAuth client, and uses it as the server-to-server bearer.backup->GET /api/v1/data/export, returns the envelope.restore->POST /api/v1/data/importwithconfirm= thetenant_namethe envelope now carries (mokosh-server PMS-647, PR #443) plus the export payload.bunyip-api, notbunyip-domain: it depends onbunyip-oidc, and the dependency direction forbids the domain crate from depending on oidc.main.rsregisters the real adapter only whenMOKOSH_BACKUP_API_URLis set and the OIDC provider + mokosh-apps client are present; otherwise it falls back to the domain's pending stub. No change for deployments that don't set the URL.Tests
wiremock unit tests cover the HTTP mapping and the confirm extraction: export 2xx ->
Produced, non-2xx ->Unavailable; import postsconfirm+ envelope and reads success / returns false on non-2xx; a bundle missingtenant_nameerrors before any token is minted.just check-containergreen (fmt + clippy-D warnings+ full suite: bunyip-api 69 passed, domain 271, web 94). Full end-to-end (real minted token against a live Mokosh) is exercised in thedev-ssostack.Caveats / sequencing
tenant_nameto the export envelope) for the restoreconfirm.MOKOSH_BACKUP_API_URLto Mokosh's internal service URL to enable (documented in.env.example).🤖 Generated with Claude Code