tba-contracts-identity-assurance 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,12 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-contracts-identity-assurance
3
+ Version: 0.4.0.dev2
4
+ Summary: Protocol-neutral identity assurance contracts.
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
@@ -0,0 +1,14 @@
1
+ [project]
2
+ name = "tba-contracts-identity-assurance"
3
+ version = "0.4.0.dev2"
4
+ description = "Protocol-neutral identity assurance contracts."
5
+ requires-python = ">=3.10,<3.15"
6
+ license = "Apache-2.0"
7
+ dependencies = []
8
+
9
+ [build-system]
10
+ requires = ["poetry-core>=1.0.0"]
11
+ build-backend = "poetry.core.masonry.api"
12
+
13
+ [tool.poetry]
14
+ packages = [{ include = "tba_contracts_identity_assurance", from = "src" }]
@@ -0,0 +1,4 @@
1
+ from .models import *
2
+ from .operations import *
3
+
4
+ __all__ = [name for name in globals() if not name.startswith("_")]
@@ -0,0 +1,46 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import Any, Mapping, Sequence
3
+
4
+
5
+ @dataclass(frozen=True, slots=True)
6
+ class AssuranceEvidence:
7
+ type: str
8
+ attributes: Mapping[str, Any] = field(default_factory=dict)
9
+
10
+ def __post_init__(self) -> None:
11
+ if not self.type.strip():
12
+ raise ValueError("assurance evidence type must not be empty")
13
+
14
+
15
+ @dataclass(frozen=True, slots=True)
16
+ class VerificationMetadata:
17
+ trust_framework: str
18
+ assurance_level: str | None = None
19
+ assurance_process: Mapping[str, Any] | None = None
20
+ time: str | None = None
21
+ verification_process: str | None = None
22
+ evidence: Sequence[AssuranceEvidence] = ()
23
+
24
+ def __post_init__(self) -> None:
25
+ if not self.trust_framework.strip():
26
+ raise ValueError("trust_framework must not be empty")
27
+
28
+
29
+ @dataclass(frozen=True, slots=True)
30
+ class VerifiedClaims:
31
+ verification: VerificationMetadata
32
+ claims: Mapping[str, Any]
33
+
34
+
35
+ @dataclass(frozen=True, slots=True)
36
+ class VerifiedClaimsRequest:
37
+ claims: Mapping[str, Any]
38
+ verification: Mapping[str, Any] = field(default_factory=dict)
39
+
40
+
41
+ __all__ = [
42
+ "AssuranceEvidence",
43
+ "VerificationMetadata",
44
+ "VerifiedClaims",
45
+ "VerifiedClaimsRequest",
46
+ ]
@@ -0,0 +1,39 @@
1
+ from dataclasses import dataclass, field
2
+ from typing import Mapping, Protocol, Sequence
3
+
4
+ from .models import VerifiedClaims, VerifiedClaimsRequest
5
+
6
+
7
+ @dataclass(frozen=True, slots=True)
8
+ class IdentityAssuranceRequest:
9
+ verified_claims: VerifiedClaimsRequest
10
+ purpose: str | None = None
11
+ max_age: int | None = None
12
+
13
+
14
+ @dataclass(frozen=True, slots=True)
15
+ class IdentityAssuranceResult:
16
+ verified_claims: VerifiedClaims | None
17
+ satisfied: bool
18
+ errors: Sequence[str] = ()
19
+ metadata: Mapping[str, object] = field(default_factory=dict)
20
+
21
+
22
+ class IdentityAssuranceClaimsProviderPort(Protocol):
23
+ def provide(
24
+ self, subject: str, request: IdentityAssuranceRequest, /
25
+ ) -> IdentityAssuranceResult: ...
26
+
27
+
28
+ class VerifiedClaimsValidatorPort(Protocol):
29
+ def validate(
30
+ self, verified_claims: VerifiedClaims, /
31
+ ) -> IdentityAssuranceResult: ...
32
+
33
+
34
+ __all__ = [
35
+ "IdentityAssuranceClaimsProviderPort",
36
+ "IdentityAssuranceRequest",
37
+ "IdentityAssuranceResult",
38
+ "VerifiedClaimsValidatorPort",
39
+ ]