root: fix config env var resolution (#6310)
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
7e46af3f45
commit
546425acde
|
@ -118,6 +118,8 @@ class ConfigLoader:
|
|||
else:
|
||||
if isinstance(value, str):
|
||||
value = self.parse_uri(value)
|
||||
elif isinstance(value, Attr) and isinstance(value.value, str):
|
||||
value = self.parse_uri(value.value)
|
||||
elif not isinstance(value, Attr):
|
||||
value = Attr(value)
|
||||
root[key] = value
|
||||
|
|
|
@ -60,6 +60,12 @@ class TestConfig(TestCase):
|
|||
|
||||
unlink(file_name)
|
||||
|
||||
def test_uri_env(self):
|
||||
"""Test URI set as env variable"""
|
||||
environ["AUTHENTIK_TEST_VAR"] = "file:///foo?bar"
|
||||
config = ConfigLoader()
|
||||
self.assertEqual(config.get("test_var"), "bar")
|
||||
|
||||
def test_file_update(self):
|
||||
"""Test update_from_file"""
|
||||
config = ConfigLoader()
|
||||
|
|
Reference in New Issue