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

Use direct references for configuration variables (part 4). #10893

Merged
merged 12 commits into from
Sep 23, 2021
Prev Previous commit
Next Next commit
Update references to jwt config.
  • Loading branch information
clokep committed Sep 23, 2021
commit cec2defc0b92b9622d3072369141f0baa6a159f0
10 changes: 5 additions & 5 deletions synapse/rest/client/login.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ def __init__(self, hs: "HomeServer"):
self.hs = hs

# JWT configuration variables.
self.jwt_enabled = hs.config.jwt_enabled
self.jwt_secret = hs.config.jwt_secret
self.jwt_algorithm = hs.config.jwt_algorithm
self.jwt_issuer = hs.config.jwt_issuer
self.jwt_audiences = hs.config.jwt_audiences
self.jwt_enabled = hs.config.jwt.jwt_enabled
self.jwt_secret = hs.config.jwt.jwt_secret
self.jwt_algorithm = hs.config.jwt.jwt_algorithm
self.jwt_issuer = hs.config.jwt.jwt_issuer
self.jwt_audiences = hs.config.jwt.jwt_audiences

# SSO configuration.
self.saml2_enabled = hs.config.saml2_enabled
Expand Down
12 changes: 6 additions & 6 deletions tests/rest/client/test_login.py
Original file line number Diff line number Diff line change
Expand Up @@ -815,9 +815,9 @@ class JWTTestCase(unittest.HomeserverTestCase):

def make_homeserver(self, reactor, clock):
self.hs = self.setup_test_homeserver()
self.hs.config.jwt_enabled = True
self.hs.config.jwt_secret = self.jwt_secret
self.hs.config.jwt_algorithm = self.jwt_algorithm
self.hs.config.jwt.jwt_enabled = True
self.hs.config.jwt.jwt_secret = self.jwt_secret
self.hs.config.jwt.jwt_algorithm = self.jwt_algorithm
return self.hs

def jwt_encode(self, payload: Dict[str, Any], secret: str = jwt_secret) -> str:
Expand Down Expand Up @@ -1023,9 +1023,9 @@ class JWTPubKeyTestCase(unittest.HomeserverTestCase):

def make_homeserver(self, reactor, clock):
self.hs = self.setup_test_homeserver()
self.hs.config.jwt_enabled = True
self.hs.config.jwt_secret = self.jwt_pubkey
self.hs.config.jwt_algorithm = "RS256"
self.hs.config.jwt.jwt_enabled = True
self.hs.config.jwt.jwt_secret = self.jwt_pubkey
self.hs.config.jwt.jwt_algorithm = "RS256"
return self.hs

def jwt_encode(self, payload: Dict[str, Any], secret: str = jwt_privatekey) -> str:
Expand Down