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:
Mateusz Mandera
2025-01-29 12:48:22 +08:00
committed by Tim Abbott
parent a23663e6f9
commit 7390eb2ed0
9 changed files with 57 additions and 57 deletions

View File

@@ -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()