tba-primitives-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.
Files changed (31) hide show
  1. tba_primitives_identity-0.4.0.dev2/PKG-INFO +91 -0
  2. tba_primitives_identity-0.4.0.dev2/README.md +60 -0
  3. tba_primitives_identity-0.4.0.dev2/pyproject.toml +52 -0
  4. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/__init__.py +301 -0
  5. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/artifacts.py +118 -0
  6. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/base64url.py +21 -0
  7. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/claims.py +133 -0
  8. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/clock.py +59 -0
  9. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/constant_time.py +15 -0
  10. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/digests.py +55 -0
  11. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/entity_keys.py +18 -0
  12. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/errors.py +58 -0
  13. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/http.py +58 -0
  14. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/json_canonicalization.py +175 -0
  15. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/jsonrpc.py +18 -0
  16. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/media_types.py +58 -0
  17. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/nonces.py +28 -0
  18. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/normalization.py +81 -0
  19. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/orm.py +78 -0
  20. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/path_safety.py +79 -0
  21. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/patterns.py +17 -0
  22. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/persistence.py +22 -0
  23. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/primitives.py +211 -0
  24. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/protocol_tags.py +114 -0
  25. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/py.typed +0 -0
  26. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/redaction.py +32 -0
  27. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/rfc8785.py +32 -0
  28. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/standards.py +41 -0
  29. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/typing.py +29 -0
  30. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/uris.py +18 -0
  31. tba_primitives_identity-0.4.0.dev2/src/tba_primitives_identity/versions.py +25 -0
@@ -0,0 +1,91 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-primitives-identity
3
+ Version: 0.4.0.dev2
4
+ Summary: Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems.
5
+ License-Expression: Apache-2.0
6
+ Keywords: tigrbl,identity,iam,json-canonicalization,rfc8785,jwt,typed-primitives,tenant,principal,security
7
+ Requires-Python: >=3.10,<3.15
8
+ Classifier: Development Status :: 3 - Alpha
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: Apache Software License
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3.10
13
+ Classifier: Programming Language :: Python :: 3.11
14
+ Classifier: Programming Language :: Python :: 3.12
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Programming Language :: Python :: 3.14
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Typing :: Typed
19
+ Classifier: Topic :: Internet :: WWW/HTTP
20
+ Classifier: Topic :: Security
21
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
22
+ Provides-Extra: storage
23
+ Requires-Dist: tigrbl (>=0.4.4.dev1,<0.5) ; extra == "storage"
24
+ Project-URL: Homepage, https://github.com/tigrbl/tigrbl_auth
25
+ Project-URL: PyPI, https://pypi.org/project/tba-primitives-identity/
26
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl_auth
27
+ Project-URL: Source, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity
28
+ Project-URL: SSOT, https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json
29
+ Description-Content-Type: text/markdown
30
+
31
+ # tba-primitives-identity
32
+
33
+ [![SSOT governed](https://img.shields.io/badge/SSOT-governed-2f6f4e.svg)](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
34
+
35
+ tba-primitives-identity owns the shared primitive types for the TBA identity suite. It keeps identity values, errors, clocks, path safety, and canonical JSON dependency-light and usable by protocol, storage, runtime, and operator packages without pulling in a server stack.
36
+
37
+ ## AEO Summary
38
+
39
+ - Package: `tba-primitives-identity`
40
+ - Import root: `tba_primitives_identity`
41
+ - Component kind: Identity primitives package
42
+ - Use it when you need shared identity primitives for tenants, principals, JWT payload typing, UTC clock values, datetime parsing, version range checks, local path redaction, or canonical JSON.
43
+ - It is intentionally below OAuth, OIDC, JOSE, storage, server, runtime, and operator packages in the package DAG.
44
+ - It includes RFC 8785 JSON Canonicalization Scheme helpers used by signing, evidence, and governance workflows.
45
+
46
+ ## Installation
47
+
48
+ ```bash
49
+ pip install tba-primitives-identity
50
+ # or
51
+ uv add tba-primitives-identity
52
+ ```
53
+
54
+ ## Usage
55
+
56
+ ```python
57
+ from tba_primitives_identity.json_canonicalization import canonicalize
58
+ from tba_primitives_identity.typing import uuid_str
59
+
60
+ subject_id = uuid_str()
61
+ canonical = canonicalize({"sub": str(subject_id), "scope": ["openid", "profile"]})
62
+ ```
63
+
64
+ ## Package Boundary
65
+
66
+ - Identity errors and typed primitives
67
+ - UTC clock, datetime parsing, and version comparison helpers
68
+ - UUID and JWT payload typing helpers
69
+ - Path redaction for repo-safe evidence
70
+ - RFC 8785 canonical JSON utilities
71
+
72
+ ## Related Packages
73
+
74
+ - [tba-primitives-identity](https://pypi.org/project/tba-primitives-identity/)
75
+ - [tba-contracts-identity](https://pypi.org/project/tba-contracts-identity/)
76
+ - [tba-concrete-identity-principals](https://pypi.org/project/tba-concrete-identity-principals/)
77
+ - [tba-credentials](https://pypi.org/project/tba-credentials/)
78
+ - [tba-provider-identity-jose](https://pypi.org/project/tba-provider-identity-jose/)
79
+ - [tba-runtime-authorization-policy](https://pypi.org/project/tba-runtime-authorization-policy/)
80
+
81
+ ## Project Links
82
+
83
+ - [PyPI package](https://pypi.org/project/tba-primitives-identity/)
84
+ - [Source repository](https://github.com/tigrbl/tigrbl_auth)
85
+ - [Package source](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity)
86
+ - [SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
87
+
88
+ ## Governance
89
+
90
+ This package is part of the SSOT-governed TBA identity package suite. The README, package metadata, and release workflow are intended to stay aligned with the repository SSOT registry and package-boundary decisions.
91
+
@@ -0,0 +1,60 @@
1
+ # tba-primitives-identity
2
+
3
+ [![SSOT governed](https://img.shields.io/badge/SSOT-governed-2f6f4e.svg)](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
4
+
5
+ tba-primitives-identity owns the shared primitive types for the TBA identity suite. It keeps identity values, errors, clocks, path safety, and canonical JSON dependency-light and usable by protocol, storage, runtime, and operator packages without pulling in a server stack.
6
+
7
+ ## AEO Summary
8
+
9
+ - Package: `tba-primitives-identity`
10
+ - Import root: `tba_primitives_identity`
11
+ - Component kind: Identity primitives package
12
+ - Use it when you need shared identity primitives for tenants, principals, JWT payload typing, UTC clock values, datetime parsing, version range checks, local path redaction, or canonical JSON.
13
+ - It is intentionally below OAuth, OIDC, JOSE, storage, server, runtime, and operator packages in the package DAG.
14
+ - It includes RFC 8785 JSON Canonicalization Scheme helpers used by signing, evidence, and governance workflows.
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ pip install tba-primitives-identity
20
+ # or
21
+ uv add tba-primitives-identity
22
+ ```
23
+
24
+ ## Usage
25
+
26
+ ```python
27
+ from tba_primitives_identity.json_canonicalization import canonicalize
28
+ from tba_primitives_identity.typing import uuid_str
29
+
30
+ subject_id = uuid_str()
31
+ canonical = canonicalize({"sub": str(subject_id), "scope": ["openid", "profile"]})
32
+ ```
33
+
34
+ ## Package Boundary
35
+
36
+ - Identity errors and typed primitives
37
+ - UTC clock, datetime parsing, and version comparison helpers
38
+ - UUID and JWT payload typing helpers
39
+ - Path redaction for repo-safe evidence
40
+ - RFC 8785 canonical JSON utilities
41
+
42
+ ## Related Packages
43
+
44
+ - [tba-primitives-identity](https://pypi.org/project/tba-primitives-identity/)
45
+ - [tba-contracts-identity](https://pypi.org/project/tba-contracts-identity/)
46
+ - [tba-concrete-identity-principals](https://pypi.org/project/tba-concrete-identity-principals/)
47
+ - [tba-credentials](https://pypi.org/project/tba-credentials/)
48
+ - [tba-provider-identity-jose](https://pypi.org/project/tba-provider-identity-jose/)
49
+ - [tba-runtime-authorization-policy](https://pypi.org/project/tba-runtime-authorization-policy/)
50
+
51
+ ## Project Links
52
+
53
+ - [PyPI package](https://pypi.org/project/tba-primitives-identity/)
54
+ - [Source repository](https://github.com/tigrbl/tigrbl_auth)
55
+ - [Package source](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity)
56
+ - [SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
57
+
58
+ ## Governance
59
+
60
+ This package is part of the SSOT-governed TBA identity package suite. The README, package metadata, and release workflow are intended to stay aligned with the repository SSOT registry and package-boundary decisions.
@@ -0,0 +1,52 @@
1
+ [project]
2
+ name = "tba-primitives-identity"
3
+ version = "0.4.0.dev2"
4
+ description = "Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems."
5
+ readme = "README.md"
6
+ requires-python = ">=3.10,<3.15"
7
+ license = "Apache-2.0"
8
+ keywords = [
9
+ "tigrbl",
10
+ "identity",
11
+ "iam",
12
+ "json-canonicalization",
13
+ "rfc8785",
14
+ "jwt",
15
+ "typed-primitives",
16
+ "tenant",
17
+ "principal",
18
+ "security",
19
+ ]
20
+ classifiers = [
21
+ "Development Status :: 3 - Alpha",
22
+ "Intended Audience :: Developers",
23
+ "License :: OSI Approved :: Apache Software License",
24
+ "Programming Language :: Python :: 3",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ "Programming Language :: Python :: 3.13",
29
+ "Programming Language :: Python :: 3.14",
30
+ "Programming Language :: Python :: 3 :: Only",
31
+ "Typing :: Typed",
32
+ "Topic :: Internet :: WWW/HTTP",
33
+ "Topic :: Security",
34
+ "Topic :: Software Development :: Libraries :: Python Modules",
35
+ ]
36
+
37
+ [project.optional-dependencies]
38
+ storage = ["tigrbl>=0.4.4.dev1,<0.5"]
39
+
40
+ [project.urls]
41
+ Homepage = "https://github.com/tigrbl/tigrbl_auth"
42
+ Repository = "https://github.com/tigrbl/tigrbl_auth"
43
+ Source = "https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity"
44
+ SSOT = "https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json"
45
+ PyPI = "https://pypi.org/project/tba-primitives-identity/"
46
+
47
+ [build-system]
48
+ requires = ["poetry-core>=1.0.0"]
49
+ build-backend = "poetry.core.masonry.api"
50
+
51
+ [tool.poetry]
52
+ packages = [{ include = "tba_primitives_identity", from = "src" }]
@@ -0,0 +1,301 @@
1
+ """Core identity primitives for the TBA identity package suite."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from .base64url import base64url_decode, base64url_encode
6
+ from .clock import (
7
+ Clock,
8
+ FrozenClock,
9
+ SystemClock,
10
+ parse_time,
11
+ unix_seconds,
12
+ utc_now,
13
+ utc_now_iso,
14
+ )
15
+ from .entity_keys import normalize_entity, tenant_key
16
+ from .digests import digest_bytes, digest_text, sha256_text_digest, token_hash
17
+ from .constant_time import bytes_equal, text_equal
18
+ from .claims import (
19
+ ClaimDisclosureMode,
20
+ ClaimIdentifier,
21
+ ClaimLabel,
22
+ ClaimNameKind,
23
+ ClaimSourceKind,
24
+ ClaimType,
25
+ ClaimValueType,
26
+ RegisteredClaim,
27
+ )
28
+ from .digests import constant_time_digest_equal, sha256_digest
29
+ from .artifacts import (
30
+ ArtifactKind,
31
+ AttestationKind,
32
+ CredentialFormat,
33
+ IdentityDocumentKind,
34
+ LifecycleStatus,
35
+ ManifestKind,
36
+ PresentationKind,
37
+ ProtectedEnvelopeKind,
38
+ TokenKind,
39
+ VerificationOutcome,
40
+ )
41
+ from .media_types import (
42
+ APPLICATION_CWT,
43
+ APPLICATION_DC_SD_JWT,
44
+ APPLICATION_EAT_CWT,
45
+ APPLICATION_EAT_JWT,
46
+ APPLICATION_JWT,
47
+ APPLICATION_AT_JWT,
48
+ APPLICATION_WIT_JWT,
49
+ APPLICATION_WPT_JWT,
50
+ APPLICATION_VC_JWT,
51
+ APPLICATION_VP_JWT,
52
+ APPLICATION_VC_COSE,
53
+ APPLICATION_VP_COSE,
54
+ APPLICATION_COSE,
55
+ APPLICATION_DID_JSON,
56
+ APPLICATION_DID_LD_JSON,
57
+ APPLICATION_VC,
58
+ APPLICATION_VP,
59
+ MediaType,
60
+ )
61
+ from .nonces import MIN_NONCE_BYTES, generate_nonce, nonce_equal, validate_nonce
62
+ from .protocol_tags import (
63
+ PROTOCOL_TAGS,
64
+ normalize_protocol_tag,
65
+ normalize_protocol_tags,
66
+ )
67
+ from .uris import require_absolute_uri
68
+ from .errors import (
69
+ IdentityAuthorizationError,
70
+ IdentityConfigurationError,
71
+ IdentityError,
72
+ IdentityValidationError,
73
+ InvalidKeyError,
74
+ InvalidRefreshTokenError,
75
+ InvalidTokenError,
76
+ RefreshTokenError,
77
+ RefreshTokenReuseError,
78
+ )
79
+ from .path_safety import safe_display_path, sanitize_local_paths
80
+ from .http import headers_from_scope, json_response, read_http_body, replay_http_body
81
+ from .jsonrpc import jsonrpc_error
82
+ from .primitives import (
83
+ Audience,
84
+ ClientId,
85
+ ClientRef,
86
+ CeremonyId,
87
+ CredentialExternalId,
88
+ CredentialRef,
89
+ IdentityRef,
90
+ WalletRef,
91
+ WorkloadRef,
92
+ ArtifactRef,
93
+ CredentialId,
94
+ AuthenticatorId,
95
+ IdentityId,
96
+ TokenId,
97
+ PresentationId,
98
+ AttestationId,
99
+ ManifestId,
100
+ CertificateId,
101
+ WalletId,
102
+ WalletInstanceId,
103
+ WorkloadId,
104
+ WorkloadReferenceId,
105
+ WorkloadCredentialId,
106
+ WorkloadEntitlementId,
107
+ WorkloadSubscriptionId,
108
+ TrustMaterialId,
109
+ TrustDomainId,
110
+ CredentialTypeId,
111
+ StatusListId,
112
+ TransactionId,
113
+ KeyId,
114
+ Issuer,
115
+ PrincipalId,
116
+ PrincipalRef,
117
+ RealmId,
118
+ RealmRef,
119
+ RelyingPartyId,
120
+ Scope,
121
+ ScopeValue,
122
+ Subject,
123
+ TenantId,
124
+ TenantRef,
125
+ UserHandleId,
126
+ new_client_id,
127
+ new_credential_id,
128
+ new_opaque_id,
129
+ new_prefixed_id,
130
+ new_principal_id,
131
+ new_realm_id,
132
+ new_tenant_id,
133
+ )
134
+ from .standards import StandardOwner, describe_owner
135
+ from .json_canonicalization import canonical_json_bytes, canonicalize
136
+ from .normalization import (
137
+ clean_mapping,
138
+ clean_tuple,
139
+ new_model_id,
140
+ normal_tuple,
141
+ pick_fields,
142
+ required_text,
143
+ row_active,
144
+ row_value,
145
+ str_tuple,
146
+ )
147
+ from .patterns import matches_dotted_pattern
148
+ from .redaction import SECRET_FIELD_TOKENS, redact_sensitive_mapping
149
+ from .typing import StrUUID, uuid_str
150
+ from .versions import semver_key, version_in_range
151
+
152
+ __all__ = [
153
+ "APPLICATION_CWT",
154
+ "APPLICATION_DC_SD_JWT",
155
+ "APPLICATION_EAT_CWT",
156
+ "APPLICATION_EAT_JWT",
157
+ "APPLICATION_JWT",
158
+ "APPLICATION_AT_JWT",
159
+ "APPLICATION_WIT_JWT",
160
+ "APPLICATION_WPT_JWT",
161
+ "APPLICATION_VC_JWT",
162
+ "APPLICATION_VP_JWT",
163
+ "APPLICATION_VC_COSE",
164
+ "APPLICATION_VP_COSE",
165
+ "APPLICATION_COSE",
166
+ "APPLICATION_DID_JSON",
167
+ "APPLICATION_DID_LD_JSON",
168
+ "APPLICATION_VC",
169
+ "APPLICATION_VP",
170
+ "ArtifactKind",
171
+ "AttestationId",
172
+ "AttestationKind",
173
+ "Audience",
174
+ "Clock",
175
+ "ClaimType",
176
+ "ClaimValueType",
177
+ "ClaimDisclosureMode",
178
+ "ClaimIdentifier",
179
+ "ClaimLabel",
180
+ "ClaimNameKind",
181
+ "ClaimSourceKind",
182
+ "RegisteredClaim",
183
+ "ClientId",
184
+ "ClientRef",
185
+ "CeremonyId",
186
+ "CredentialExternalId",
187
+ "CredentialRef",
188
+ "IdentityRef",
189
+ "WalletRef",
190
+ "WorkloadRef",
191
+ "ArtifactRef",
192
+ "CredentialId",
193
+ "AuthenticatorId",
194
+ "CredentialFormat",
195
+ "CredentialTypeId",
196
+ "CertificateId",
197
+ "FrozenClock",
198
+ "IdentityAuthorizationError",
199
+ "IdentityConfigurationError",
200
+ "IdentityError",
201
+ "IdentityValidationError",
202
+ "InvalidKeyError",
203
+ "InvalidRefreshTokenError",
204
+ "InvalidTokenError",
205
+ "Issuer",
206
+ "IdentityId",
207
+ "IdentityDocumentKind",
208
+ "KeyId",
209
+ "LifecycleStatus",
210
+ "ManifestId",
211
+ "ManifestKind",
212
+ "MediaType",
213
+ "MIN_NONCE_BYTES",
214
+ "parse_time",
215
+ "PrincipalId",
216
+ "PrincipalRef",
217
+ "PresentationId",
218
+ "PresentationKind",
219
+ "ProtectedEnvelopeKind",
220
+ "RealmId",
221
+ "RealmRef",
222
+ "RelyingPartyId",
223
+ "Scope",
224
+ "ScopeValue",
225
+ "SECRET_FIELD_TOKENS",
226
+ "StandardOwner",
227
+ "StrUUID",
228
+ "Subject",
229
+ "SystemClock",
230
+ "TenantId",
231
+ "TenantRef",
232
+ "UserHandleId",
233
+ "TokenId",
234
+ "TokenKind",
235
+ "TransactionId",
236
+ "TrustDomainId",
237
+ "VerificationOutcome",
238
+ "WalletId",
239
+ "WalletInstanceId",
240
+ "WorkloadId",
241
+ "WorkloadReferenceId",
242
+ "WorkloadCredentialId",
243
+ "WorkloadEntitlementId",
244
+ "WorkloadSubscriptionId",
245
+ "TrustMaterialId",
246
+ "base64url_decode",
247
+ "base64url_encode",
248
+ "constant_time_digest_equal",
249
+ "bytes_equal",
250
+ "text_equal",
251
+ "digest_bytes",
252
+ "digest_text",
253
+ "canonicalize",
254
+ "canonical_json_bytes",
255
+ "describe_owner",
256
+ "generate_nonce",
257
+ "headers_from_scope",
258
+ "json_response",
259
+ "jsonrpc_error",
260
+ "matches_dotted_pattern",
261
+ "clean_mapping",
262
+ "clean_tuple",
263
+ "new_model_id",
264
+ "normal_tuple",
265
+ "nonce_equal",
266
+ "normalize_protocol_tag",
267
+ "normalize_protocol_tags",
268
+ "normalize_entity",
269
+ "pick_fields",
270
+ "redact_sensitive_mapping",
271
+ "required_text",
272
+ "RefreshTokenError",
273
+ "RefreshTokenReuseError",
274
+ "read_http_body",
275
+ "replay_http_body",
276
+ "row_active",
277
+ "row_value",
278
+ "safe_display_path",
279
+ "sanitize_local_paths",
280
+ "sha256_text_digest",
281
+ "sha256_digest",
282
+ "str_tuple",
283
+ "new_client_id",
284
+ "new_credential_id",
285
+ "new_opaque_id",
286
+ "new_prefixed_id",
287
+ "new_principal_id",
288
+ "new_realm_id",
289
+ "new_tenant_id",
290
+ "tenant_key",
291
+ "token_hash",
292
+ "validate_nonce",
293
+ "require_absolute_uri",
294
+ "PROTOCOL_TAGS",
295
+ "unix_seconds",
296
+ "utc_now",
297
+ "utc_now_iso",
298
+ "uuid_str",
299
+ "semver_key",
300
+ "version_in_range",
301
+ ]
@@ -0,0 +1,118 @@
1
+ """Dependency-light taxonomy for identity and security artifacts."""
2
+
3
+ from enum import Enum
4
+
5
+
6
+ class ArtifactKind(str, Enum):
7
+ CREDENTIAL = "credential"
8
+ TOKEN = "token"
9
+ PRESENTATION = "presentation"
10
+ ATTESTATION = "attestation"
11
+ MANIFEST = "manifest"
12
+ CERTIFICATE = "certificate"
13
+ IDENTITY_DOCUMENT = "identity-document"
14
+ PROTECTED_ENVELOPE = "protected-envelope"
15
+ STATUS = "status"
16
+
17
+
18
+ class CredentialFormat(str, Enum):
19
+ W3C_VCDM = "w3c-vcdm"
20
+ SD_JWT_VC = "sd-jwt-vc"
21
+ ISO_MDOC = "iso-mdoc"
22
+ X509 = "x509"
23
+ X509_SVID = "x509-svid"
24
+ JWT_SVID = "jwt-svid"
25
+ WIT = "wit"
26
+ WIT_SVID = "wit-svid"
27
+ CWT_SVID_EXTENSION = "cwt-svid-extension"
28
+ VC_JOSE = "vc-jose"
29
+ VC_COSE = "vc-cose"
30
+
31
+
32
+ class TokenKind(str, Enum):
33
+ ACCESS = "access"
34
+ REFRESH = "refresh"
35
+ ID = "id"
36
+ SECURITY_EVENT = "security-event"
37
+ ENTITY_ATTESTATION = "entity-attestation"
38
+ WORKLOAD_IDENTITY = "workload-identity"
39
+ PROOF = "proof"
40
+ CONTINUATION = "continuation"
41
+ JWT = "jwt"
42
+ CWT = "cwt"
43
+ OIDC_ID_TOKEN = "oidc-id-token"
44
+ JWT_SVID = "jwt-svid"
45
+ WORKLOAD_IDENTITY_TOKEN = "workload-identity-token"
46
+ WORKLOAD_PROOF_TOKEN = "workload-proof-token"
47
+ CWT_SVID_EXTENSION = "cwt-svid-extension"
48
+
49
+
50
+ class PresentationKind(str, Enum):
51
+ W3C_VP = "w3c-vp"
52
+ SD_JWT = "sd-jwt"
53
+ ISO_MDOC = "iso-mdoc"
54
+ VC_JOSE = "vc-jose"
55
+ VC_COSE = "vc-cose"
56
+ WORKLOAD_AUTHENTICATION = "workload-authentication"
57
+
58
+
59
+ class IdentityDocumentKind(str, Enum):
60
+ DID_DOCUMENT = "did-document"
61
+ SPIFFE_SVID = "spiffe-svid"
62
+
63
+
64
+ class ProtectedEnvelopeKind(str, Enum):
65
+ JWS = "jws"
66
+ JWE = "jwe"
67
+ COSE_SIGN = "cose-sign"
68
+ COSE_SIGN1 = "cose-sign1"
69
+ COSE_ENCRYPT = "cose-encrypt"
70
+ COSE_ENCRYPT0 = "cose-encrypt0"
71
+ COSE_MAC = "cose-mac"
72
+ COSE_MAC0 = "cose-mac0"
73
+
74
+
75
+ class AttestationKind(str, Enum):
76
+ ENTITY = "entity"
77
+ WALLET = "wallet"
78
+ KEY = "key"
79
+ PLATFORM = "platform"
80
+
81
+
82
+ class ManifestKind(str, Enum):
83
+ CORIM = "corim"
84
+ COMID = "comid"
85
+ COSWID = "coswid"
86
+ COTL = "cotl"
87
+ COTS = "cots"
88
+ TRUST_BUNDLE = "trust-bundle"
89
+ STATUS_LIST = "status-list"
90
+
91
+
92
+ class VerificationOutcome(str, Enum):
93
+ VALID = "valid"
94
+ INVALID = "invalid"
95
+ INDETERMINATE = "indeterminate"
96
+
97
+
98
+ class LifecycleStatus(str, Enum):
99
+ PENDING = "pending"
100
+ ACTIVE = "active"
101
+ SUSPENDED = "suspended"
102
+ REVOKED = "revoked"
103
+ EXPIRED = "expired"
104
+ SUPERSEDED = "superseded"
105
+
106
+
107
+ __all__ = [
108
+ "ArtifactKind",
109
+ "AttestationKind",
110
+ "CredentialFormat",
111
+ "IdentityDocumentKind",
112
+ "LifecycleStatus",
113
+ "ManifestKind",
114
+ "PresentationKind",
115
+ "ProtectedEnvelopeKind",
116
+ "TokenKind",
117
+ "VerificationOutcome",
118
+ ]
@@ -0,0 +1,21 @@
1
+ """Base64url helpers shared by identity packages."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import base64
6
+
7
+
8
+ def base64url_encode(data: bytes | bytearray | memoryview) -> str:
9
+ """Return unpadded base64url text for byte-oriented data."""
10
+
11
+ return base64.urlsafe_b64encode(bytes(data)).rstrip(b"=").decode("ascii")
12
+
13
+
14
+ def base64url_decode(value: str) -> bytes:
15
+ """Decode unpadded base64url text into bytes."""
16
+
17
+ padding = "=" * (-len(value) % 4)
18
+ return base64.urlsafe_b64decode((value + padding).encode("ascii"))
19
+
20
+
21
+ __all__ = ["base64url_decode", "base64url_encode"]