Repository navigation
Add CentralAuth ID read allowlist for restricted wikis - #18
Conversation
Adds $wgWikiOasisMagicAccessIdsMap and a UserGetRightsRemove handler that strips the read right on mapped wikis from anyone whose CentralAuth ID is not in the allowlist, and extends the read whitelist with the special pages needed to log in. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtaPDHkXrw6kD656KeyXah
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe extension adds wiki-specific CentralAuth access configuration. ChangesWiki access control
Priority: ➖ Normal Estimated code review effort: 2 (Simple) | ~10 minutes Change: Feature Sequence Diagram(s)sequenceDiagram
participant UserGetRightsRemove
participant Main
participant WikiOasisMagicAccessIdsMap
participant CentralAuthUser
UserGetRightsRemove->>Main: Invoke onUserGetRightsRemove
Main->>WikiOasisMagicAccessIdsMap: Read IDs for the current wiki
Main->>CentralAuthUser: Check registration and CentralAuth ID
Main-->>UserGetRightsRemove: Remove read for unauthorized users
Merge Risk: ⚪ Minimal · up to No merge-blocking risk was established in the reviewed changes. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 1 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Cast both sides of the allowlist membership check to int so IDs configured as strings still match CentralAuth's integer ID. Bump mediawiki/mediawiki-codesniffer to 51.0.1, which requires the patched php_codesniffer 3.13.6. Composer 2.10 refuses to install 3.13.5 due to security advisory PKSA-rdkp-vv9z-mjkg, which fails composer install on every CI leg including main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QtaPDHkXrw6kD656KeyXah
Ports Miraheze's
MirahezeMagicAccessIdsMapapproach so a wiki (staffwiki) can be locked to an explicit list of CentralAuth user IDs.$wgWikiOasisMagicAccessIdsMap: map of dbname => array of CentralAuth user IDs allowed to read that wiki.UserGetRightsRemovehandler onMain: on a mapped wiki, strips thereadright from anonymous users and from any registered user whose CentralAuth ID is not in the list.onTitleReadWhitelistgainsUserlogin,Userlogout,ChangePasswordandPasswordReset, and drops the non-existentResetPassword, so locked-out users can still reach login/recovery.Companion config change: WikiOasis/mw-config#30.
🤖 Generated with Claude Code
https://claude.ai/code/session_01QtaPDHkXrw6kD656KeyXah
Summary by CodeRabbit