Printf debugging for MSISDN validation (#11882)
This makes some attempt to keep CI happy too, but it probably ought not to.pull/12117/head
parent
3bf466698f
commit
ed2f158a38
|
@ -277,8 +277,8 @@ class MessageHandler:
|
||||||
# If this is an AS, double check that they are allowed to see the members.
|
# If this is an AS, double check that they are allowed to see the members.
|
||||||
# This can either be because the AS user is in the room or because there
|
# This can either be because the AS user is in the room or because there
|
||||||
# is a user in the room that the AS is "interested in"
|
# is a user in the room that the AS is "interested in"
|
||||||
if False and requester.app_service and user_id not in users_with_profile:
|
if False and requester.app_service and user_id not in users_with_profile: # type: ignore[unreachable]
|
||||||
for uid in users_with_profile:
|
for uid in users_with_profile: # type: ignore[unreachable]
|
||||||
if requester.app_service.is_interested_in_user(uid):
|
if requester.app_service.is_interested_in_user(uid):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
|
|
@ -467,6 +467,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
|
||||||
next_link = body.get("next_link") # Optional param
|
next_link = body.get("next_link") # Optional param
|
||||||
|
|
||||||
msisdn = phone_number_to_msisdn(country, phone_number)
|
msisdn = phone_number_to_msisdn(country, phone_number)
|
||||||
|
logger.info("Request #%s to verify ownership of %s", send_attempt, msisdn)
|
||||||
|
|
||||||
if not check_3pid_allowed(self.hs, "msisdn", msisdn):
|
if not check_3pid_allowed(self.hs, "msisdn", msisdn):
|
||||||
raise SynapseError(
|
raise SynapseError(
|
||||||
|
@ -494,6 +495,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
|
||||||
await self.hs.get_clock().sleep(random.randint(1, 10) / 10)
|
await self.hs.get_clock().sleep(random.randint(1, 10) / 10)
|
||||||
return 200, {"sid": random_string(16)}
|
return 200, {"sid": random_string(16)}
|
||||||
|
|
||||||
|
logger.info("MSISDN %s is already in use by %s", msisdn, existing_user_id)
|
||||||
raise SynapseError(400, "MSISDN is already in use", Codes.THREEPID_IN_USE)
|
raise SynapseError(400, "MSISDN is already in use", Codes.THREEPID_IN_USE)
|
||||||
|
|
||||||
if not self.hs.config.registration.account_threepid_delegate_msisdn:
|
if not self.hs.config.registration.account_threepid_delegate_msisdn:
|
||||||
|
@ -518,6 +520,7 @@ class MsisdnThreepidRequestTokenRestServlet(RestServlet):
|
||||||
threepid_send_requests.labels(type="msisdn", reason="add_threepid").observe(
|
threepid_send_requests.labels(type="msisdn", reason="add_threepid").observe(
|
||||||
send_attempt
|
send_attempt
|
||||||
)
|
)
|
||||||
|
logger.info("MSISDN %s: got response from identity server: %s", msisdn, ret)
|
||||||
|
|
||||||
return 200, ret
|
return 200, ret
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue