crypticorn-utils 0.1.1rc2__py3-none-any.whl → 0.1.2__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.
crypticorn_utils/auth.py CHANGED
@@ -80,7 +80,7 @@ class AuthHandler:
80
80
  return await self.client.login.verify_basic_auth(basic.username, basic.password)
81
81
 
82
82
  async def _validate_scopes(
83
- self, api_scopes: list[Scope], user_scopes: list[Scope]
83
+ self, api_scopes: list[str], user_scopes: list[str]
84
84
  ) -> bool:
85
85
  """
86
86
  Checks if the required scopes are a subset of the user scopes.
@@ -92,6 +92,10 @@ class AuthHandler:
92
92
  message="Insufficient scopes to access this resource (required: "
93
93
  + ", ".join(api_scopes)
94
94
  + ")",
95
+ details={
96
+ "required_scopes": api_scopes,
97
+ "granted_scopes": user_scopes,
98
+ },
95
99
  ),
96
100
  )
97
101
 
@@ -277,7 +281,12 @@ class AuthHandler:
277
281
  if res is None:
278
282
  continue
279
283
  if sec:
280
- await self._validate_scopes(sec.scopes, res.scopes)
284
+ required = [
285
+ s.value if isinstance(s, Scope) else str(s)
286
+ for s in sec.scopes
287
+ ]
288
+ granted = [str(s) for s in res.scopes]
289
+ await self._validate_scopes(required, granted)
281
290
  return res
282
291
 
283
292
  except Exception as e:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: crypticorn_utils
3
- Version: 0.1.1rc2
3
+ Version: 0.1.2
4
4
  Summary: Shared utilities for the Crypticorn APIs
5
5
  Author-email: Crypticorn <timon@crypticorn.com>
6
6
  License-Expression: MIT
@@ -68,6 +68,17 @@ This module serves as a central place for providing utilities for our python bac
68
68
 
69
69
  <!-- changelog-insertion -->
70
70
 
71
+ ## v0.1.2 (2025-07-22)
72
+
73
+ ### Bug Fixes
74
+
75
+ - Failing scope comparison in some environments
76
+ ([`004495d`](https://github.com/crypticorn-ai/util-libraries/commit/004495da87b973f43b3e32abe96493dac1b6204a))
77
+
78
+
79
+ ## v0.1.1 (2025-07-20)
80
+
81
+
71
82
  ## v0.1.1-rc.2 (2025-07-18)
72
83
 
73
84
  ### Bug Fixes
@@ -1,7 +1,7 @@
1
1
  crypticorn_utils/__init__.py,sha256=PlxMppwUMmbNR9Jr1z9DNCYAYnTuWzW9IFyGTwV5slA,700
2
2
  crypticorn_utils/_migration.py,sha256=YPVEDVIz9Lt3ntwrVmUtavQxsJVjtSqQeQ0A_qydiaY,445
3
3
  crypticorn_utils/ansi_colors.py,sha256=-tMlUTE8NI7TPv7uj0kGRe-SI2hGaUNPKBFI_dfiZy0,1392
4
- crypticorn_utils/auth.py,sha256=fgwpN4QrjsznLa2LLwsSxC-P5p4Tne5wFI_fWmJpSqc,12990
4
+ crypticorn_utils/auth.py,sha256=i0VE07eU3ALIfi7wEnUfLMK6x85SjrMqIif-LyXQ-i8,13370
5
5
  crypticorn_utils/decorators.py,sha256=chsbF27_q3hC0egBaZLfv2vcqUcBSfQXRkLi3Ewb-20,1063
6
6
  crypticorn_utils/enums.py,sha256=gIiEhMJDTla4HnW1AcGYHG2IA_VAby-Nu8BFHyFlDxM,4955
7
7
  crypticorn_utils/errors.py,sha256=mzQZsD8mFPQY6RJLqN_yw9n4CNoo3pEsNh8-v8n_n_o,30440
@@ -16,9 +16,9 @@ crypticorn_utils/utils.py,sha256=DXIOjJCdrDqoNCLAtohWYrFnEd1nvmg9NXdL07yWAgk,313
16
16
  crypticorn_utils/warnings.py,sha256=ErEB108UVZgV5ykSuFkjQgDTb9sb_T9yKq-h753Kw64,3085
17
17
  crypticorn_utils/router/admin_router.py,sha256=B8s0hqOFe6CFTTsCxtwMUZSdb5EbRsFeKPixH9CXwOU,4090
18
18
  crypticorn_utils/router/status_router.py,sha256=tqrTXq4ZWCxiTXinQoK-2tadWu2jUFzzzkN_Dft0P8g,1084
19
- crypticorn_utils-0.1.1rc2.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
20
- crypticorn_utils-0.1.1rc2.dist-info/METADATA,sha256=4JrJr1sdNPRKyfDmYBn9QlrAKPMGcXWv_Cd6i9bH73o,4709
21
- crypticorn_utils-0.1.1rc2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
- crypticorn_utils-0.1.1rc2.dist-info/entry_points.txt,sha256=G4yWDll7v_Kb4uemqI-_qTKXHvs10R4mD7hNuD-biv4,71
23
- crypticorn_utils-0.1.1rc2.dist-info/top_level.txt,sha256=jLPvdxnI36RPf8TX3aZhl35OSd721xEYyFSEeQKF6Ic,17
24
- crypticorn_utils-0.1.1rc2.dist-info/RECORD,,
19
+ crypticorn_utils-0.1.2.dist-info/licenses/LICENSE,sha256=HonAVvzFXkP2C1d7D3ByIKPwjGH8NcHTAQvKH7uvOHQ,1856
20
+ crypticorn_utils-0.1.2.dist-info/METADATA,sha256=A3c5MN2-lQh32s5Tsdv-oX3Xp5NxIQrXLndUExIr7dc,4933
21
+ crypticorn_utils-0.1.2.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
22
+ crypticorn_utils-0.1.2.dist-info/entry_points.txt,sha256=G4yWDll7v_Kb4uemqI-_qTKXHvs10R4mD7hNuD-biv4,71
23
+ crypticorn_utils-0.1.2.dist-info/top_level.txt,sha256=jLPvdxnI36RPf8TX3aZhl35OSd721xEYyFSEeQKF6Ic,17
24
+ crypticorn_utils-0.1.2.dist-info/RECORD,,