-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Disable registration by default. Add script to register new users. #109
Conversation
}) | ||
else: | ||
raise SynapseError( | ||
400, "HMAC incorrect", |
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.
This seems like it should be a 403 to me.
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.
Ooh, good spot.
def _do_shared_secret(self, request, register_json, session): | ||
yield run_on_reactor() | ||
|
||
if "mac" not in register_json: |
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.
Given register_json
is just a dict
from JSON, users may not be setting the right types of these keys. We should be type checking here, which we can actually do in one fell swoop with checking for the existence of keys by doing isinstance(register_json.get("mac"), basestring)
LGTM other than in-line comments. |
LGTM |
Disable registration by default. Add script to register new users.
Also implements a non-standard registration type that uses shared secret.