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
8cd760fc
Unverified
Commit
8cd760fc
authored
3 years ago
by
Brendan Abolivier
Committed by
GitHub
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow modules to store already existing 3PID associations (#12195)
parent
89f11f8c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
changelog.d/12195.feature
+1
-0
1 addition, 0 deletions
changelog.d/12195.feature
synapse/module_api/__init__.py
+26
-1
26 additions, 1 deletion
synapse/module_api/__init__.py
with
27 additions
and
1 deletion
changelog.d/12195.feature
0 → 100644
+
1
−
0
View file @
8cd760fc
Allow
modules
to
store
already
existing
3PID
associations.
This diff is collapsed.
Click to expand it.
synapse/module_api/__init__.py
+
26
−
1
View file @
8cd760fc
...
@@ -671,7 +671,8 @@ class ModuleApi:
...
@@ -671,7 +671,8 @@ class ModuleApi:
def
record_user_external_id
(
def
record_user_external_id
(
self
,
auth_provider_id
:
str
,
remote_user_id
:
str
,
registered_user_id
:
str
self
,
auth_provider_id
:
str
,
remote_user_id
:
str
,
registered_user_id
:
str
)
->
defer
.
Deferred
:
)
->
defer
.
Deferred
:
"""
Record a mapping from an external user id to a mxid
"""
Record a mapping between an external user id from a single sign-on provider
and a mxid.
Added in Synapse v1.9.0.
Added in Synapse v1.9.0.
...
@@ -1286,6 +1287,30 @@ class ModuleApi:
...
@@ -1286,6 +1287,30 @@ class ModuleApi:
"""
"""
await
self
.
_registration_handler
.
check_username
(
username
)
await
self
.
_registration_handler
.
check_username
(
username
)
async
def
store_remote_3pid_association
(
self
,
user_id
:
str
,
medium
:
str
,
address
:
str
,
id_server
:
str
)
->
None
:
"""
Stores an existing association between a user ID and a third-party identifier.
The association must already exist on the remote identity server.
Added in Synapse v1.56.0.
Args:
user_id: The user ID that
'
s been associated with the 3PID.
medium: The medium of the 3PID (current supported values are
"
msisdn
"
and
"
email
"
).
address: The address of the 3PID.
id_server: The identity server the 3PID association has been registered on.
This should only be the domain (or IP address, optionally with the port
number) for the identity server. This will be used to reach out to the
identity server using HTTPS (unless specified otherwise by Synapse
'
s
configuration) when attempting to unbind the third-party identifier.
"""
await
self
.
_store
.
add_user_bound_threepid
(
user_id
,
medium
,
address
,
id_server
)
class
PublicRoomListManager
:
class
PublicRoomListManager
:
"""
Contains methods for adding to, removing from and querying whether a room
"""
Contains methods for adding to, removing from and querying whether a room
...
...
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