Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
config: Warn about account_threepid_delegates.email deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
3np committed Jul 28, 2022
1 parent 475ffbc commit 8c8b325
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions synapse/config/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,25 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import argparse
import logging
from typing import Any, Optional

from synapse.api.constants import RoomCreationPreset
from synapse.config._base import Config, ConfigError
from synapse.types import JsonDict, RoomAlias, UserID
from synapse.util.stringutils import random_string_with_symbols, strtobool

logger = logging.getLogger(__name__)

LEGACY_EMAIL_DELEGATE_WARNING = """\
Delegation of email verification to an identity server is now deprecated. To
continue to allow users to add email addresses to their accounts, and use them for
password resets, configure Synapse with an SMTP server via the `email` setting, and
remove `account_threepid_delegates.email`.
This will be an error in a future version.
"""


class RegistrationConfig(Config):
section = "registration"
Expand Down Expand Up @@ -51,6 +63,9 @@ def read_config(self, config: JsonDict, **kwargs: Any) -> None:
self.bcrypt_rounds = config.get("bcrypt_rounds", 12)

account_threepid_delegates = config.get("account_threepid_delegates") or {}
if "email" in account_threepid_delegates:
logger.warning(LEGACY_EMAIL_DELEGATE_WARNING)

self.account_threepid_delegate_email = account_threepid_delegates.get("email")
self.account_threepid_delegate_msisdn = account_threepid_delegates.get("msisdn")
self.default_identity_server = config.get("default_identity_server")
Expand Down

0 comments on commit 8c8b325

Please sign in to comment.