tba-profile-workload-credential-wimse-wit 0.4.0.dev2__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.
- tba_profile_workload_credential_wimse_wit/__init__.py +10 -0
- tba_profile_workload_credential_wimse_wit/bindings.py +5 -0
- tba_profile_workload_credential_wimse_wit/claims.py +5 -0
- tba_profile_workload_credential_wimse_wit/compatibility.py +3 -0
- tba_profile_workload_credential_wimse_wit/errors.py +8 -0
- tba_profile_workload_credential_wimse_wit/features.py +3 -0
- tba_profile_workload_credential_wimse_wit/migrations.py +6 -0
- tba_profile_workload_credential_wimse_wit/py.typed +0 -0
- tba_profile_workload_credential_wimse_wit/schemas.py +5 -0
- tba_profile_workload_credential_wimse_wit/validation.py +19 -0
- tba_profile_workload_credential_wimse_wit/versions.py +16 -0
- tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/METADATA +11 -0
- tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/RECORD +14 -0
- tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/WHEEL +4 -0
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from collections.abc import Mapping
|
|
2
|
+
|
|
3
|
+
REQUIRED_WIT_CLAIMS = frozenset({"iss", "sub", "cnf", "exp", "iat"})
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def validate_wit(headers: Mapping[str, object], claims: Mapping[str, object]) -> None:
|
|
7
|
+
if headers.get("typ") != "wit+jwt":
|
|
8
|
+
raise ValueError("WIT requires typ=wit+jwt")
|
|
9
|
+
if headers.get("alg") in {None, "none"}:
|
|
10
|
+
raise ValueError("WIT must be signed")
|
|
11
|
+
missing = REQUIRED_WIT_CLAIMS.difference(claims)
|
|
12
|
+
if missing:
|
|
13
|
+
raise ValueError(f"missing WIT claims: {sorted(missing)}")
|
|
14
|
+
if "aud" in claims:
|
|
15
|
+
raise ValueError(
|
|
16
|
+
"WIT is presented through a workload proof; aud belongs on the proof"
|
|
17
|
+
)
|
|
18
|
+
if not isinstance(claims["cnf"], Mapping) or not claims["cnf"]:
|
|
19
|
+
raise ValueError("WIT requires a confirmation key")
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
from dataclasses import dataclass
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
@dataclass(frozen=True, slots=True)
|
|
5
|
+
class WitVersion:
|
|
6
|
+
identifier: str
|
|
7
|
+
status: str
|
|
8
|
+
specification_uri: str
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
CURRENT_VERSION = WitVersion(
|
|
12
|
+
"draft-ietf-wimse-workload-creds-02",
|
|
13
|
+
"IETF-draft",
|
|
14
|
+
"https://datatracker.ietf.org/doc/draft-ietf-wimse-workload-creds/02/",
|
|
15
|
+
)
|
|
16
|
+
VERSION_HISTORY = (CURRENT_VERSION,)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tba-profile-workload-credential-wimse-wit
|
|
3
|
+
Version: 0.4.0.dev2
|
|
4
|
+
Summary:
|
|
5
|
+
Requires-Python: >=3.10,<3.15
|
|
6
|
+
Classifier: Programming Language :: Python :: 3
|
|
7
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
tba_profile_workload_credential_wimse_wit/__init__.py,sha256=MBYi82c1q1R0LtO-s7kIMI_tMTL8N5kFpAT0hxsJec4,251
|
|
2
|
+
tba_profile_workload_credential_wimse_wit/bindings.py,sha256=geO7qbQkZg0dzzGv3daVxr3WhKaDUdlb382DITlWey4,163
|
|
3
|
+
tba_profile_workload_credential_wimse_wit/claims.py,sha256=WibdHFxqAyKK9njjKwo37vO1RKj76jedqoDQs22LF6U,147
|
|
4
|
+
tba_profile_workload_credential_wimse_wit/compatibility.py,sha256=blAPNN9tX4l6AK00uVEVt3BftrV0hpYn1LoZE9B1eho,170
|
|
5
|
+
tba_profile_workload_credential_wimse_wit/errors.py,sha256=KwHVry4N9TO5ZP3zolvxALLJPBFjBOpiNq_-vH4F9lQ,216
|
|
6
|
+
tba_profile_workload_credential_wimse_wit/features.py,sha256=NkdFsacddfvbNCC6SqbVB0dmaqmHItSnZDOfOYMD8Ls,100
|
|
7
|
+
tba_profile_workload_credential_wimse_wit/migrations.py,sha256=cbTpA34GR_1dW27Cn5zb6Bm0YLIap-PAakGOuhUFCZo,236
|
|
8
|
+
tba_profile_workload_credential_wimse_wit/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
9
|
+
tba_profile_workload_credential_wimse_wit/schemas.py,sha256=QHrkgNjQDZ4CzMQvwCKcenekGhjq2ezTtR8VdgdbcWQ,161
|
|
10
|
+
tba_profile_workload_credential_wimse_wit/validation.py,sha256=3Xzn1KBLDCqOGJ2FkjFf_Iw4Cipsb52ygz4u7pS61hw,786
|
|
11
|
+
tba_profile_workload_credential_wimse_wit/versions.py,sha256=yGHkSQ8oPuHjU22yM-Ekge1QhIfCklQIGlgoGFAfE0o,360
|
|
12
|
+
tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/METADATA,sha256=nzQKIYDr3GfOSb4LT78P4i_Qj8hHCOC2endOkls6Wz0,433
|
|
13
|
+
tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/WHEEL,sha256=L-WvLdSBvJWHXv5zrQxDvNRnIgoBzLUpcbuiw19KCuQ,88
|
|
14
|
+
tba_profile_workload_credential_wimse_wit-0.4.0.dev2.dist-info/RECORD,,
|