mirror of
https://github.com/element-hq/synapse.git
synced 2024-12-14 11:57:44 +00:00
Test macaroon_secret_key{,_path}
This commit is contained in:
parent
087ec0f743
commit
6f10405d30
1 changed files with 8 additions and 1 deletions
|
@ -131,6 +131,7 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
|
|||
[
|
||||
"turn_shared_secret_path: /does/not/exist",
|
||||
"registration_shared_secret_path: /does/not/exist",
|
||||
"macaroon_secret_key_path: /does/not/exist",
|
||||
*["redis:\n enabled: true\n password_path: /does/not/exist"]
|
||||
* (hiredis is not None),
|
||||
]
|
||||
|
@ -152,6 +153,10 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
|
|||
"registration_shared_secret_path: {}",
|
||||
lambda c: c.registration.registration_shared_secret.encode("utf-8"),
|
||||
),
|
||||
(
|
||||
"macaroon_secret_key_path: {}",
|
||||
lambda c: c.key.macaroon_secret_key,
|
||||
),
|
||||
*[
|
||||
(
|
||||
"redis:\n enabled: true\n password_path: {}",
|
||||
|
@ -164,7 +169,9 @@ class ConfigLoadingFileTestCase(ConfigFileTestCase):
|
|||
def test_secret_files_existing(
|
||||
self, config_line: str, get_secret: Callable[[RootConfig], str]
|
||||
) -> None:
|
||||
self.generate_config_and_remove_lines_containing(["registration_shared_secret"])
|
||||
self.generate_config_and_remove_lines_containing(
|
||||
["registration_shared_secret", "macaroon_secret_key"]
|
||||
)
|
||||
with tempfile.NamedTemporaryFile(buffering=0) as secret_file:
|
||||
secret_file.write(b"53C237")
|
||||
|
||||
|
|
Loading…
Reference in a new issue