-
Notifications
You must be signed in to change notification settings - Fork 13.1k
feat: adds federation event ACL #36913
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: adds federation event ACL #36913
Conversation
|
Looks like this PR is not ready to merge, because of the following issues:
Please fix the issues and try again If you have any trouble, please check the PR guidelines |
|
WalkthroughAdds a middleware to authorize event access and updates the transactions router to use federationAuth and a guarded GET /v1/event/:eventId that fetches the event and returns origin, origin_server_ts, and pdus (PUT /v1/send/:txnId unchanged). Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant C as Client
participant R as Router
participant M as canAccessEvent Middleware
participant A as EventAuthorizationService
participant S as Event Service
C->>R: GET /v1/event/:eventId (Authorization)
R->>M: invoke middleware
M->>A: canAccessEventFromAuthorizationHeader(eventId, header, method, path, undefined)
alt Authorized
M-->>R: next()
R->>S: event.getEventById(eventId)
alt Found
S-->>R: { event, origin_server_ts, origin }
R-->>C: 200 { origin: origin, origin_server_ts, pdus: [event] }
else Not found
R-->>C: 404 { errcode: M_NOT_FOUND, error: ... }
end
else Not authorized
M-->>C: <status> { errcode, error }
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Disabled knowledge base sources:
📒 Files selected for processing (3)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
Comment |
|
build will fail until we merge homeserver side things |
260f5ef to
c3f0637
Compare
79c0250 to
2ccb7a6
Compare
c3f0637 to
aa5a4b4
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## chore/federation-backup #36913 +/- ##
===========================================================
+ Coverage 66.21% 68.18% +1.96%
===========================================================
Files 3384 2750 -634
Lines 115025 98829 -16196
Branches 21066 17345 -3721
===========================================================
- Hits 76165 67384 -8781
+ Misses 36255 29876 -6379
+ Partials 2605 1569 -1036
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
aa5a4b4 to
5c8f75a
Compare
5c8f75a to
71d5871
Compare
e003574 to
cb6102c
Compare
71d5871 to
6136873
Compare
Works along with RocketChat/homeserver#161.
Summary by CodeRabbit
New Features
Bug Fixes