-
-
Notifications
You must be signed in to change notification settings - Fork 6
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm modulo a couple of suggestions.
ACCESS_RULE_DIRECT = "direct" | ||
|
||
|
||
class AccessRules: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for future reference, https://docs.python.org/3/library/enum.html might be a useful thing for this sort of construction (saves maintaining a separate VALID_ACCESS_RULES)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@richvdh I actually spent about an hour trying to make this work with Enum
and failed, eventually reverting back to VALID_ACCESS_RULES
. Reason being that while one can say isinstance(rule, AccessRule)
, rule
must be an instance of AccessRule
. Since we're JSON serialising and deserialising stuff in the tests and the code here, that would've meant having to cast strings to AccessRule
all over the place.
Thus VALID_ACCESS_RULES
ended up being the less complex option :)
…oa/freeze_rooms * 'dinsic' of github.com:matrix-org/synapse-dinsic: Only assert valid next_link params when provided (#65) Don't push if an user account has expired (#58) Swap method calls in RoomAccessTestCase.test_change_rules (#64) Make all rooms noisy by default (#60) Make AccessRules use the public rooms directory instead of checking a room's join rules on rule change (#63) Override the power levels defaults, enforce mod requirement for invites, admin requirements for unknown state events (#61) RoomAccessRules cleanup (#62) Add a config option for validating 'next_link' parameters against a domain whitelist (#8275)
Various cleanups of the DINUM-specific
RoomAccessRules
module, including:I want to leave the
async
ing until we do another round of merging Synapsemaster
intodinsic
, asThirdPartyEventRules
is not async yet on thedinsic
branch.Reviewable commit-by-commit, though the bulk of the cleanup is in the first and last commits.