Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Matrix
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Container Registry
Model registry
Operate
Environments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
Matrix
Commits
3e0aaad1
Commit
3e0aaad1
authored
7 years ago
by
Richard van der Hoff
Browse files
Options
Downloads
Patches
Plain Diff
Let auth providers get to the database
Somewhat open to abuse, but also somewhat unavoidable :/
parent
a72e4e3e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/handlers/auth.py
+16
-0
16 additions, 0 deletions
synapse/handlers/auth.py
with
16 additions
and
0 deletions
synapse/handlers/auth.py
+
16
−
0
View file @
3e0aaad1
...
...
@@ -730,6 +730,7 @@ class _AccountHandler(object):
self
.
hs
=
hs
self
.
_check_user_exists
=
check_user_exists
self
.
_store
=
hs
.
get_datastore
()
def
check_user_exists
(
self
,
user_id
):
"""
Check if user exissts.
...
...
@@ -747,3 +748,18 @@ class _AccountHandler(object):
"""
reg
=
self
.
hs
.
get_handlers
().
registration_handler
return
reg
.
register
(
localpart
=
localpart
)
def
run_db_interaction
(
self
,
desc
,
func
,
*
args
,
**
kwargs
):
"""
Run a function with a database connection
Args:
desc (str): description for the transaction, for metrics etc
func (func): function to be run. Passed a database cursor object
as well as *args and **kwargs
*args: positional args to be passed to func
**kwargs: named args to be passed to func
Returns:
Deferred[object]: result of func
"""
return
self
.
_store
.
runInteraction
(
desc
,
func
,
*
args
,
**
kwargs
)
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