tba-bases-workload-identity 0.4.0.dev2__tar.gz

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.
@@ -0,0 +1,19 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-bases-workload-identity
3
+ Version: 0.4.0.dev2
4
+ Summary: Protocol-neutral workload reference, credential, verification, delegation, and trust-material bases.
5
+ License-Expression: Apache-2.0
6
+ Requires-Python: >=3.10,<3.15
7
+ Classifier: Programming Language :: Python :: 3
8
+ Classifier: Programming Language :: Python :: 3.10
9
+ Classifier: Programming Language :: Python :: 3.11
10
+ Classifier: Programming Language :: Python :: 3.12
11
+ Classifier: Programming Language :: Python :: 3.13
12
+ Classifier: Programming Language :: Python :: 3.14
13
+ Requires-Dist: tba-contracts-workload-identity (==0.4.0.dev2)
14
+ Description-Content-Type: text/markdown
15
+
16
+ # tba-bases-workload-identity
17
+
18
+ Canonical bases are protocol neutral: reference resolution, credential provision and verification, delegated provision, and trust-material resolution. SPIFFE-named exports are temporary compatibility bases for existing providers.
19
+
@@ -0,0 +1,3 @@
1
+ # tba-bases-workload-identity
2
+
3
+ Canonical bases are protocol neutral: reference resolution, credential provision and verification, delegated provision, and trust-material resolution. SPIFFE-named exports are temporary compatibility bases for existing providers.
@@ -0,0 +1,13 @@
1
+ [project]
2
+ name = "tba-bases-workload-identity"
3
+ version = "0.4.0.dev2"
4
+ description = "Protocol-neutral workload reference, credential, verification, delegation, and trust-material bases."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10,<3.15"
7
+ license = "Apache-2.0"
8
+ dependencies = ["tba-contracts-workload-identity==0.4.0.dev2"]
9
+ [build-system]
10
+ requires = ["poetry-core>=1.0.0"]
11
+ build-backend = "poetry.core.masonry.api"
12
+ [tool.poetry]
13
+ packages = [{ include = "tba_bases_workload_identity", from = "src" }]
@@ -0,0 +1,101 @@
1
+ """Reusable protocol-neutral workload-identity bases."""
2
+
3
+ from abc import ABC
4
+
5
+ from tba_contracts_workload_identity import (
6
+ DelegatedWorkloadCredentialProviderPort,
7
+ DelegatedWorkloadCredentialRequest,
8
+ ResolvedWorkload,
9
+ SpiffeId,
10
+ SpiffeTrustBundle,
11
+ Svid,
12
+ SvidProviderPort,
13
+ SvidVerifierPort,
14
+ TrustBundleProviderPort,
15
+ TrustDomain,
16
+ WorkloadCredential,
17
+ WorkloadCredentialProviderPort,
18
+ WorkloadCredentialRequest,
19
+ WorkloadCredentialSet,
20
+ WorkloadCredentialVerifierPort,
21
+ WorkloadIdentityRef,
22
+ WorkloadReference,
23
+ WorkloadReferenceResolverPort,
24
+ WorkloadTrustMaterial,
25
+ WorkloadTrustMaterialProviderPort,
26
+ )
27
+
28
+
29
+ class WorkloadReferenceResolverBase(WorkloadReferenceResolverPort, ABC):
30
+ def resolve(self, reference: WorkloadReference, /) -> ResolvedWorkload:
31
+ raise NotImplementedError
32
+
33
+
34
+ class WorkloadCredentialProviderBase(WorkloadCredentialProviderPort, ABC):
35
+ def obtain(self, request: WorkloadCredentialRequest, /) -> WorkloadCredentialSet:
36
+ raise NotImplementedError
37
+
38
+
39
+ class DelegatedWorkloadCredentialProviderBase(
40
+ DelegatedWorkloadCredentialProviderPort,
41
+ ABC,
42
+ ):
43
+ def obtain_for(
44
+ self,
45
+ request: DelegatedWorkloadCredentialRequest,
46
+ /,
47
+ ) -> WorkloadCredentialSet:
48
+ raise NotImplementedError
49
+
50
+
51
+ class WorkloadCredentialVerifierBase(WorkloadCredentialVerifierPort, ABC):
52
+ def verify(
53
+ self,
54
+ credential: WorkloadCredential,
55
+ expected_identity: WorkloadIdentityRef | None = None,
56
+ /,
57
+ ) -> WorkloadIdentityRef:
58
+ raise NotImplementedError
59
+
60
+
61
+ class WorkloadTrustMaterialProviderBase(
62
+ WorkloadTrustMaterialProviderPort,
63
+ ABC,
64
+ ):
65
+ def trust_material_for(
66
+ self,
67
+ identity: WorkloadIdentityRef,
68
+ format: str,
69
+ /,
70
+ ) -> WorkloadTrustMaterial:
71
+ raise NotImplementedError
72
+
73
+
74
+ # Compatibility bases for the existing SPIFFE-named layer-20 providers. New
75
+ # providers must implement the neutral bases above; these leave layer 05 after
76
+ # those providers are migrated.
77
+ class SvidProviderBase(SvidProviderPort, ABC):
78
+ def fetch_svid(self, audience: str | None = None, /) -> Svid:
79
+ raise NotImplementedError
80
+
81
+
82
+ class SvidVerifierBase(SvidVerifierPort, ABC):
83
+ def verify_svid(self, svid: Svid, audience: str | None = None, /) -> SpiffeId:
84
+ raise NotImplementedError
85
+
86
+
87
+ class TrustBundleProviderBase(TrustBundleProviderPort, ABC):
88
+ def bundle_for(self, trust_domain: TrustDomain, /) -> SpiffeTrustBundle:
89
+ raise NotImplementedError
90
+
91
+
92
+ __all__ = [
93
+ "DelegatedWorkloadCredentialProviderBase",
94
+ "SvidProviderBase",
95
+ "SvidVerifierBase",
96
+ "TrustBundleProviderBase",
97
+ "WorkloadCredentialProviderBase",
98
+ "WorkloadCredentialVerifierBase",
99
+ "WorkloadReferenceResolverBase",
100
+ "WorkloadTrustMaterialProviderBase",
101
+ ]