mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
zilencer: Rename registration takeover to registration transfer.
This is the final naming that we want, compared to the naming we merged in #32399. Includes renaming the API endpoints, but that should be fine as the original PR was just merged and this isn't deployed anywhere.
This commit is contained in:
committed by
Tim Abbott
parent
a23663e6f9
commit
7390eb2ed0
@@ -40,17 +40,17 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
ParamT = ParamSpec("ParamT")
|
||||
|
||||
REMOTE_SERVER_TAKEOVER_TOKEN_SALT = "remote_server_takeover"
|
||||
REMOTE_SERVER_TAKEOVER_TOKEN_SALT = "remote_server_transfer"
|
||||
REMOTE_SERVER_TAKEOVER_TOKEN_VALIDITY_SECONDS = 10
|
||||
|
||||
|
||||
def generate_registration_takeover_verification_secret(hostname: str) -> str:
|
||||
def generate_registration_transfer_verification_secret(hostname: str) -> str:
|
||||
signer = TimestampSigner(salt=REMOTE_SERVER_TAKEOVER_TOKEN_SALT)
|
||||
secret = base64.b16encode(signer.sign(hostname).encode()).decode()
|
||||
return secret
|
||||
|
||||
|
||||
def validate_registration_takeover_verification_secret(secret: str, hostname: str) -> None:
|
||||
def validate_registration_transfer_verification_secret(secret: str, hostname: str) -> None:
|
||||
signer = TimestampSigner(salt=REMOTE_SERVER_TAKEOVER_TOKEN_SALT)
|
||||
try:
|
||||
signed_data = base64.b16decode(secret).decode()
|
||||
|
Reference in New Issue
Block a user