tba-primitives-identity 0.4.0.dev2__tar.gz → 0.4.0.dev4__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 (36) hide show
  1. tba_primitives_identity-0.4.0.dev4/LICENSE +201 -0
  2. tba_primitives_identity-0.4.0.dev4/NOTICE +10 -0
  3. tba_primitives_identity-0.4.0.dev4/PKG-INFO +216 -0
  4. tba_primitives_identity-0.4.0.dev4/README.md +179 -0
  5. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/pyproject.toml +16 -10
  6. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/claims.py +1 -1
  7. tba_primitives_identity-0.4.0.dev4/src/tba_primitives_identity/enum_compat.py +11 -0
  8. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/json_canonicalization.py +16 -5
  9. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/rfc8785.py +3 -3
  10. tba_primitives_identity-0.4.0.dev2/PKG-INFO +0 -91
  11. tba_primitives_identity-0.4.0.dev2/README.md +0 -60
  12. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/__init__.py +0 -0
  13. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/artifacts.py +0 -0
  14. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/base64url.py +0 -0
  15. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/clock.py +0 -0
  16. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/constant_time.py +0 -0
  17. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/digests.py +0 -0
  18. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/entity_keys.py +0 -0
  19. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/errors.py +0 -0
  20. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/http.py +0 -0
  21. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/jsonrpc.py +0 -0
  22. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/media_types.py +0 -0
  23. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/nonces.py +0 -0
  24. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/normalization.py +0 -0
  25. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/orm.py +0 -0
  26. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/path_safety.py +0 -0
  27. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/patterns.py +0 -0
  28. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/persistence.py +0 -0
  29. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/primitives.py +0 -0
  30. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/protocol_tags.py +0 -0
  31. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/py.typed +0 -0
  32. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/redaction.py +0 -0
  33. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/standards.py +0 -0
  34. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/typing.py +0 -0
  35. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/uris.py +0 -0
  36. {tba_primitives_identity-0.4.0.dev2 → tba_primitives_identity-0.4.0.dev4}/src/tba_primitives_identity/versions.py +0 -0
@@ -0,0 +1,201 @@
1
+ Apache License
2
+ Version 2.0, January 2004
3
+ http://www.apache.org/licenses/
4
+
5
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6
+
7
+ 1. Definitions.
8
+
9
+ "License" shall mean the terms and conditions for use, reproduction,
10
+ and distribution as defined by Sections 1 through 9 of this document.
11
+
12
+ "Licensor" shall mean the copyright owner or entity authorized by
13
+ the copyright owner that is granting the License.
14
+
15
+ "Legal Entity" shall mean the union of the acting entity and all
16
+ other entities that control, are controlled by, or are under common
17
+ control with that entity. For the purposes of this definition,
18
+ "control" means (i) the power, direct or indirect, to cause the
19
+ direction or management of such entity, whether by contract or
20
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
21
+ outstanding shares, or (iii) beneficial ownership of such entity.
22
+
23
+ "You" (or "Your") shall mean an individual or Legal Entity
24
+ exercising permissions granted by this License.
25
+
26
+ "Source" form shall mean the preferred form for making modifications,
27
+ including but not limited to software source code, documentation
28
+ source, and configuration files.
29
+
30
+ "Object" form shall mean any form resulting from mechanical
31
+ transformation or translation of a Source form, including but
32
+ not limited to compiled object code, generated documentation,
33
+ and conversions to other media types.
34
+
35
+ "Work" shall mean the work of authorship, whether in Source or
36
+ Object form, made available under the License, as indicated by a
37
+ copyright notice that is included in or attached to the work
38
+ (an example is provided in the Appendix below).
39
+
40
+ "Derivative Works" shall mean any work, whether in Source or Object
41
+ form, that is based on (or derived from) the Work and for which the
42
+ editorial revisions, annotations, elaborations, or other modifications
43
+ represent, as a whole, an original work of authorship. For the purposes
44
+ of this License, Derivative Works shall not include works that remain
45
+ separable from, or merely link (or bind by name) to the interfaces of,
46
+ the Work and Derivative Works thereof.
47
+
48
+ "Contribution" shall mean any work of authorship, including
49
+ the original version of the Work and any modifications or additions
50
+ to that Work or Derivative Works thereof, that is intentionally
51
+ submitted to Licensor for inclusion in the Work by the copyright owner
52
+ or by an individual or Legal Entity authorized to submit on behalf of
53
+ the copyright owner. For the purposes of this definition, "submitted"
54
+ means any form of electronic, verbal, or written communication sent
55
+ to the Licensor or its representatives, including but not limited to
56
+ communication on electronic mailing lists, source code control systems,
57
+ and issue tracking systems that are managed by, or on behalf of, the
58
+ Licensor for the purpose of discussing and improving the Work, but
59
+ excluding communication that is conspicuously marked or otherwise
60
+ designated in writing by the copyright owner as "Not a Contribution."
61
+
62
+ "Contributor" shall mean Licensor and any individual or Legal Entity
63
+ on behalf of whom a Contribution has been received by Licensor and
64
+ subsequently incorporated within the Work.
65
+
66
+ 2. Grant of Copyright License. Subject to the terms and conditions of
67
+ this License, each Contributor hereby grants to You a perpetual,
68
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69
+ copyright license to reproduce, prepare Derivative Works of,
70
+ publicly display, publicly perform, sublicense, and distribute the
71
+ Work and such Derivative Works in Source or Object form.
72
+
73
+ 3. Grant of Patent License. Subject to the terms and conditions of
74
+ this License, each Contributor hereby grants to You a perpetual,
75
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76
+ (except as stated in this section) patent license to make, have made,
77
+ use, offer to sell, sell, import, and otherwise transfer the Work,
78
+ where such license applies only to those patent claims licensable
79
+ by such Contributor that are necessarily infringed by their
80
+ Contribution(s) alone or by combination of their Contribution(s)
81
+ with the Work to which such Contribution(s) was submitted. If You
82
+ institute patent litigation against any entity (including a
83
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
84
+ or a Contribution incorporated within the Work constitutes direct
85
+ or contributory patent infringement, then any patent licenses
86
+ granted to You under this License for that Work shall terminate
87
+ as of the date such litigation is filed.
88
+
89
+ 4. Redistribution. You may reproduce and distribute copies of the
90
+ Work or Derivative Works thereof in any medium, with or without
91
+ modifications, and in Source or Object form, provided that You
92
+ meet the following conditions:
93
+
94
+ (a) You must give any other recipients of the Work or
95
+ Derivative Works a copy of this License; and
96
+
97
+ (b) You must cause any modified files to carry prominent notices
98
+ stating that You changed the files; and
99
+
100
+ (c) You must retain, in the Source form of any Derivative Works
101
+ that You distribute, all copyright, patent, trademark, and
102
+ attribution notices from the Source form of the Work,
103
+ excluding those notices that do not pertain to any part of
104
+ the Derivative Works; and
105
+
106
+ (d) If the Work includes a "NOTICE" text file as part of its
107
+ distribution, then any Derivative Works that You distribute must
108
+ include a readable copy of the attribution notices contained
109
+ within such NOTICE file, excluding those notices that do not
110
+ pertain to any part of the Derivative Works, in at least one
111
+ of the following places: within a NOTICE text file distributed
112
+ as part of the Derivative Works; within the Source form or
113
+ documentation, if provided along with the Derivative Works; or,
114
+ within a display generated by the Derivative Works, if and
115
+ wherever such third-party notices normally appear. The contents
116
+ of the NOTICE file are for informational purposes only and
117
+ do not modify the License. You may add Your own attribution
118
+ notices within Derivative Works that You distribute, alongside
119
+ or as an addendum to the NOTICE text from the Work, provided
120
+ that such additional attribution notices cannot be construed
121
+ as modifying the License.
122
+
123
+ You may add Your own copyright statement to Your modifications and
124
+ may provide additional or different license terms and conditions
125
+ for use, reproduction, or distribution of Your modifications, or
126
+ for any such Derivative Works as a whole, provided Your use,
127
+ reproduction, and distribution of the Work otherwise complies with
128
+ the conditions stated in this License.
129
+
130
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
131
+ any Contribution intentionally submitted for inclusion in the Work
132
+ by You to the Licensor shall be under the terms and conditions of
133
+ this License, without any additional terms or conditions.
134
+ Notwithstanding the above, nothing herein shall supersede or modify
135
+ the terms of any separate license agreement you may have executed
136
+ with Licensor regarding such Contributions.
137
+
138
+ 6. Trademarks. This License does not grant permission to use the trade
139
+ names, trademarks, service marks, or product names of the Licensor,
140
+ except as required for reasonable and customary use in describing the
141
+ origin of the Work and reproducing the content of the NOTICE file.
142
+
143
+ 7. Disclaimer of Warranty. Unless required by applicable law or
144
+ agreed to in writing, Licensor provides the Work (and each
145
+ Contributor provides its Contributions) on an "AS IS" BASIS,
146
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147
+ implied, including, without limitation, any warranties or conditions
148
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149
+ PARTICULAR PURPOSE. You are solely responsible for determining the
150
+ appropriateness of using or redistributing the Work and assume any
151
+ risks associated with Your exercise of permissions under this License.
152
+
153
+ 8. Limitation of Liability. In no event and under no legal theory,
154
+ whether in tort (including negligence), contract, or otherwise,
155
+ unless required by applicable law (such as deliberate and grossly
156
+ negligent acts) or agreed to in writing, shall any Contributor be
157
+ liable to You for damages, including any direct, indirect, special,
158
+ incidental, or consequential damages of any character arising as a
159
+ result of this License or out of the use or inability to use the
160
+ Work (including but not limited to damages for loss of goodwill,
161
+ work stoppage, computer failure or malfunction, or any and all
162
+ other commercial damages or losses), even if such Contributor
163
+ has been advised of the possibility of such damages.
164
+
165
+ 9. Accepting Warranty or Additional Liability. While redistributing
166
+ the Work or Derivative Works thereof, You may choose to offer,
167
+ and charge a fee for, acceptance of support, warranty, indemnity,
168
+ or other liability obligations and/or rights consistent with this
169
+ License. However, in accepting such obligations, You may act only
170
+ on Your own behalf and on Your sole responsibility, not on behalf
171
+ of any other Contributor, and only if You agree to indemnify,
172
+ defend, and hold each Contributor harmless for any liability
173
+ incurred by, or claims asserted against, such Contributor by reason
174
+ of your accepting any such warranty or additional liability.
175
+
176
+ END OF TERMS AND CONDITIONS
177
+
178
+ APPENDIX: How to apply the Apache License to your work.
179
+
180
+ To apply the Apache License to your work, attach the following
181
+ boilerplate notice, with the fields enclosed by brackets "[]"
182
+ replaced with your own identifying information. (Don't include
183
+ the brackets!) The text should be enclosed in the appropriate
184
+ comment syntax for the file format. We also recommend that a
185
+ file or class name and description of purpose be included on the
186
+ same "printed page" as the copyright notice for easier
187
+ identification within third-party archives.
188
+
189
+ Copyright [yyyy] [name of copyright owner]
190
+
191
+ Licensed under the Apache License, Version 2.0 (the "License");
192
+ you may not use this file except in compliance with the License.
193
+ You may obtain a copy of the License at
194
+
195
+ http://www.apache.org/licenses/LICENSE-2.0
196
+
197
+ Unless required by applicable law or agreed to in writing, software
198
+ distributed under the License is distributed on an "AS IS" BASIS,
199
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200
+ See the License for the specific language governing permissions and
201
+ limitations under the License.
@@ -0,0 +1,10 @@
1
+ Tigrbl Auth (TBA)
2
+
3
+ Project: https://github.com/tigrbl/tigrbl_auth
4
+ Attribution: Jacob Stewart and the Tigrbl Auth contributors.
5
+
6
+ Distributed under the Apache License, Version 2.0.
7
+ See the accompanying LICENSE file for the license terms.
8
+
9
+ Distribution: tba-primitives-identity
10
+ Source: https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity
@@ -0,0 +1,216 @@
1
+ Metadata-Version: 2.4
2
+ Name: tba-primitives-identity
3
+ Version: 0.4.0.dev4
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
+ License-File: LICENSE
7
+ License-File: NOTICE
8
+ Keywords: tigrbl,identity,iam,json-canonicalization,rfc8785,jwt,typed-primitives,tenant,principal,security
9
+ Author: Jacob Stewart
10
+ Author-email: jacob@swarmauri.com
11
+ Requires-Python: >=3.10,<3.16
12
+ Classifier: Development Status :: 3 - Alpha
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3 :: Only
16
+ Classifier: Typing :: Typed
17
+ Classifier: Topic :: Internet :: WWW/HTTP
18
+ Classifier: Topic :: Security
19
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
20
+ Classifier: Programming Language :: Python :: 3.10
21
+ Classifier: Programming Language :: Python :: 3.11
22
+ Classifier: Programming Language :: Python :: 3.12
23
+ Classifier: Programming Language :: Python :: 3.13
24
+ Classifier: Programming Language :: Python :: 3.14
25
+ Classifier: Programming Language :: Python :: 3.15
26
+ Provides-Extra: storage
27
+ Requires-Dist: tigrbl (>=0.4.4.dev1,<0.5) ; extra == "storage"
28
+ Project-URL: Documentation, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity#readme
29
+ Project-URL: Homepage, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity#readme
30
+ Project-URL: Issues, https://github.com/tigrbl/tigrbl_auth/issues
31
+ Project-URL: PyPI, https://pypi.org/project/tba-primitives-identity/
32
+ Project-URL: Repository, https://github.com/tigrbl/tigrbl_auth
33
+ Project-URL: Source, https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity
34
+ Project-URL: SSOT, https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json
35
+ Description-Content-Type: text/markdown
36
+
37
+ # tba-primitives-identity
38
+
39
+ <!-- BEGIN TBA README HEADER -->
40
+ <p align="center">
41
+ <a href="https://github.com/tigrbl/tigrbl_auth#readme"><img src="https://raw.githubusercontent.com/tigrbl/tigrbl_auth/master/docs/assets/tba-brand.png" alt="TBA · Tigrbl Auth" width="240"></a>
42
+ </p>
43
+ <p align="center">
44
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml"><img alt="Checkout: 0.4.0.dev4" src="https://img.shields.io/badge/Checkout-0.4.0.dev4-1f6feb"></a>
45
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml"><img alt="Python: &gt;=3.10,&lt;3.16" src="https://img.shields.io/badge/Python-%3E%3D3.10%2C%3C3.16-3776ab"></a>
46
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/tba-primitives-identity%3D%3D0.4.0.dev4/pkgs/00-primitives/tba-primitives-identity/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/License-Apache--2.0-525252"></a>
47
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/tba-primitives-identity%3D%3D0.4.0.dev4/pkgs/00-primitives/tba-primitives-identity/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/badge/Notice-attribution-525252"></a>
48
+ <a href="https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives"><img alt="Layer: 00 primitives" src="https://img.shields.io/badge/Layer-00%20primitives-0a7f5a"></a>
49
+ <a href="https://pypi.org/project/tba-primitives-identity/"><img alt="PyPI version for tba-primitives-identity" src="https://img.shields.io/pypi/v/tba-primitives-identity?label=tba-primitives-identity%20PyPI"></a>
50
+ </p>
51
+ <p align="center">
52
+ <a href="https://pepy.tech/project/tba-primitives-identity"><img alt="Monthly PyPI downloads for tba-primitives-identity" src="https://static.pepy.tech/badge/tba-primitives-identity/month"></a>
53
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md"><img alt="README hits for tba-primitives-identity" src="https://hits.sh/github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md.svg?label=hits"></a>
54
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json"><img alt="SSOT: governed" src="https://img.shields.io/badge/SSOT-governed-2f6f4e"></a>
55
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md#verification"><img alt="Evidence: verification" src="https://img.shields.io/badge/Evidence-verification-8250df"></a>
56
+ </p>
57
+ <!-- END TBA README HEADER -->
58
+
59
+ Encode and normalize shared identity values without pulling in a server stack.
60
+
61
+ ## AEO Summary
62
+
63
+ - Package: `tba-primitives-identity`
64
+ - Import root: `tba_primitives_identity`
65
+ - Component kind: Identity primitives package
66
+ - 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.
67
+ - It is intentionally below OAuth, OIDC, JOSE, storage, server, runtime, and operator packages in the package DAG.
68
+ - It includes RFC 8785 JSON Canonicalization Scheme helpers used by signing, evidence, and governance workflows.
69
+
70
+ ## When to use it
71
+
72
+ Use these helpers for shared wire values such as base64url, digests, and nonces. The deterministic JSON helpers continue to produce the bytes used by existing policy hashes and key thumbprints.
73
+
74
+ For strict RFC 8785 canonicalization, use [tba-codec-jcs](../../03-codecs/tba-codec-jcs/README.md). The legacy `canonicalize` and `canonicalize_json` imports remain available and emit a `DeprecationWarning` when called. The legacy `tba_primitives_identity.rfc8785` module also warns when imported.
75
+
76
+ ## Installation
77
+
78
+ Install the selected PyPI release of `tba-primitives-identity`:
79
+
80
+ ```bash
81
+ uv pip install tba-primitives-identity
82
+ ```
83
+
84
+ To work on the current checkout before a prepared release is published:
85
+
86
+ ```bash
87
+ uv pip install ./pkgs/00-primitives/tba-primitives-identity
88
+ ```
89
+
90
+ ## Quick start
91
+
92
+ Install the version used by this example.
93
+
94
+ ```bash
95
+ python -m pip install "tba-primitives-identity==0.4.0.dev4"
96
+ ```
97
+
98
+ Save the following as `quickstart.py` and run `python quickstart.py`. The assertions should pass.
99
+
100
+ ```python
101
+ from tba_primitives_identity import base64url_decode, base64url_encode
102
+
103
+ encoded = base64url_encode(b"tba")
104
+ assert encoded == "dGJh"
105
+ assert base64url_decode(encoded) == b"tba"
106
+ ```
107
+
108
+ ## Usage
109
+
110
+ The following public-entry-point example belongs to `tba-primitives-identity`. Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems. Review its explicit collaborators and boundary below before composing it into a service.
111
+
112
+ ```python
113
+ from tba_primitives_identity import base64url_decode, base64url_encode
114
+
115
+ encoded = base64url_encode(b"tba")
116
+ assert encoded == "dGJh"
117
+ assert base64url_decode(encoded) == b"tba"
118
+ ```
119
+
120
+ ## Package Boundary
121
+
122
+ - Identity errors and typed primitives
123
+ - UTC clock, datetime parsing, and version comparison helpers
124
+ - UUID and JWT payload typing helpers
125
+ - Path redaction for repo-safe evidence
126
+ - Deterministic JSON for existing policy hashes and key thumbprints.
127
+
128
+ For strict RFC 8785 canonicalization, use [tba-codec-jcs](../../03-codecs/tba-codec-jcs/README.md). The legacy `canonicalize` and `canonicalize_json` imports remain available and emit a `DeprecationWarning` when called. The legacy `tba_primitives_identity.rfc8785` module also warns when imported.
129
+
130
+ ## Injected dependencies
131
+
132
+ Explicit construction inputs and collaborators for `tba-primitives-identity`:
133
+
134
+ - `generate_nonce` construction inputs: `size`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/nonces.py).
135
+ - `validate_nonce` construction inputs: `min_length`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/nonces.py).
136
+ - `str_tuple` construction inputs: `sort`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/normalization.py).
137
+ - `safe_display_path` construction inputs: `external_label`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/path_safety.py).
138
+ - `require_absolute_uri` construction inputs: `https`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/uris.py).
139
+
140
+ Configuration values are not automatically service implementations. Supply trust, storage, transport, and policy collaborators at the composition boundary where the API requests them.
141
+
142
+ ## Operations and readiness
143
+
144
+ `tba-primitives-identity` exposes shared identity primitives. Public operations found in its source:
145
+
146
+ - `base64url_encode` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/base64url.py).
147
+ - `base64url_decode` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/base64url.py).
148
+ - `Clock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
149
+ - `SystemClock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
150
+ - `FrozenClock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
151
+ - `unix_seconds` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
152
+ - `utc_now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
153
+ - `utc_now_iso` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
154
+ - `parse_time` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
155
+ - `bytes_equal` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/constant_time.py).
156
+ - `text_equal` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/constant_time.py).
157
+ - `digest_bytes` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/digests.py).
158
+
159
+ A successful import or build is a smoke check, not a production-readiness assertion. Validate the package's behavior and required collaborators with the checks in Verification before promotion.
160
+
161
+ ## Protocol consumers
162
+
163
+ The following layer-50 manifests directly depend on `tba-primitives-identity`:
164
+
165
+ - [tba-protocol-credential-iso-mdoc](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-credential-iso-mdoc/README.md)
166
+ - [tba-protocol-credential-w3c-vcdm](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-credential-w3c-vcdm/README.md)
167
+ - [tba-protocol-cwt](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-cwt/README.md)
168
+ - [tba-protocol-oauth](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-oauth/README.md)
169
+ - [tba-protocol-oidc](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-oidc/README.md)
170
+ - [tba-protocol-security-cose](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-cose/README.md)
171
+ - [tba-protocol-security-jose](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jose/README.md)
172
+ - [tba-protocol-security-jwe](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jwe/README.md)
173
+ - [tba-protocol-security-jws](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jws/README.md)
174
+ - [tba-protocol-webauthn](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-webauthn/README.md)
175
+
176
+ Other direct consumers include [tba-app-backend-core](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/90-backend-apps/tba-app-backend-core/README.md), [tba-auth](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/70-facade/tba-auth/README.md), [tba-bases-identity-model](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/05-bases/tba-bases-identity-model/README.md), [tba-capability-access-governance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-access-governance/README.md), [tba-capability-policy-administration](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-policy-administration/README.md), [tba-capability-policy-assurance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-policy-assurance/README.md), [tba-concrete-authorization-provenance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/10-concrete/tba-concrete-authorization-provenance/README.md), [tba-concrete-capability](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/10-concrete/tba-concrete-capability/README.md).
177
+
178
+ ## Non-goals
179
+
180
+ `tba-primitives-identity` does not take ownership of protocol flows, provider selection, or application hosting.
181
+
182
+ Its exports and dependency declarations describe its integration surface; they do not establish deployment readiness, protocol certification, or an implicit production configuration.
183
+
184
+ ## Related Packages
185
+
186
+ - [tba-primitives-identity](https://pypi.org/project/tba-primitives-identity/)
187
+ - [tba-contracts-identity](https://pypi.org/project/tba-contracts-identity/)
188
+ - [tba-concrete-identity-principals](https://pypi.org/project/tba-concrete-identity-principals/)
189
+ - [tba-credentials](https://pypi.org/project/tba-credentials/)
190
+ - [tba-provider-identity-jose](https://pypi.org/project/tba-provider-identity-jose/)
191
+ - [tba-runtime-authorization-policy](https://pypi.org/project/tba-runtime-authorization-policy/)
192
+
193
+ ## Project Links
194
+
195
+ - [Package source](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity)
196
+ - [Package manifest](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml)
197
+ - [LICENSE](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/LICENSE) and [NOTICE](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/NOTICE)
198
+ - [Report an issue](https://github.com/tigrbl/tigrbl_auth/issues)
199
+ - [Package index](https://github.com/tigrbl/tigrbl_auth/blob/master/index.toml)
200
+ - [Canonical SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
201
+ - [PyPI project](https://pypi.org/project/tba-primitives-identity/)
202
+
203
+ ## Governance
204
+
205
+ 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.
206
+
207
+ `tba-primitives-identity` follows the [canonical SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json) and [package index](https://github.com/tigrbl/tigrbl_auth/blob/master/index.toml). Keep its `00-primitives` ownership, public imports, declared dependencies, examples, and release metadata aligned.
208
+
209
+ Changes must pass the [README standards gate](https://github.com/tigrbl/tigrbl_auth/blob/master/.github/workflows/readme-standards.yml), package checks, and the evidence requirements relevant to the changed behavior. Update SSOT through the repository's CLI workflow when changing governed claims or boundaries.
210
+
211
+ ## Verification
212
+
213
+ See the [related repository tests](https://github.com/tigrbl/tigrbl_auth/blob/master/tests/unit/test_identity_package_split_imports.py) for the implementation scope covered by this example.
214
+
215
+ [Workspace and package catalog](https://github.com/tigrbl/tigrbl_auth#package-catalog) · [tba-contracts-identity-document](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/02-contracts/tba-contracts-identity-document#readme) · [Report an issue](https://github.com/tigrbl/tigrbl_auth/issues) · [Repository license](https://github.com/tigrbl/tigrbl_auth/blob/master/LICENSE)
216
+
@@ -0,0 +1,179 @@
1
+ # tba-primitives-identity
2
+
3
+ <!-- BEGIN TBA README HEADER -->
4
+ <p align="center">
5
+ <a href="https://github.com/tigrbl/tigrbl_auth#readme"><img src="https://raw.githubusercontent.com/tigrbl/tigrbl_auth/master/docs/assets/tba-brand.png" alt="TBA · Tigrbl Auth" width="240"></a>
6
+ </p>
7
+ <p align="center">
8
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml"><img alt="Checkout: 0.4.0.dev4" src="https://img.shields.io/badge/Checkout-0.4.0.dev4-1f6feb"></a>
9
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml"><img alt="Python: &gt;=3.10,&lt;3.16" src="https://img.shields.io/badge/Python-%3E%3D3.10%2C%3C3.16-3776ab"></a>
10
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/tba-primitives-identity%3D%3D0.4.0.dev4/pkgs/00-primitives/tba-primitives-identity/LICENSE"><img alt="License: Apache-2.0" src="https://img.shields.io/badge/License-Apache--2.0-525252"></a>
11
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/tba-primitives-identity%3D%3D0.4.0.dev4/pkgs/00-primitives/tba-primitives-identity/NOTICE"><img alt="Notice: attribution" src="https://img.shields.io/badge/Notice-attribution-525252"></a>
12
+ <a href="https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives"><img alt="Layer: 00 primitives" src="https://img.shields.io/badge/Layer-00%20primitives-0a7f5a"></a>
13
+ <a href="https://pypi.org/project/tba-primitives-identity/"><img alt="PyPI version for tba-primitives-identity" src="https://img.shields.io/pypi/v/tba-primitives-identity?label=tba-primitives-identity%20PyPI"></a>
14
+ </p>
15
+ <p align="center">
16
+ <a href="https://pepy.tech/project/tba-primitives-identity"><img alt="Monthly PyPI downloads for tba-primitives-identity" src="https://static.pepy.tech/badge/tba-primitives-identity/month"></a>
17
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md"><img alt="README hits for tba-primitives-identity" src="https://hits.sh/github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md.svg?label=hits"></a>
18
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json"><img alt="SSOT: governed" src="https://img.shields.io/badge/SSOT-governed-2f6f4e"></a>
19
+ <a href="https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/README.md#verification"><img alt="Evidence: verification" src="https://img.shields.io/badge/Evidence-verification-8250df"></a>
20
+ </p>
21
+ <!-- END TBA README HEADER -->
22
+
23
+ Encode and normalize shared identity values without pulling in a server stack.
24
+
25
+ ## AEO Summary
26
+
27
+ - Package: `tba-primitives-identity`
28
+ - Import root: `tba_primitives_identity`
29
+ - Component kind: Identity primitives package
30
+ - 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.
31
+ - It is intentionally below OAuth, OIDC, JOSE, storage, server, runtime, and operator packages in the package DAG.
32
+ - It includes RFC 8785 JSON Canonicalization Scheme helpers used by signing, evidence, and governance workflows.
33
+
34
+ ## When to use it
35
+
36
+ Use these helpers for shared wire values such as base64url, digests, and nonces. The deterministic JSON helpers continue to produce the bytes used by existing policy hashes and key thumbprints.
37
+
38
+ For strict RFC 8785 canonicalization, use [tba-codec-jcs](../../03-codecs/tba-codec-jcs/README.md). The legacy `canonicalize` and `canonicalize_json` imports remain available and emit a `DeprecationWarning` when called. The legacy `tba_primitives_identity.rfc8785` module also warns when imported.
39
+
40
+ ## Installation
41
+
42
+ Install the selected PyPI release of `tba-primitives-identity`:
43
+
44
+ ```bash
45
+ uv pip install tba-primitives-identity
46
+ ```
47
+
48
+ To work on the current checkout before a prepared release is published:
49
+
50
+ ```bash
51
+ uv pip install ./pkgs/00-primitives/tba-primitives-identity
52
+ ```
53
+
54
+ ## Quick start
55
+
56
+ Install the version used by this example.
57
+
58
+ ```bash
59
+ python -m pip install "tba-primitives-identity==0.4.0.dev4"
60
+ ```
61
+
62
+ Save the following as `quickstart.py` and run `python quickstart.py`. The assertions should pass.
63
+
64
+ ```python
65
+ from tba_primitives_identity import base64url_decode, base64url_encode
66
+
67
+ encoded = base64url_encode(b"tba")
68
+ assert encoded == "dGJh"
69
+ assert base64url_decode(encoded) == b"tba"
70
+ ```
71
+
72
+ ## Usage
73
+
74
+ The following public-entry-point example belongs to `tba-primitives-identity`. Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems. Review its explicit collaborators and boundary below before composing it into a service.
75
+
76
+ ```python
77
+ from tba_primitives_identity import base64url_decode, base64url_encode
78
+
79
+ encoded = base64url_encode(b"tba")
80
+ assert encoded == "dGJh"
81
+ assert base64url_decode(encoded) == b"tba"
82
+ ```
83
+
84
+ ## Package Boundary
85
+
86
+ - Identity errors and typed primitives
87
+ - UTC clock, datetime parsing, and version comparison helpers
88
+ - UUID and JWT payload typing helpers
89
+ - Path redaction for repo-safe evidence
90
+ - Deterministic JSON for existing policy hashes and key thumbprints.
91
+
92
+ For strict RFC 8785 canonicalization, use [tba-codec-jcs](../../03-codecs/tba-codec-jcs/README.md). The legacy `canonicalize` and `canonicalize_json` imports remain available and emit a `DeprecationWarning` when called. The legacy `tba_primitives_identity.rfc8785` module also warns when imported.
93
+
94
+ ## Injected dependencies
95
+
96
+ Explicit construction inputs and collaborators for `tba-primitives-identity`:
97
+
98
+ - `generate_nonce` construction inputs: `size`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/nonces.py).
99
+ - `validate_nonce` construction inputs: `min_length`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/nonces.py).
100
+ - `str_tuple` construction inputs: `sort`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/normalization.py).
101
+ - `safe_display_path` construction inputs: `external_label`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/path_safety.py).
102
+ - `require_absolute_uri` construction inputs: `https`. [Definition](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/uris.py).
103
+
104
+ Configuration values are not automatically service implementations. Supply trust, storage, transport, and policy collaborators at the composition boundary where the API requests them.
105
+
106
+ ## Operations and readiness
107
+
108
+ `tba-primitives-identity` exposes shared identity primitives. Public operations found in its source:
109
+
110
+ - `base64url_encode` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/base64url.py).
111
+ - `base64url_decode` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/base64url.py).
112
+ - `Clock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
113
+ - `SystemClock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
114
+ - `FrozenClock.now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
115
+ - `unix_seconds` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
116
+ - `utc_now` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
117
+ - `utc_now_iso` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
118
+ - `parse_time` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/clock.py).
119
+ - `bytes_equal` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/constant_time.py).
120
+ - `text_equal` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/constant_time.py).
121
+ - `digest_bytes` — [source](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/src/tba_primitives_identity/digests.py).
122
+
123
+ A successful import or build is a smoke check, not a production-readiness assertion. Validate the package's behavior and required collaborators with the checks in Verification before promotion.
124
+
125
+ ## Protocol consumers
126
+
127
+ The following layer-50 manifests directly depend on `tba-primitives-identity`:
128
+
129
+ - [tba-protocol-credential-iso-mdoc](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-credential-iso-mdoc/README.md)
130
+ - [tba-protocol-credential-w3c-vcdm](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-credential-w3c-vcdm/README.md)
131
+ - [tba-protocol-cwt](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-cwt/README.md)
132
+ - [tba-protocol-oauth](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-oauth/README.md)
133
+ - [tba-protocol-oidc](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-oidc/README.md)
134
+ - [tba-protocol-security-cose](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-cose/README.md)
135
+ - [tba-protocol-security-jose](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jose/README.md)
136
+ - [tba-protocol-security-jwe](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jwe/README.md)
137
+ - [tba-protocol-security-jws](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-security-jws/README.md)
138
+ - [tba-protocol-webauthn](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/50-protocols/tba-protocol-webauthn/README.md)
139
+
140
+ Other direct consumers include [tba-app-backend-core](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/90-backend-apps/tba-app-backend-core/README.md), [tba-auth](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/70-facade/tba-auth/README.md), [tba-bases-identity-model](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/05-bases/tba-bases-identity-model/README.md), [tba-capability-access-governance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-access-governance/README.md), [tba-capability-policy-administration](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-policy-administration/README.md), [tba-capability-policy-assurance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/40-capabilities/tba-capability-policy-assurance/README.md), [tba-concrete-authorization-provenance](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/10-concrete/tba-concrete-authorization-provenance/README.md), [tba-concrete-capability](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/10-concrete/tba-concrete-capability/README.md).
141
+
142
+ ## Non-goals
143
+
144
+ `tba-primitives-identity` does not take ownership of protocol flows, provider selection, or application hosting.
145
+
146
+ Its exports and dependency declarations describe its integration surface; they do not establish deployment readiness, protocol certification, or an implicit production configuration.
147
+
148
+ ## Related Packages
149
+
150
+ - [tba-primitives-identity](https://pypi.org/project/tba-primitives-identity/)
151
+ - [tba-contracts-identity](https://pypi.org/project/tba-contracts-identity/)
152
+ - [tba-concrete-identity-principals](https://pypi.org/project/tba-concrete-identity-principals/)
153
+ - [tba-credentials](https://pypi.org/project/tba-credentials/)
154
+ - [tba-provider-identity-jose](https://pypi.org/project/tba-provider-identity-jose/)
155
+ - [tba-runtime-authorization-policy](https://pypi.org/project/tba-runtime-authorization-policy/)
156
+
157
+ ## Project Links
158
+
159
+ - [Package source](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity)
160
+ - [Package manifest](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/pyproject.toml)
161
+ - [LICENSE](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/LICENSE) and [NOTICE](https://github.com/tigrbl/tigrbl_auth/blob/master/pkgs/00-primitives/tba-primitives-identity/NOTICE)
162
+ - [Report an issue](https://github.com/tigrbl/tigrbl_auth/issues)
163
+ - [Package index](https://github.com/tigrbl/tigrbl_auth/blob/master/index.toml)
164
+ - [Canonical SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json)
165
+ - [PyPI project](https://pypi.org/project/tba-primitives-identity/)
166
+
167
+ ## Governance
168
+
169
+ 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.
170
+
171
+ `tba-primitives-identity` follows the [canonical SSOT registry](https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json) and [package index](https://github.com/tigrbl/tigrbl_auth/blob/master/index.toml). Keep its `00-primitives` ownership, public imports, declared dependencies, examples, and release metadata aligned.
172
+
173
+ Changes must pass the [README standards gate](https://github.com/tigrbl/tigrbl_auth/blob/master/.github/workflows/readme-standards.yml), package checks, and the evidence requirements relevant to the changed behavior. Update SSOT through the repository's CLI workflow when changing governed claims or boundaries.
174
+
175
+ ## Verification
176
+
177
+ See the [related repository tests](https://github.com/tigrbl/tigrbl_auth/blob/master/tests/unit/test_identity_package_split_imports.py) for the implementation scope covered by this example.
178
+
179
+ [Workspace and package catalog](https://github.com/tigrbl/tigrbl_auth#package-catalog) · [tba-contracts-identity-document](https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/02-contracts/tba-contracts-identity-document#readme) · [Report an issue](https://github.com/tigrbl/tigrbl_auth/issues) · [Repository license](https://github.com/tigrbl/tigrbl_auth/blob/master/LICENSE)
@@ -1,9 +1,9 @@
1
1
  [project]
2
2
  name = "tba-primitives-identity"
3
- version = "0.4.0.dev2"
3
+ version = "0.4.0.dev4"
4
4
  description = "Dependency-light identity primitives, typed helpers, path safety, and RFC 8785 JSON canonicalization for TBA identity systems."
5
5
  readme = "README.md"
6
- requires-python = ">=3.10,<3.15"
6
+ requires-python = ">=3.10,<3.16"
7
7
  license = "Apache-2.0"
8
8
  keywords = [
9
9
  "tigrbl",
@@ -20,32 +20,38 @@ keywords = [
20
20
  classifiers = [
21
21
  "Development Status :: 3 - Alpha",
22
22
  "Intended Audience :: Developers",
23
- "License :: OSI Approved :: Apache Software License",
24
23
  "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
24
  "Programming Language :: Python :: 3 :: Only",
31
25
  "Typing :: Typed",
32
26
  "Topic :: Internet :: WWW/HTTP",
33
27
  "Topic :: Security",
34
28
  "Topic :: Software Development :: Libraries :: Python Modules",
29
+ "Programming Language :: Python :: 3.10",
30
+ "Programming Language :: Python :: 3.11",
31
+ "Programming Language :: Python :: 3.12",
32
+ "Programming Language :: Python :: 3.13",
33
+ "Programming Language :: Python :: 3.14",
34
+ "Programming Language :: Python :: 3.15",
35
35
  ]
36
+ license-files = ["LICENSE", "NOTICE"]
36
37
 
37
38
  [project.optional-dependencies]
38
39
  storage = ["tigrbl>=0.4.4.dev1,<0.5"]
39
40
 
40
41
  [project.urls]
41
- Homepage = "https://github.com/tigrbl/tigrbl_auth"
42
+ Homepage = "https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity#readme"
42
43
  Repository = "https://github.com/tigrbl/tigrbl_auth"
43
44
  Source = "https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity"
44
45
  SSOT = "https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json"
45
46
  PyPI = "https://pypi.org/project/tba-primitives-identity/"
47
+ Documentation = "https://github.com/tigrbl/tigrbl_auth/tree/master/pkgs/00-primitives/tba-primitives-identity#readme"
48
+ Issues = "https://github.com/tigrbl/tigrbl_auth/issues"
46
49
 
50
+ [[project.authors]]
51
+ name = "Jacob Stewart"
52
+ email = "jacob@swarmauri.com"
47
53
  [build-system]
48
- requires = ["poetry-core>=1.0.0"]
54
+ requires = ["poetry-core>=2.2.0,<3.0.0"]
49
55
  build-backend = "poetry.core.masonry.api"
50
56
 
51
57
  [tool.poetry]
@@ -1,7 +1,7 @@
1
1
  """Primitive claim taxonomy shared across token and credential families."""
2
2
 
3
3
  from dataclasses import dataclass
4
- from enum import StrEnum
4
+ from .enum_compat import StrEnum
5
5
  from typing import TypeAlias
6
6
 
7
7
 
@@ -0,0 +1,11 @@
1
+ try:
2
+ from enum import StrEnum
3
+ except ImportError: # Python 3.10
4
+ from enum import Enum
5
+
6
+ class StrEnum(str, Enum):
7
+ __str__ = str.__str__
8
+ __format__ = str.__format__
9
+
10
+
11
+ __all__ = ["StrEnum"]
@@ -1,4 +1,4 @@
1
- """JSON Canonicalization Scheme helpers."""
1
+ """Deterministic JSON helpers and legacy JCS compatibility exports."""
2
2
 
3
3
  from __future__ import annotations
4
4
 
@@ -6,6 +6,7 @@ import json
6
6
  import math
7
7
  import re
8
8
  import hashlib
9
+ import warnings
9
10
  from collections.abc import Iterable, Mapping, Sequence
10
11
  from decimal import Decimal
11
12
  from typing import Any
@@ -19,19 +20,29 @@ class JCSCanonicalizationError(ValueError):
19
20
  """Raised when input cannot be represented as RFC 8785 JCS JSON."""
20
21
 
21
22
 
22
- def canonicalize(value: Any) -> bytes:
23
- """Return RFC 8785 JCS canonical JSON encoded as UTF-8 bytes."""
23
+ def _warn_legacy_jcs() -> None:
24
+ warnings.warn(
25
+ "JCS exports in tba_primitives_identity are deprecated. "
26
+ "Install tba-codec-jcs and import from tba_codec_jcs.",
27
+ DeprecationWarning,
28
+ stacklevel=3,
29
+ )
30
+
24
31
 
32
+ def canonicalize(value: Any) -> bytes:
33
+ """Return legacy canonical JSON bytes. Use tba_codec_jcs for RFC 8785."""
34
+ _warn_legacy_jcs()
25
35
  return _serialize(value).encode("utf-8")
26
36
 
27
37
 
28
38
  def canonicalize_json(document: str | bytes | bytearray) -> bytes:
29
- """Parse JSON text with duplicate-name rejection and return JCS bytes."""
39
+ """Parse and serialize with the legacy JCS implementation."""
40
+ _warn_legacy_jcs()
30
41
 
31
42
  if isinstance(document, (bytes, bytearray)):
32
43
  document = bytes(document).decode("utf-8")
33
44
  value = json.loads(document, object_pairs_hook=_reject_duplicate_pairs)
34
- return canonicalize(value)
45
+ return _serialize(value).encode("utf-8")
35
46
 
36
47
 
37
48
  def _normalize_canonical_json_value(value: Any) -> Any:
@@ -1,6 +1,6 @@
1
1
  """Compatibility module for RFC 8785 JSON canonicalization helpers.
2
2
 
3
- Canonical module: tba_primitives_identity.json_canonicalization.
3
+ RFC 8785 implementation: tba_codec_jcs.
4
4
  """
5
5
 
6
6
  from __future__ import annotations
@@ -16,8 +16,8 @@ from .json_canonicalization import (
16
16
  )
17
17
 
18
18
  warnings.warn(
19
- "tba_primitives_identity.rfc8785 is deprecated; use "
20
- "tba_primitives_identity.json_canonicalization instead.",
19
+ "tba_primitives_identity.rfc8785 is deprecated. "
20
+ "Install tba-codec-jcs and import from tba_codec_jcs.",
21
21
  DeprecationWarning,
22
22
  stacklevel=2,
23
23
  )
@@ -1,91 +0,0 @@
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
-
@@ -1,60 +0,0 @@
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.