diracx-testing 0.0.1a11__py3-none-any.whl → 0.0.1a13__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.
@@ -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 test_auth_settings(rsa_private_key_pem) -> AuthSettings:
73
- from diracx.routers.auth import AuthSettings
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()),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diracx-testing
3
- Version: 0.0.1a11
3
+ Version: 0.0.1a13
4
4
  Summary: TODO
5
5
  License: GPL-3.0-only
6
6
  Classifier: Intended Audience :: Science/Research
@@ -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.1a13.dist-info/METADATA,sha256=84WVRmsbfMWSPzWBSqb9ZP2zR_XE1EryezYg7iPqdQQ,615
4
+ diracx_testing-0.0.1a13.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
5
+ diracx_testing-0.0.1a13.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
6
+ diracx_testing-0.0.1a13.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -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.1a11.dist-info/METADATA,sha256=CS0qYe33WHfAI8HmzMHYkc_JN7OPsgLMdn3tCXcpc1Q,615
4
- diracx_testing-0.0.1a11.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
5
- diracx_testing-0.0.1a11.dist-info/top_level.txt,sha256=vJx10tdRlBX3rF2Psgk5jlwVGZNcL3m_7iQWwgPXt-U,7
6
- diracx_testing-0.0.1a11.dist-info/RECORD,,