Repository navigation
refactor(telegram)!: remove legacy commands and anonymous backend access - #157
Conversation
…ecisions Completes RFC v3 Phase 4b step 4 and prepares the bot for Phase 5 (LEGACY_ANONYMOUS=deny). - Remove /addrole, /delrole, /link and /test_db. - Drop overrideGroupAdminCheck: per RFC §4 decision 5, tg_group_admins is replaced by the native Telegram admin shortcut (decision 2). - Remove the shadow/anonymous decision modes, IDP_DECISIONS and legacyBackend; every check applies the IdP decision. - The socket always authenticates with its token. BREAKING CHANGE: IDP_PUBLIC_URL, OAUTH_BACKEND_RESOURCE_URI, OAUTH_BOT_CLIENT_ID and OAUTH_BOT_PRIVATE_JWK are required; IDP_DECISIONS is removed. Deploy before setting backend LEGACY_ANONYMOUS=deny.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughThe bot now requires IdP configuration and uses authenticated backend access. Commands, middleware, and operational flows use IdP permissions instead of legacy role checks. The ChangesIdP Authorization Cutover
Sequence Diagram(s)sequenceDiagram
participant Command
participant authorizeAction
participant Backend
participant idpDecision
Command->>authorizeAction: actor, chat, and required permissions
authorizeAction->>Backend: resolve actor access
Backend-->>authorizeAction: access entry
authorizeAction->>idpDecision: access entry, permissions, and chat-admin status
idpDecision-->>authorizeAction: allowed or denied decision
authorizeAction-->>Command: authorization result
Priority: ➖ Normal Change: Other Merge Risk: ⚪ Minimal · up to
|
Completes RFC v3 Phase 4b step 4 and prepares the bot for Phase 5 (
LEGACY_ANONYMOUS=deny)./addrole,/delrole,/linkand/test_db.overrideGroupAdminCheck: per RFC §4 decision 5,tg_group_adminsis replaced by the native Telegram admin shortcut (decision 2), whichallowTelegramChatAdminsalready provides.IDP_DECISIONSandlegacyBackend. The IdP variables are now required and every check applies the IdP decision; an unavailable decision denies./audit,tg.auditLog.createand thetest.dbQueryhealth check. The socket always authenticates with its token.Roletype and the dead role declarations on commands.The bot no longer calls
tg.permissions.*,tg.link.*,tg.groupLabels.*,auth.*,test.*ortg.auditLog.create, and sends no actor fields in requests. Older audit rows and socket payloads are still read withadminId/performerIduntil the v2 SDK.Deploy
Works with the current backend (token sockets and
tg.access.resolveare already accepted). Deploy before the backend switches toLEGACY_ANONYMOUS=deny; rolling back to an older bot image needsLEGACY_ANONYMOUS=allow.BREAKING CHANGE:
IDP_PUBLIC_URL,OAUTH_BACKEND_RESOURCE_URI,OAUTH_BOT_CLIENT_IDandOAUTH_BOT_PRIVATE_JWKare required;IDP_DECISIONSis removed.Verification
typecheck, biome check, 184 tests (1 optional Redis test skipped), build. Also typechecked against the Phase 5 backend SDK. Not verified against a real IdP, backend or Telegram.