mirror of
https://github.com/maxkratz/edgedb.git
synced 2024-09-16 18:59:05 +00:00
Fix missing import of edbserver (#6509)
This is imported locally to avoid a circular import
This commit is contained in:
parent
c7e10203ad
commit
c1d615f1df
2 changed files with 15 additions and 0 deletions
|
@ -1028,6 +1028,8 @@ class Tenant(ha_base.ClusterProtocol):
|
|||
self._jwt_sub_allowlist_file.read_text().splitlines(),
|
||||
)
|
||||
except Exception as e:
|
||||
from . import server as edbserver
|
||||
|
||||
raise edbserver.StartupError(
|
||||
f"cannot load JWT sub allowlist: {e}"
|
||||
) from e
|
||||
|
@ -1042,6 +1044,8 @@ class Tenant(ha_base.ClusterProtocol):
|
|||
self._jwt_revocation_list_file.read_text().splitlines(),
|
||||
)
|
||||
except Exception as e:
|
||||
from . import server as edbserver
|
||||
|
||||
raise edbserver.StartupError(
|
||||
f"cannot load JWT revocation list: {e}"
|
||||
) from e
|
||||
|
|
|
@ -31,6 +31,7 @@ import edgedb
|
|||
|
||||
from edb.common import secretkey
|
||||
from edb.server import args
|
||||
from edb.server import cluster as edbcluster
|
||||
from edb.schema import defines as s_def
|
||||
from edb.testbase import server as tb
|
||||
|
||||
|
@ -472,6 +473,16 @@ class TestServerAuth(tb.ConnectedTestCase):
|
|||
subject = "test"
|
||||
key_id = "foobar"
|
||||
|
||||
with self.assertRaisesRegex(
|
||||
edbcluster.ClusterError, "cannot load JWT"
|
||||
):
|
||||
async with tb.start_edgedb_server(
|
||||
jws_key_file=jwk_file,
|
||||
jwt_sub_allowlist_file='/tmp/non_existant',
|
||||
jwt_revocation_list_file='/tmp/non_existant',
|
||||
):
|
||||
pass
|
||||
|
||||
async with tb.start_edgedb_server(
|
||||
jws_key_file=jwk_file,
|
||||
jwt_sub_allowlist_file=allowlist_file,
|
||||
|
|
Loading…
Reference in a new issue