Files
cozystack/packages/system/backupstrategy-controller/tests
Andrei Kvapil d2bd291a10 feat(bucket)!: issue tenant user keys through platform credentials
Tenants read every user's S3 keys in plain text from the per-user
credentials Secret, and the only way to rotate them was to delete the
BucketAccess and force two Helm upgrades. The chart now renders a
CredentialTemplate per tenant user that names the BucketAccess, in the
plaintext format, instead of rendering the BucketAccess itself, so
cozystack-controller owns the grant, a mint re-creates it and a revoke
deletes it; the keys are shown once, by the mint. The per-user Secret of
a tenant user keeps only the endpoint and bucket name. It is rendered as
data rather than stringData: Helm's three-way merge removes a live key
only when the previous manifest named it, and a stringData key never
shows up in data, so a key the chart stops emitting would otherwise
stay.

A tenant user's BucketAccess keeps the name the chart gave it, which
the conversion hands over by name; a user name that is not a valid
object name never had one and takes the account name instead. A user
whose account name is longer than 63 characters is refused at render,
as credentials-migrate refuses it.

A user marked platform, which backupstrategy-controller now sets on the
backup bucket's system user, keeps its chart-rendered BucketAccess and
its keys in a Secret no tenant role selects or grants, so default
backups keep reading it; its keys are never minted. Clearing the flag
drops that BucketAccess, which revokes those keys, and the user becomes
a normal account whose keys are minted. values.yaml documents both.

BREAKING CHANGE: clients that read accessKey and secretKey from
<bucket>-<user>-credentials must mint the user's credential instead;
every mint rotates both keys.

Assisted-by: LLM
Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
2026-12-02 20:38:26 +01:00
..