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

fix federation_domain_whitelist #3099

Merged
merged 1 commit into from
Apr 13, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions synapse/federation/transport/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,6 @@ def authenticate_request(self, request, content):
"signatures": {},
}

if (
self.federation_domain_whitelist is not None and
self.server_name not in self.federation_domain_whitelist
):
raise FederationDeniedError(self.server_name)

if content is not None:
json_request["content"] = content

Expand Down Expand Up @@ -138,6 +132,12 @@ def strip_quotes(value):
json_request["origin"] = origin
json_request["signatures"].setdefault(origin, {})[key] = sig

if (
self.federation_domain_whitelist is not None and
origin not in self.federation_domain_whitelist
):
raise FederationDeniedError(origin)

if not json_request["signatures"]:
raise NoAuthenticationError(
401, "Missing Authorization headers", Codes.UNAUTHORIZED,
Expand Down