Repository navigation
Conversation
Contributor
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configuration
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…3 Phase 6) Roles, group admins and Telegram links live in the IdP since Phase 5, so the backend's own login and the tables behind it go: - better-auth (email OTP, passkeys, Telegram link plugin), its /api/auth routes and CORS, the OTP email, and the BETTER_AUTH_SECRET, PUBLIC_URL and TRUSTED_ORIGINS settings - tg_permissions, tg_group_admins, tg_link and auth_* (migration 0027) - the legacy tg_grants table, not migrated (decision 6); tg_grants_v2 takes its name - the AUTH_PATH, USER_ROLE and TelegramPlugin exports - the idp:export / idp:reconcile migration tooling and seed:user The author columns that referenced tg_permissions keep the old Telegram IDs as legacy_created_by_tg_id / legacy_modified_by_tg_id, without the foreign keys (§9.4). Freshman writes no longer accept `modifiedBy`. Grants still return `key`, `source` and `grantedBy`, now constant, so dashboards built against SDK v2 keep working. BREAKING CHANGE: the SDK no longer exports AUTH_PATH, USER_ROLE and TelegramPlugin, the backend serves no /api/auth, and migration 0027 drops the legacy tables on startup. Back them up before deploying.
BIA3IA
force-pushed
the
feat/idp-phase6-cleanup
branch
from
October 22, 2026 15:33
7c08df1 to
f624a24
Compare
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
RFC v3 Phase 6 (§9.3, §9.4, §13) for the backend. Since Phase 5, roles, group admins and Telegram links live in the IdP, so this PR removes the backend's own login and the tables behind it.
Removed
/api/auth/*routes and their CORS, the OTP email template, and thebetter-auth/@better-auth/*dependencies.BETTER_AUTH_SECRET,PUBLIC_URLandTRUSTED_ORIGINS. They are no longer read, so leaving them set is harmless.0027_idp_phase6_cleanup):tg_permissions,tg_group_admins,tg_linkandauth_*.tg_grants: not migrated (§4 decision 6).tg_grants_v2is renamed totg_grants, together with its sequence, index and constraints.AUTH_PATH,USER_ROLEandTelegramPlugin. No consumer imports them (I checked telegram, admin and web).idp:export/idp:reconcile(they readtg_permissions) andseed:user(better-auth). Also thetg_linkcleanup cron.Changed
tg_permissions(web_*andcommon_group_labels) becomelegacy_created_by_tg_id/legacy_modified_by_tg_id.*_creator_checkconstraints now requirelegacy_created_by_tg_idorcreated_by_sub.*_by_sub. A modification clears the legacy modifier.modifiedBy. The admin dashboard never sent it.key,sourceandgrantedBystay in the output, now alwaysidp:<id>,"idp"andnull, and marked@deprecated. Today's admin uses them, so it keeps working at runtime until it updates the SDK.Merging is deploying. Docker CI pushes
backend:latestand Flux deploys its new digest by itself (polinetwork-cd/clusters/k3s/apps/backend.yaml). Migrations run when the backend starts (src/db/db.ts), so the first pod running this image deletes the tables, a few minutes after the merge. Rolling back the image does not bring them back, and the previous image no longer works once the migration has run.dbpgroute):Rollback: restore the dump and redeploy the previous image.
Order
[DB] Migration completed).BETTER_AUTH_SECRET.Release
This is a breaking change for the SDK (exports removed), so it should release 3.0.0.
!in the title is enough.BREAKING CHANGE:footer with the colon. It is already in this branch's commit body.Verification
bun run typecheck,bun run biome ci .,bun run buildandbun run build:npm: OK.bun run testwith the Postgres integration suites enabled (SEED_TEST_DB_PORT,FRESHMAN_TEST_DB_PORT): 249 passed, 1 skipped (after rebasing onto feat(azure): let the dashboard change member numbers and choose the new address #70).main(8tg_permissions, 12tg_group_admins, 1 legacy grant, 11tg_grants_v2, legacy-authored labels and web content, a better-auth user with atg_link).tg_grantsand inserts continue from the sequence;legacy_*_tg_id;drizzle-kit generatereports "No schema changes".Not in this PR
tg_audit_log.admin_id: the bot still reads it until it updates the SDK.tg_test/web_test:tg_testis the startup DB check.