Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Maunium
synapse
Commits
4059d61e
Commit
4059d61e
authored
5 years ago
by
Andrew Morgan
Browse files
Options
Downloads
Patches
Plain Diff
Don't forget to ratelimit calls outside of RegistrationHandler
parent
b33c4f7a
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
synapse/handlers/register.py
+2
-2
2 additions, 2 deletions
synapse/handlers/register.py
synapse/replication/http/register.py
+2
-0
2 additions, 0 deletions
synapse/replication/http/register.py
with
4 additions
and
2 deletions
synapse/handlers/register.py
+
2
−
2
View file @
4059d61e
...
@@ -168,7 +168,7 @@ class RegistrationHandler(BaseHandler):
...
@@ -168,7 +168,7 @@ class RegistrationHandler(BaseHandler):
Raises:
Raises:
RegistrationError if there was a problem registering.
RegistrationError if there was a problem registering.
"""
"""
yield
self
.
_
check_registration_ratelimit
(
address
)
yield
self
.
check_registration_ratelimit
(
address
)
yield
self
.
auth
.
check_auth_blocking
(
threepid
=
threepid
)
yield
self
.
auth
.
check_auth_blocking
(
threepid
=
threepid
)
password_hash
=
None
password_hash
=
None
...
@@ -415,7 +415,7 @@ class RegistrationHandler(BaseHandler):
...
@@ -415,7 +415,7 @@ class RegistrationHandler(BaseHandler):
ratelimit
=
False
,
ratelimit
=
False
,
)
)
def
_
check_registration_ratelimit
(
self
,
address
):
def
check_registration_ratelimit
(
self
,
address
):
"""
A simple helper method to check whether the registration rate limit has been hit
"""
A simple helper method to check whether the registration rate limit has been hit
for a given IP address
for a given IP address
...
...
This diff is collapsed.
Click to expand it.
synapse/replication/http/register.py
+
2
−
0
View file @
4059d61e
...
@@ -75,6 +75,8 @@ class ReplicationRegisterServlet(ReplicationEndpoint):
...
@@ -75,6 +75,8 @@ class ReplicationRegisterServlet(ReplicationEndpoint):
async
def
_handle_request
(
self
,
request
,
user_id
):
async
def
_handle_request
(
self
,
request
,
user_id
):
content
=
parse_json_object_from_request
(
request
)
content
=
parse_json_object_from_request
(
request
)
await
self
.
registration_handler
.
check_registration_ratelimit
(
content
[
"
address
"
])
await
self
.
registration_handler
.
register_with_store
(
await
self
.
registration_handler
.
register_with_store
(
user_id
=
user_id
,
user_id
=
user_id
,
password_hash
=
content
[
"
password_hash
"
],
password_hash
=
content
[
"
password_hash
"
],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment