diracx-testing 0.0.1a10__py3-none-any.whl → 0.0.1a12__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- diracx/testing/__init__.py +13 -7
- {diracx_testing-0.0.1a10.dist-info → diracx_testing-0.0.1a12.dist-info}/METADATA +1 -1
- diracx_testing-0.0.1a12.dist-info/RECORD +6 -0
- {diracx_testing-0.0.1a10.dist-info → diracx_testing-0.0.1a12.dist-info}/WHEEL +1 -1
- diracx_testing-0.0.1a10.dist-info/RECORD +0 -6
- {diracx_testing-0.0.1a10.dist-info → diracx_testing-0.0.1a12.dist-info}/top_level.txt +0 -0
diracx/testing/__init__.py
CHANGED
@@ -16,7 +16,7 @@ import pytest
|
|
16
16
|
import requests
|
17
17
|
|
18
18
|
if TYPE_CHECKING:
|
19
|
-
from diracx.routers.auth import AuthSettings
|
19
|
+
from diracx.routers.auth.utils import AuthSettings
|
20
20
|
from diracx.routers.job_manager.sandboxes import SandboxStoreSettings
|
21
21
|
|
22
22
|
# to get a string like this run:
|
@@ -69,11 +69,19 @@ def rsa_private_key_pem() -> str:
|
|
69
69
|
|
70
70
|
|
71
71
|
@pytest.fixture(scope="session")
|
72
|
-
def
|
73
|
-
from
|
72
|
+
def fernet_key() -> str:
|
73
|
+
from cryptography.fernet import Fernet
|
74
|
+
|
75
|
+
return Fernet.generate_key().decode()
|
76
|
+
|
77
|
+
|
78
|
+
@pytest.fixture(scope="session")
|
79
|
+
def test_auth_settings(rsa_private_key_pem, fernet_key) -> AuthSettings:
|
80
|
+
from diracx.routers.auth.utils import AuthSettings
|
74
81
|
|
75
82
|
yield AuthSettings(
|
76
83
|
token_key=rsa_private_key_pem,
|
84
|
+
state_key=fernet_key,
|
77
85
|
allowed_redirects=[
|
78
86
|
"http://diracx.test.invalid:8000/api/docs/oauth2-redirect",
|
79
87
|
],
|
@@ -266,14 +274,13 @@ class ClientFactory:
|
|
266
274
|
@contextlib.contextmanager
|
267
275
|
def normal_user(self):
|
268
276
|
from diracx.core.properties import NORMAL_USER
|
269
|
-
from diracx.routers.auth import create_token
|
277
|
+
from diracx.routers.auth.token import create_token
|
270
278
|
|
271
279
|
with self.unauthenticated() as client:
|
272
280
|
payload = {
|
273
281
|
"sub": "testingVO:yellow-sub",
|
274
282
|
"exp": datetime.now(tz=timezone.utc)
|
275
283
|
+ timedelta(self.test_auth_settings.access_token_expire_minutes),
|
276
|
-
"aud": AUDIENCE,
|
277
284
|
"iss": ISSUER,
|
278
285
|
"dirac_properties": [NORMAL_USER],
|
279
286
|
"jti": str(uuid4()),
|
@@ -290,12 +297,11 @@ class ClientFactory:
|
|
290
297
|
@contextlib.contextmanager
|
291
298
|
def admin_user(self):
|
292
299
|
from diracx.core.properties import JOB_ADMINISTRATOR
|
293
|
-
from diracx.routers.auth import create_token
|
300
|
+
from diracx.routers.auth.token import create_token
|
294
301
|
|
295
302
|
with self.unauthenticated() as client:
|
296
303
|
payload = {
|
297
304
|
"sub": "testingVO:yellow-sub",
|
298
|
-
"aud": AUDIENCE,
|
299
305
|
"iss": ISSUER,
|
300
306
|
"dirac_properties": [JOB_ADMINISTRATOR],
|
301
307
|
"jti": str(uuid4()),
|
@@ -0,0 +1,6 @@
|
|
1
|
+
diracx/testing/__init__.py,sha256=1g2BhfkyZAmI9Gbbkmgdm_zHSGbA8AAaBn_u8Ojrvws,19172
|
2
|
+
diracx/testing/osdb.py,sha256=-EFZNyEY07Zq7HdQGZxS3H808Y94aaUhmo0x-Y8xo3Q,3592
|
3
|
+
diracx_testing-0.0.1a12.dist-info/METADATA,sha256=RRrAZmYrX-s0UOSuCQ8QB3orGiRKy4O9qSgAEWSeS70,615
|
4
|
+
diracx_testing-0.0.1a12.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
5
|
+
diracx_testing-0.0.1a12.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
6
|
+
diracx_testing-0.0.1a12.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
diracx/testing/__init__.py,sha256=wXrihINkyIbE2dn4XyKDeQO4cp8bKPkeUIi3ssod0qs,19026
|
2
|
-
diracx/testing/osdb.py,sha256=-EFZNyEY07Zq7HdQGZxS3H808Y94aaUhmo0x-Y8xo3Q,3592
|
3
|
-
diracx_testing-0.0.1a10.dist-info/METADATA,sha256=BE-nfEHYD7kakG38j-w0mdUUPOFGjycamahyTKEABaM,615
|
4
|
-
diracx_testing-0.0.1a10.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
-
diracx_testing-0.0.1a10.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
|
6
|
-
diracx_testing-0.0.1a10.dist-info/RECORD,,
|
File without changes
|