-
Notifications
You must be signed in to change notification settings - Fork 1
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
Develop custom access control plug in #104
Comments
Thinking of it a bit more, I'm not sure how this all plays in with federation. I was assuming our home server would be the arbiter but there are more homeservers and this is why the spec about server ACLs has this whole thing about how to deal with noncompliant servers. Let's just do a simple plugin which handles the classes part first and then actually work in making a new plugin we can publish. The MSC can be a draft since I'd be able to get feedback and iterate. Rooms don't just live in one home server and if you can't join via one you can join via another. This means if you let one person from one server in you might be letting in everyone else in that home sever. |
Also we might want to hook |
Also note that the Synapse module API allows returning specific error codes but not messages so that might need work too for friendlier messages |
Features
Implementation
event name:
edu.mit.sipb.custom_acl
state key can be an empty string since we have no use for it
m.room.server_acl
as inspiration or maybe even make this into a superset of it. Same form.room.join_rules
.m.room_membership
. We still need to put some thought in how to make it compatible withm.room.join_rules
, since we can technically add our own namespaced stuff to it already.allow
anddeny
property, and it follows the same logic as the server ACL:deny
entries is satisfied, denyallow
entries is satisfied, allowTypes
m.room.join_rules
andm.room.server_acl
already support.exact_homeserver
: Match a homeserver exactlyhomeserver_glob
: Match a homeserver globip_literal
: Match any homeserver that is an IP literalmoira_list
: ACL for the given moira list, as long as the list is either an AFS list or a list the server's kerberos identity has access to read its membership (any non-hidden list or any list daemon/matrix.mit.edu can administer)affiliation
: Match a specific affiliationinvited
: Match people who are invited to the room. It should match withtrue
if it meant the joiner was invited, otherwise it would match withfalse
.mit_community
or evenmit_alumni
(TBD, needs thought but it needs to be an option): Match MIT community members or alumni regardless of what homeserver they are in. This would require a way of verifying their identity (in a similar style as Discord verification, your entry would get denied and you'd get a DM to verify, and then our integration could remember you for future rooms).Error messages
Element relays the error messages from the homeserver, so if someone tries to join a semi-unfederated room as in the example below, it would be better for the error message to say
You are not invited to this room
or for the other exampleYou are not invited to this room, please ask a MIT student to invite you
.I don't know how to implement custom error messages while also allowing full flexibility, but we could handle a few special cases, and return a generic error message otherwise. It is also possible that for the case of the moira list ones, we may not want to tell people why they were rejected from a room.
Examples
These are all illustrative but within the MIT context, and do not mean I endorse having rooms like that.
Semi-undefederated room: only people in our homeserver can join unless they are invited
Allow anyone in ec-discuss or r-h-t
Allow all MIT students or anyone who was invited to the room
This is what we need for classes.
Allow all MIT students and allow all SIPB members regardless of whether they are a student or not
Allow all EC residents except Tetazoans
Allow MIT kerb-holders (through matrix.mit.edu) who are not MIT students
Allow only invited students
Since this would require an AND, it is not implementable through this current proposal, but it can be done by combining a join rule event with this event. If we do a MSC, care is to be taken so that things like this still work.
Notes
The text was updated successfully, but these errors were encountered: