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

Commit

Permalink
Merge pull request #119 from matrix-org/babolivier/auth_shadow
Browse files Browse the repository at this point in the history
Fix divergence with mainline in the auth code
  • Loading branch information
babolivier authored Jan 14, 2022
2 parents df3111d + 124b6ad commit d1fedca
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions synapse/api/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,20 +268,18 @@ async def validate_appservice_can_control_user_id(
403,
"Application service cannot masquerade as this user (%s)." % user_id,
)
# Let ASes manipulate nonexistent users (e.g. to shadow-register them)
# Check to make sure the user is already registered on the homeserver
# elif not (await self.store.get_user_by_id(user_id)):
# raise AuthError(
# 403, "Application service has not registered this user (%s)" % user_id
# )
elif not (await self.store.get_user_by_id(user_id)):
raise AuthError(
403, "Application service has not registered this user (%s)" % user_id
)

async def _get_appservice_user_id(
self, request: Request
) -> Tuple[Optional[str], Optional[ApplicationService]]:
app_service = self.store.get_app_service_by_token(
self.get_access_token_from_request(request)
)

if app_service is None:
return None, None

Expand Down

0 comments on commit d1fedca

Please sign in to comment.