Skip to content

Fix grouped database token invalidation - #1069

Merged
pedrocarlo merged 3 commits into
mainfrom
fix/grouped-db-token-invalidation
Sep 28, 2026
Merged

pedrocarlo merged 3 commits into
mainfrom
fix/grouped-db-token-invalidation

Conversation

@pedrocarlo

@pedrocarlo pedrocarlo commented Sep 28, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Route turso db tokens invalidate <database> to the database-scoped rotation endpoint for grouped as well as ungrouped databases, rather than refusing grouped databases or substituting group rotation.
  • Correct the database confirmation: database-scoped tokens need replacement; group tokens are unaffected. Do not claim replica restarts or downtime.
  • Clarify turso group tokens invalidate help, confirmation, and success output: this invalidates group tokens but not necessarily database-scoped tokens. To revoke the latter, run turso db tokens invalidate <database-name> for each database. Avoid claiming all database connections drop or that downtime occurs.
  • Add command-level and endpoint tests for grouped databases and the legacy dedicated-cluster error.

Testing

  • go test ./... -count=1
  • git diff --check

Caveat

Legacy dedicated grouped clusters reject individual database credential rotation (HTTP 400). The CLI propagates that error without silently rotating group credentials. Their group rotation can affect database tokens through a shared cluster key, which is why the guidance says "not necessarily".

Related: #1064 touches the same command with a server-type gate; this PR uses the database endpoint as the source of support instead.

Amp thread: https://ampcode.com/threads/T-01a0e943-2130-70ed-8b52-4fb27500934a

Amp-Thread-ID: https://ampcode.com/threads/T-01a0e943-2130-70ed-8b52-4fb27500934a
Co-authored-by: pedro muniz <pedro.muniz.carlo@gmail.com>
ampagent and others added 2 commits September 28, 2026 21:41
Amp-Thread-ID: https://ampcode.com/threads/T-01a0e943-2130-70ed-8b52-4fb27500934a
Co-authored-by: pedro muniz <pedro.muniz.carlo@gmail.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a0e943-2130-70ed-8b52-4fb27500934a
Co-authored-by: pedro muniz <pedro.muniz.carlo@gmail.com>
@pedrocarlo
pedrocarlo merged commit 9212f7b into main Sep 28, 2026
1 check passed
@pedrocarlo
pedrocarlo deleted the fix/grouped-db-token-invalidation branch September 28, 2026 22:08
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.

3 participants