Repository navigation
fix(auth): remove the anonymous rollback path and legacy compatibility fields - #97
Merged
Merged
Conversation
…y fields Phase 6 is deployed and every caller uses IdP tokens, so the leftovers kept for rollback and for older clients go: - LEGACY_ANONYMOUS and the anonymous path: a request without a token is always refused, handlers always get the token's actor, and policy() loses its tokenOnly option. The e-signing development user that only worked on the anonymous path goes too. - Grant compatibility fields: key, source and grantedBy (always idp:<id>, "idp" and null). - tg_audit_log.admin_id (migration 0029). Rows that still have only admin_id get it copied into actor_tg_id first, so no author is lost. - adminId and performerId in the socket events to the bot, which reads only actor and performer. A router test now checks that every procedure refuses a call without a token.
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars.
|
This was referenced Oct 26, 2026
toto04
approved these changes
Oct 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Final cleanup after RFC v3 Phase 6 (#93). Every caller now uses IdP tokens, so what was kept for rollback and for older clients goes.
LEGACY_ANONYMOUSis removed. A request without a token is always refused (UNAUTHORIZED), and handlers always receive the token's actor.policy()loses itstokenOnlyoption, which is now the only behaviour.agent-preview-user), which only worked on the anonymous path, goes too.key,sourceandgrantedBy(alwaysidp:<id>,"idp"andnull) are removed from grant lists and fromtg.grants.checkUser. No consumer reads them (checked admin and telegrammain).tg_audit_log.admin_id(migration0029): before the drop, any row that still has onlyadmin_idgets it copied intoactor_tg_id, so no author is lost.tg.auditLog.getByIdjoins the actor onactor_tg_idonly.adminIdandperformerIdare removed. The bot reads onlyactorandperformersince telegram#158.Not marked as breaking on purpose: every consumer already stopped using these. It releases a patch.
Order
audit.adminId; the admin PR linked below removes it.LEGACY_ANONYMOUSenv var; it can go before or after.0029drops a column. A backup before merging is still a good idea.Verification
bun run typecheck,bunx biome ci,bun run build,bun run build:npm: OK.bun run testwith the Postgres integration suites: 295 passed, 1 skipped.main: a row with onlyadmin_idkeeps its author inactor_tg_id, and the column and its index are gone.drizzle-kit generatethen reports no schema changes.