This commit is contained in:
babolivier 2022-02-08 10:21:04 +00:00
parent ee0d41f825
commit 57d8f25784
4 changed files with 30 additions and 2 deletions

View file

@ -309,6 +309,20 @@ callback that does not return <code>None</code> will be used. If this happens, S
any of the subsequent implementations of this callback. If every callback return <code>None</code>,
the username provided by the user is used, if any (otherwise one is automatically
generated).</p>
<h2 id="is_3pid_allowed"><a class="header" href="#is_3pid_allowed"><code>is_3pid_allowed</code></a></h2>
<p><em>First introduced in Synapse v1.53.0</em></p>
<pre><code class="language-python">async def is_3pid_allowed(self, medium: str, address: str, registration: bool) -&gt; bool
</code></pre>
<p>Called when attempting to bind a third-party identifier (i.e. an email address or a phone
number). The module is given the medium of the third-party identifier (which is <code>email</code> if
the identifier is an email address, or <code>msisdn</code> if the identifier is a phone number) and
its address, as well as a boolean indicating whether the attempt to bind is happening as
part of registering a new user. The module must return a boolean indicating whether the
identifier can be allowed to be bound to an account on the local homeserver.</p>
<p>If multiple modules implement this callback, they will be considered in order. If a
callback returns <code>True</code>, Synapse falls through to the next one. The value of the first
callback that does not return <code>True</code> will be used. If this happens, Synapse will not call
any of the subsequent implementations of this callback.</p>
<h2 id="example"><a class="header" href="#example">Example</a></h2>
<p>The example module below implements authentication checkers for two different login types: </p>
<ul>

View file

@ -8477,6 +8477,20 @@ callback that does not return <code>None</code> will be used. If this happens, S
any of the subsequent implementations of this callback. If every callback return <code>None</code>,
the username provided by the user is used, if any (otherwise one is automatically
generated).</p>
<h2 id="is_3pid_allowed"><a class="header" href="#is_3pid_allowed"><code>is_3pid_allowed</code></a></h2>
<p><em>First introduced in Synapse v1.53.0</em></p>
<pre><code class="language-python">async def is_3pid_allowed(self, medium: str, address: str, registration: bool) -&gt; bool
</code></pre>
<p>Called when attempting to bind a third-party identifier (i.e. an email address or a phone
number). The module is given the medium of the third-party identifier (which is <code>email</code> if
the identifier is an email address, or <code>msisdn</code> if the identifier is a phone number) and
its address, as well as a boolean indicating whether the attempt to bind is happening as
part of registering a new user. The module must return a boolean indicating whether the
identifier can be allowed to be bound to an account on the local homeserver.</p>
<p>If multiple modules implement this callback, they will be considered in order. If a
callback returns <code>True</code>, Synapse falls through to the next one. The value of the first
callback that does not return <code>True</code> will be used. If this happens, Synapse will not call
any of the subsequent implementations of this callback.</p>
<h2 id="example-3"><a class="header" href="#example-3">Example</a></h2>
<p>The example module below implements authentication checkers for two different login types: </p>
<ul>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long