Buckets a product manages
Buckets a platform product creates for you, and how they are torn down when nobody is there.
A platform product acting for a person (with a delegated token from Xeonr
Auth) may create buckets in that person's team as part of its own setup. Such a
bucket records the product that made it in managed_by (its slug, for
example hacloud); a bucket a person or an integration made directly has an
empty managed_by. The field is read-only.
Tear-down
When the team loses the product, or the product is reconciling and nobody is
present to act for, it calls TeardownManagedBuckets as its own service
account with the team's Xeonr Auth URN:
curl -H "Authorization: Bearer $SERVICE_ACCOUNT_TOKEN" \
-H 'Content-Type: application/json' \
-d '{"team":"urn:xeonr:auth:team:acme"}' \
https://uploads-api.xeonr.io/uplim.api.v1.BucketsService/TeardownManagedBuckets- Only buckets whose
managed_byis the calling product's are deleted; anything else in the team is invisible to the call. - Access keys whose every grant was on a deleted bucket are revoked. A key that also holds grants elsewhere keeps those and loses only the deleted bucket's grant, so it never widens to "no grants".
- The answer counts
buckets_deletedandcredentials_revoked; a team with nothing left answers zeros, so the call is safe to repeat.
The method needs upl:managed:reconcile on a service-account token: the scope
is service-account-only at Xeonr Auth and never delegatable, so no person's
token can call it.