tigrbl-identity-rp 0.4.0.dev2__tar.gz → 0.4.0.dev3__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.
- tigrbl_identity_rp-0.4.0.dev3/LICENSE +201 -0
- tigrbl_identity_rp-0.4.0.dev3/NOTICE +10 -0
- tigrbl_identity_rp-0.4.0.dev3/PKG-INFO +157 -0
- tigrbl_identity_rp-0.4.0.dev3/README.md +120 -0
- tigrbl_identity_rp-0.4.0.dev3/pyproject.toml +43 -0
- tigrbl_identity_rp-0.4.0.dev3/src/tigrbl_identity_rp/__init__.py +32 -0
- tigrbl_identity_rp-0.4.0.dev3/src/tigrbl_identity_rp/client.py +32 -0
- tigrbl_identity_rp-0.4.0.dev3/src/tigrbl_identity_rp/discovery_client.py +32 -0
- tigrbl_identity_rp-0.4.0.dev3/src/tigrbl_identity_rp/logout.py +32 -0
- tigrbl_identity_rp-0.4.0.dev2/PKG-INFO +0 -20
- tigrbl_identity_rp-0.4.0.dev2/README.md +0 -5
- tigrbl_identity_rp-0.4.0.dev2/pyproject.toml +0 -14
- tigrbl_identity_rp-0.4.0.dev2/src/tigrbl_identity_rp/__init__.py +0 -5
- tigrbl_identity_rp-0.4.0.dev2/src/tigrbl_identity_rp/discovery_client.py +0 -73
- tigrbl_identity_rp-0.4.0.dev2/src/tigrbl_identity_rp/logout.py +0 -357
- tigrbl_identity_rp-0.4.0.dev2/src/tigrbl_identity_rp/userinfo_client.py +0 -124
|
@@ -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: tigrbl-identity-rp
|
|
10
|
+
Source: https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: tigrbl-identity-rp
|
|
3
|
+
Version: 0.4.0.dev3
|
|
4
|
+
Summary: Deprecated compatibility package. Migrate to tba-protocol-oidc-relying-party; see the included module migration table.
|
|
5
|
+
License-Expression: Apache-2.0
|
|
6
|
+
License-File: LICENSE
|
|
7
|
+
License-File: NOTICE
|
|
8
|
+
Keywords: tigrbl,identity,openid-connect,oidc,relying-party,rp,userinfo,logout,sso,iam
|
|
9
|
+
Author: Jacob Stewart
|
|
10
|
+
Author-email: jacob@swarmauri.com
|
|
11
|
+
Requires-Python: >=3.10,<3.16
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Programming Language :: Python :: 3
|
|
14
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
15
|
+
Classifier: Typing :: Typed
|
|
16
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
17
|
+
Classifier: Topic :: Security
|
|
18
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
25
|
+
Classifier: Development Status :: 7 - Inactive
|
|
26
|
+
Requires-Dist: tba-protocol-oidc-relying-party (>=0.4.0.dev2,<0.5)
|
|
27
|
+
Project-URL: Documentation, https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp#readme
|
|
28
|
+
Project-URL: Homepage, https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp#readme
|
|
29
|
+
Project-URL: Issues, https://github.com/tigrbl/tigrbl_auth/issues
|
|
30
|
+
Project-URL: PyPI, https://pypi.org/project/tigrbl-identity-rp/
|
|
31
|
+
Project-URL: Repository, https://github.com/tigrbl/tigrbl_auth
|
|
32
|
+
Project-URL: Replacement, https://pypi.org/project/tba-protocol-oidc-relying-party/
|
|
33
|
+
Project-URL: Source, https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp
|
|
34
|
+
Project-URL: SSOT, https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json
|
|
35
|
+
Description-Content-Type: text/markdown
|
|
36
|
+
|
|
37
|
+
# tigrbl-identity-rp
|
|
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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/pyproject.toml"><img alt="Checkout: 0.4.0.dev3" src="https://img.shields.io/badge/Checkout-0.4.0.dev3-1f6feb"></a>
|
|
45
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/pyproject.toml"><img alt="Python: >=3.10,<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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead"><img alt="Layer: deprecated / undead" src="https://img.shields.io/badge/Layer-deprecated%20%2F%20undead-0a7f5a"></a>
|
|
49
|
+
<a href="https://pypi.org/project/tigrbl-identity-rp/"><img alt="PyPI version for tigrbl-identity-rp" src="https://img.shields.io/pypi/v/tigrbl-identity-rp?label=tigrbl-identity-rp%20PyPI"></a>
|
|
50
|
+
</p>
|
|
51
|
+
<p align="center">
|
|
52
|
+
<a href="https://pepy.tech/project/tigrbl-identity-rp"><img alt="Monthly PyPI downloads for tigrbl-identity-rp" src="https://static.pepy.tech/badge/tigrbl-identity-rp/month"></a>
|
|
53
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/README.md"><img alt="README hits for tigrbl-identity-rp" src="https://hits.sh/github.com/tigrbl/tigrbl_auth/blob/master/pkgs/deprecated/undead/tigrbl-identity-rp/README.md.svg?label=hits"></a>
|
|
54
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/.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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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
|
+
> **Deprecated:** `tigrbl-identity-rp==0.4.0.dev3` is the final migration release. Install `tba-protocol-oidc-relying-party` and replace legacy imports using the complete migration table below. This compatibility package receives no new features. No removal date is promised.
|
|
60
|
+
|
|
61
|
+
This distribution preserves `tigrbl_identity_rp` imports while forwarding their public objects to the current TbA packages. Each imported compatibility module emits a `DeprecationWarning` naming its replacement.
|
|
62
|
+
|
|
63
|
+
## AEO Summary
|
|
64
|
+
|
|
65
|
+
`tigrbl-identity-rp` is a deprecated Python compatibility distribution for existing identity integrations. Its primary successor is `tba-protocol-oidc-relying-party` (`tba_protocol_oidc_relying_party`); modules now owned by other packages have explicit destinations in the migration table.
|
|
66
|
+
|
|
67
|
+
## When to use it
|
|
68
|
+
|
|
69
|
+
Use this final release temporarily when an existing application still imports `tigrbl_identity_rp`. New applications should install the canonical owners directly. Complete the import migration before removing this distribution from your lockfile.
|
|
70
|
+
|
|
71
|
+
## Installation
|
|
72
|
+
|
|
73
|
+
For an existing deployment during migration:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
python -m pip install --pre "tigrbl-identity-rp==0.4.0.dev3"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
For new code, install its primary successor:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
python -m pip install --pre "tba-protocol-oidc-relying-party>=0.4.0.dev2,<0.5"
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Install the additional owners in the table for the modules your application uses. Resolve and test a complete lockfile before deployment.
|
|
86
|
+
|
|
87
|
+
## Quick start
|
|
88
|
+
|
|
89
|
+
```python
|
|
90
|
+
import tba_protocol_oidc_relying_party
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
The canonical module is the starting point for new code. Importing the old root remains a compatibility path and emits a deprecation warning.
|
|
94
|
+
|
|
95
|
+
## Usage
|
|
96
|
+
|
|
97
|
+
Inspect legacy imports before replacing their module paths:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
rg "tigrbl_identity_rp" src tests
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Migration
|
|
104
|
+
|
|
105
|
+
1. Find every `tigrbl_identity_rp` import in application code and configuration.
|
|
106
|
+
2. Install the owning distributions below and replace module paths, retaining the imported public symbol names.
|
|
107
|
+
3. Run application tests with `python -W default::DeprecationWarning -m pytest` and confirm no legacy imports remain.
|
|
108
|
+
4. Remove `tigrbl-identity-rp` from direct requirements, regenerate the lockfile, and test in a clean environment.
|
|
109
|
+
|
|
110
|
+
The shims forward public objects rather than implementing independent behavior. Use this complete module map, including destinations split across different package owners:
|
|
111
|
+
|
|
112
|
+
| Legacy module | Replacement module | Owning distribution |
|
|
113
|
+
| --- | --- | --- |
|
|
114
|
+
| `tigrbl_identity_rp` | `tba_protocol_oidc_relying_party` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
115
|
+
| `tigrbl_identity_rp.client` | `tba_protocol_oidc_relying_party.client` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
116
|
+
| `tigrbl_identity_rp.discovery_client` | `tba_protocol_oidc_relying_party.discovery_client` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
117
|
+
| `tigrbl_identity_rp.logout` | `tba_protocol_oidc_relying_party.logout` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
118
|
+
|
|
119
|
+
## Package Boundary
|
|
120
|
+
|
|
121
|
+
This package owns only the historical `tigrbl_identity_rp` namespace and its warning-emitting forwarding modules. Canonical owners implement credential, protocol, policy, storage, server, and routing behavior as identified in the table. Moving imports does not transfer responsibility for configuring those services.
|
|
122
|
+
|
|
123
|
+
## Injected dependencies
|
|
124
|
+
|
|
125
|
+
The package declares each canonical owner used by its shims with a compatible prerelease range starting at `0.4.0.dev2`. Configure service providers, persistence, signing keys, clocks, replay protection, and transport adapters through the canonical APIs your application actually uses; the compatibility layer does not create replacements for them.
|
|
126
|
+
|
|
127
|
+
## Operations and readiness
|
|
128
|
+
|
|
129
|
+
Enable deprecation warnings in development and migration CI. Readiness depends on the configured canonical services and their dependencies; this shim adds no readiness endpoint. Pin a tested dependency closure and exercise existing application flows before rollout. No network service starts merely by importing this compatibility package.
|
|
130
|
+
|
|
131
|
+
## Protocol consumers
|
|
132
|
+
|
|
133
|
+
Consumers of the historical identity API should migrate imports according to the table while preserving their protocol configuration and injected providers. Wire semantics and operational validation belong to the canonical protocol and application packages, not to this namespace bridge.
|
|
134
|
+
|
|
135
|
+
## Non-goals
|
|
136
|
+
|
|
137
|
+
This final release does not add protocol features, maintain a separate implementation, choose deployment policy, or guarantee a future removal date. It does not require publishing any never-published retired package.
|
|
138
|
+
|
|
139
|
+
## Related Packages
|
|
140
|
+
|
|
141
|
+
- [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/): owns the corresponding replacement modules listed below.
|
|
142
|
+
|
|
143
|
+
## Project Links
|
|
144
|
+
|
|
145
|
+
- [Final release source and README](https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp)
|
|
146
|
+
- [PyPI release](https://pypi.org/project/tigrbl-identity-rp/0.4.0.dev3/)
|
|
147
|
+
- [Primary replacement](https://pypi.org/project/tba-protocol-oidc-relying-party/)
|
|
148
|
+
- [Issue tracker](https://github.com/tigrbl/tigrbl_auth/issues)
|
|
149
|
+
|
|
150
|
+
## Governance
|
|
151
|
+
|
|
152
|
+
The repository SSOT registry governs package ownership and lifecycle. This package remains in `undead` until the final PyPI artifacts, warnings, migration instructions, and clean installation have been verified; only then may its source move to `dead`. Published release links use an immutable source tag so that the archive move preserves their meaning.
|
|
153
|
+
|
|
154
|
+
## Verification
|
|
155
|
+
|
|
156
|
+
The final-release gate builds and inspects the wheel and source archive, checks their legal files and migration metadata, and installs the selected artifact into a fresh Python environment with published dependencies. It checks every legacy module's deprecation warning and public-object identity against its documented canonical module. Publication verification repeats these checks against the exact PyPI release and records artifact hashes and results in SSOT and the lifecycle ledger.
|
|
157
|
+
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# tigrbl-identity-rp
|
|
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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/pyproject.toml"><img alt="Checkout: 0.4.0.dev3" src="https://img.shields.io/badge/Checkout-0.4.0.dev3-1f6feb"></a>
|
|
9
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/pyproject.toml"><img alt="Python: >=3.10,<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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead"><img alt="Layer: deprecated / undead" src="https://img.shields.io/badge/Layer-deprecated%20%2F%20undead-0a7f5a"></a>
|
|
13
|
+
<a href="https://pypi.org/project/tigrbl-identity-rp/"><img alt="PyPI version for tigrbl-identity-rp" src="https://img.shields.io/pypi/v/tigrbl-identity-rp?label=tigrbl-identity-rp%20PyPI"></a>
|
|
14
|
+
</p>
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://pepy.tech/project/tigrbl-identity-rp"><img alt="Monthly PyPI downloads for tigrbl-identity-rp" src="https://static.pepy.tech/badge/tigrbl-identity-rp/month"></a>
|
|
17
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/README.md"><img alt="README hits for tigrbl-identity-rp" src="https://hits.sh/github.com/tigrbl/tigrbl_auth/blob/master/pkgs/deprecated/undead/tigrbl-identity-rp/README.md.svg?label=hits"></a>
|
|
18
|
+
<a href="https://github.com/tigrbl/tigrbl_auth/blob/tigrbl-identity-rp%3D%3D0.4.0.dev3/.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/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp/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
|
+
> **Deprecated:** `tigrbl-identity-rp==0.4.0.dev3` is the final migration release. Install `tba-protocol-oidc-relying-party` and replace legacy imports using the complete migration table below. This compatibility package receives no new features. No removal date is promised.
|
|
24
|
+
|
|
25
|
+
This distribution preserves `tigrbl_identity_rp` imports while forwarding their public objects to the current TbA packages. Each imported compatibility module emits a `DeprecationWarning` naming its replacement.
|
|
26
|
+
|
|
27
|
+
## AEO Summary
|
|
28
|
+
|
|
29
|
+
`tigrbl-identity-rp` is a deprecated Python compatibility distribution for existing identity integrations. Its primary successor is `tba-protocol-oidc-relying-party` (`tba_protocol_oidc_relying_party`); modules now owned by other packages have explicit destinations in the migration table.
|
|
30
|
+
|
|
31
|
+
## When to use it
|
|
32
|
+
|
|
33
|
+
Use this final release temporarily when an existing application still imports `tigrbl_identity_rp`. New applications should install the canonical owners directly. Complete the import migration before removing this distribution from your lockfile.
|
|
34
|
+
|
|
35
|
+
## Installation
|
|
36
|
+
|
|
37
|
+
For an existing deployment during migration:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
python -m pip install --pre "tigrbl-identity-rp==0.4.0.dev3"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
For new code, install its primary successor:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
python -m pip install --pre "tba-protocol-oidc-relying-party>=0.4.0.dev2,<0.5"
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
Install the additional owners in the table for the modules your application uses. Resolve and test a complete lockfile before deployment.
|
|
50
|
+
|
|
51
|
+
## Quick start
|
|
52
|
+
|
|
53
|
+
```python
|
|
54
|
+
import tba_protocol_oidc_relying_party
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
The canonical module is the starting point for new code. Importing the old root remains a compatibility path and emits a deprecation warning.
|
|
58
|
+
|
|
59
|
+
## Usage
|
|
60
|
+
|
|
61
|
+
Inspect legacy imports before replacing their module paths:
|
|
62
|
+
|
|
63
|
+
```bash
|
|
64
|
+
rg "tigrbl_identity_rp" src tests
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### Migration
|
|
68
|
+
|
|
69
|
+
1. Find every `tigrbl_identity_rp` import in application code and configuration.
|
|
70
|
+
2. Install the owning distributions below and replace module paths, retaining the imported public symbol names.
|
|
71
|
+
3. Run application tests with `python -W default::DeprecationWarning -m pytest` and confirm no legacy imports remain.
|
|
72
|
+
4. Remove `tigrbl-identity-rp` from direct requirements, regenerate the lockfile, and test in a clean environment.
|
|
73
|
+
|
|
74
|
+
The shims forward public objects rather than implementing independent behavior. Use this complete module map, including destinations split across different package owners:
|
|
75
|
+
|
|
76
|
+
| Legacy module | Replacement module | Owning distribution |
|
|
77
|
+
| --- | --- | --- |
|
|
78
|
+
| `tigrbl_identity_rp` | `tba_protocol_oidc_relying_party` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
79
|
+
| `tigrbl_identity_rp.client` | `tba_protocol_oidc_relying_party.client` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
80
|
+
| `tigrbl_identity_rp.discovery_client` | `tba_protocol_oidc_relying_party.discovery_client` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
81
|
+
| `tigrbl_identity_rp.logout` | `tba_protocol_oidc_relying_party.logout` | [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/) |
|
|
82
|
+
|
|
83
|
+
## Package Boundary
|
|
84
|
+
|
|
85
|
+
This package owns only the historical `tigrbl_identity_rp` namespace and its warning-emitting forwarding modules. Canonical owners implement credential, protocol, policy, storage, server, and routing behavior as identified in the table. Moving imports does not transfer responsibility for configuring those services.
|
|
86
|
+
|
|
87
|
+
## Injected dependencies
|
|
88
|
+
|
|
89
|
+
The package declares each canonical owner used by its shims with a compatible prerelease range starting at `0.4.0.dev2`. Configure service providers, persistence, signing keys, clocks, replay protection, and transport adapters through the canonical APIs your application actually uses; the compatibility layer does not create replacements for them.
|
|
90
|
+
|
|
91
|
+
## Operations and readiness
|
|
92
|
+
|
|
93
|
+
Enable deprecation warnings in development and migration CI. Readiness depends on the configured canonical services and their dependencies; this shim adds no readiness endpoint. Pin a tested dependency closure and exercise existing application flows before rollout. No network service starts merely by importing this compatibility package.
|
|
94
|
+
|
|
95
|
+
## Protocol consumers
|
|
96
|
+
|
|
97
|
+
Consumers of the historical identity API should migrate imports according to the table while preserving their protocol configuration and injected providers. Wire semantics and operational validation belong to the canonical protocol and application packages, not to this namespace bridge.
|
|
98
|
+
|
|
99
|
+
## Non-goals
|
|
100
|
+
|
|
101
|
+
This final release does not add protocol features, maintain a separate implementation, choose deployment policy, or guarantee a future removal date. It does not require publishing any never-published retired package.
|
|
102
|
+
|
|
103
|
+
## Related Packages
|
|
104
|
+
|
|
105
|
+
- [tba-protocol-oidc-relying-party](https://pypi.org/project/tba-protocol-oidc-relying-party/): owns the corresponding replacement modules listed below.
|
|
106
|
+
|
|
107
|
+
## Project Links
|
|
108
|
+
|
|
109
|
+
- [Final release source and README](https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp)
|
|
110
|
+
- [PyPI release](https://pypi.org/project/tigrbl-identity-rp/0.4.0.dev3/)
|
|
111
|
+
- [Primary replacement](https://pypi.org/project/tba-protocol-oidc-relying-party/)
|
|
112
|
+
- [Issue tracker](https://github.com/tigrbl/tigrbl_auth/issues)
|
|
113
|
+
|
|
114
|
+
## Governance
|
|
115
|
+
|
|
116
|
+
The repository SSOT registry governs package ownership and lifecycle. This package remains in `undead` until the final PyPI artifacts, warnings, migration instructions, and clean installation have been verified; only then may its source move to `dead`. Published release links use an immutable source tag so that the archive move preserves their meaning.
|
|
117
|
+
|
|
118
|
+
## Verification
|
|
119
|
+
|
|
120
|
+
The final-release gate builds and inspects the wheel and source archive, checks their legal files and migration metadata, and installs the selected artifact into a fresh Python environment with published dependencies. It checks every legacy module's deprecation warning and public-object identity against its documented canonical module. Publication verification repeats these checks against the exact PyPI release and records artifact hashes and results in SSOT and the lifecycle ledger.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
[project]
|
|
2
|
+
name = "tigrbl-identity-rp"
|
|
3
|
+
version = "0.4.0.dev3"
|
|
4
|
+
description = "Deprecated compatibility package. Migrate to tba-protocol-oidc-relying-party; see the included module migration table."
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
requires-python = ">=3.10,<3.16"
|
|
7
|
+
license = "Apache-2.0"
|
|
8
|
+
keywords = [
|
|
9
|
+
"tigrbl",
|
|
10
|
+
"identity",
|
|
11
|
+
"openid-connect",
|
|
12
|
+
"oidc",
|
|
13
|
+
"relying-party",
|
|
14
|
+
"rp",
|
|
15
|
+
"userinfo",
|
|
16
|
+
"logout",
|
|
17
|
+
"sso",
|
|
18
|
+
"iam",
|
|
19
|
+
]
|
|
20
|
+
classifiers = ["Intended Audience :: Developers", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Typing :: Typed", "Topic :: Internet :: WWW/HTTP", "Topic :: Security", "Topic :: Software Development :: Libraries :: Python Modules", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", "Programming Language :: Python :: 3.15", "Development Status :: 7 - Inactive"]
|
|
21
|
+
|
|
22
|
+
dependencies = ["tba-protocol-oidc-relying-party>=0.4.0.dev2,<0.5"]
|
|
23
|
+
license-files = ["LICENSE", "NOTICE"]
|
|
24
|
+
|
|
25
|
+
[project.urls]
|
|
26
|
+
Homepage = "https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp#readme"
|
|
27
|
+
Repository = "https://github.com/tigrbl/tigrbl_auth"
|
|
28
|
+
Source = "https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp"
|
|
29
|
+
SSOT = "https://github.com/tigrbl/tigrbl_auth/blob/master/.ssot/registry.json"
|
|
30
|
+
PyPI = "https://pypi.org/project/tigrbl-identity-rp/"
|
|
31
|
+
Documentation = "https://github.com/tigrbl/tigrbl_auth/tree/tigrbl-identity-rp%3D%3D0.4.0.dev3/pkgs/deprecated/undead/tigrbl-identity-rp#readme"
|
|
32
|
+
Issues = "https://github.com/tigrbl/tigrbl_auth/issues"
|
|
33
|
+
Replacement = "https://pypi.org/project/tba-protocol-oidc-relying-party/"
|
|
34
|
+
|
|
35
|
+
[[project.authors]]
|
|
36
|
+
name = "Jacob Stewart"
|
|
37
|
+
email = "jacob@swarmauri.com"
|
|
38
|
+
[build-system]
|
|
39
|
+
requires = ["poetry-core>=2.2.0,<3.0.0"]
|
|
40
|
+
build-backend = "poetry.core.masonry.api"
|
|
41
|
+
|
|
42
|
+
[tool.poetry]
|
|
43
|
+
packages = [{ include = "tigrbl_identity_rp", from = "src" }]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Deprecated compatibility module for `tba_protocol_oidc_relying_party`."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module as _import_module
|
|
6
|
+
import warnings as _warnings
|
|
7
|
+
|
|
8
|
+
_DEPRECATED_MODULE = "tigrbl_identity_rp"
|
|
9
|
+
_CANONICAL_MODULE = "tba_protocol_oidc_relying_party"
|
|
10
|
+
|
|
11
|
+
_warnings.warn(
|
|
12
|
+
f"{_DEPRECATED_MODULE} is deprecated; import {_CANONICAL_MODULE} instead.",
|
|
13
|
+
DeprecationWarning,
|
|
14
|
+
stacklevel=2,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
_target = _import_module(_CANONICAL_MODULE)
|
|
18
|
+
_EXCLUDED = {
|
|
19
|
+
"__builtins__",
|
|
20
|
+
"__cached__",
|
|
21
|
+
"__file__",
|
|
22
|
+
"__loader__",
|
|
23
|
+
"__name__",
|
|
24
|
+
"__package__",
|
|
25
|
+
"__path__",
|
|
26
|
+
"__spec__",
|
|
27
|
+
}
|
|
28
|
+
for _name, _value in vars(_target).items():
|
|
29
|
+
if _name not in _EXCLUDED:
|
|
30
|
+
globals()[_name] = _value
|
|
31
|
+
|
|
32
|
+
__all__ = list(getattr(_target, "__all__", [name for name in globals() if not name.startswith("_")]))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Deprecated compatibility module for `tba_protocol_oidc_relying_party.client`."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module as _import_module
|
|
6
|
+
import warnings as _warnings
|
|
7
|
+
|
|
8
|
+
_DEPRECATED_MODULE = "tigrbl_identity_rp.client"
|
|
9
|
+
_CANONICAL_MODULE = "tba_protocol_oidc_relying_party.client"
|
|
10
|
+
|
|
11
|
+
_warnings.warn(
|
|
12
|
+
f"{_DEPRECATED_MODULE} is deprecated; import {_CANONICAL_MODULE} instead.",
|
|
13
|
+
DeprecationWarning,
|
|
14
|
+
stacklevel=2,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
_target = _import_module(_CANONICAL_MODULE)
|
|
18
|
+
_EXCLUDED = {
|
|
19
|
+
"__builtins__",
|
|
20
|
+
"__cached__",
|
|
21
|
+
"__file__",
|
|
22
|
+
"__loader__",
|
|
23
|
+
"__name__",
|
|
24
|
+
"__package__",
|
|
25
|
+
"__path__",
|
|
26
|
+
"__spec__",
|
|
27
|
+
}
|
|
28
|
+
for _name, _value in vars(_target).items():
|
|
29
|
+
if _name not in _EXCLUDED:
|
|
30
|
+
globals()[_name] = _value
|
|
31
|
+
|
|
32
|
+
__all__ = list(getattr(_target, "__all__", [name for name in globals() if not name.startswith("_")]))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Deprecated compatibility module for `tba_protocol_oidc_relying_party.discovery_client`."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module as _import_module
|
|
6
|
+
import warnings as _warnings
|
|
7
|
+
|
|
8
|
+
_DEPRECATED_MODULE = "tigrbl_identity_rp.discovery_client"
|
|
9
|
+
_CANONICAL_MODULE = "tba_protocol_oidc_relying_party.discovery_client"
|
|
10
|
+
|
|
11
|
+
_warnings.warn(
|
|
12
|
+
f"{_DEPRECATED_MODULE} is deprecated; import {_CANONICAL_MODULE} instead.",
|
|
13
|
+
DeprecationWarning,
|
|
14
|
+
stacklevel=2,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
_target = _import_module(_CANONICAL_MODULE)
|
|
18
|
+
_EXCLUDED = {
|
|
19
|
+
"__builtins__",
|
|
20
|
+
"__cached__",
|
|
21
|
+
"__file__",
|
|
22
|
+
"__loader__",
|
|
23
|
+
"__name__",
|
|
24
|
+
"__package__",
|
|
25
|
+
"__path__",
|
|
26
|
+
"__spec__",
|
|
27
|
+
}
|
|
28
|
+
for _name, _value in vars(_target).items():
|
|
29
|
+
if _name not in _EXCLUDED:
|
|
30
|
+
globals()[_name] = _value
|
|
31
|
+
|
|
32
|
+
__all__ = list(getattr(_target, "__all__", [name for name in globals() if not name.startswith("_")]))
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Deprecated compatibility module for `tba_protocol_oidc_relying_party.logout`."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from importlib import import_module as _import_module
|
|
6
|
+
import warnings as _warnings
|
|
7
|
+
|
|
8
|
+
_DEPRECATED_MODULE = "tigrbl_identity_rp.logout"
|
|
9
|
+
_CANONICAL_MODULE = "tba_protocol_oidc_relying_party.logout"
|
|
10
|
+
|
|
11
|
+
_warnings.warn(
|
|
12
|
+
f"{_DEPRECATED_MODULE} is deprecated; import {_CANONICAL_MODULE} instead.",
|
|
13
|
+
DeprecationWarning,
|
|
14
|
+
stacklevel=2,
|
|
15
|
+
)
|
|
16
|
+
|
|
17
|
+
_target = _import_module(_CANONICAL_MODULE)
|
|
18
|
+
_EXCLUDED = {
|
|
19
|
+
"__builtins__",
|
|
20
|
+
"__cached__",
|
|
21
|
+
"__file__",
|
|
22
|
+
"__loader__",
|
|
23
|
+
"__name__",
|
|
24
|
+
"__package__",
|
|
25
|
+
"__path__",
|
|
26
|
+
"__spec__",
|
|
27
|
+
}
|
|
28
|
+
for _name, _value in vars(_target).items():
|
|
29
|
+
if _name not in _EXCLUDED:
|
|
30
|
+
globals()[_name] = _value
|
|
31
|
+
|
|
32
|
+
__all__ = list(getattr(_target, "__all__", [name for name in globals() if not name.startswith("_")]))
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: tigrbl-identity-rp
|
|
3
|
-
Version: 0.4.0.dev2
|
|
4
|
-
Summary: Relying-party SDK for the Tigrbl identity package suite.
|
|
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
|
-
Description-Content-Type: text/markdown
|
|
14
|
-
|
|
15
|
-
# tigrbl-identity-rp
|
|
16
|
-
|
|
17
|
-
Relying-party SDK for the Tigrbl identity package suite.
|
|
18
|
-
|
|
19
|
-
This package uses the independent import root `tigrbl_identity_rp`.
|
|
20
|
-
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "tigrbl-identity-rp"
|
|
3
|
-
version = "0.4.0.dev2"
|
|
4
|
-
description = "Relying-party SDK for the Tigrbl identity package suite."
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.10,<3.15"
|
|
7
|
-
license = "Apache-2.0"
|
|
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 = "tigrbl_identity_rp", from = "src" }]
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"""Compatibility facade for OIDC discovery.
|
|
2
|
-
|
|
3
|
-
When the full runtime stack is importable, this module re-exports the canonical
|
|
4
|
-
router-backed implementation. In dependency-light checkpoint environments, it
|
|
5
|
-
falls back to pure metadata helpers so discovery snapshots and unit tests can be
|
|
6
|
-
exercised without Tigrbl/SQLAlchemy.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
from __future__ import annotations
|
|
10
|
-
|
|
11
|
-
try: # pragma: no cover - exercised when runtime dependencies are installed
|
|
12
|
-
from tigrbl_auth.standards.oidc.discovery import (
|
|
13
|
-
ISSUER,
|
|
14
|
-
JWKS_PATH,
|
|
15
|
-
_build_openid_config,
|
|
16
|
-
_cached_openid_config,
|
|
17
|
-
_settings_signature,
|
|
18
|
-
api,
|
|
19
|
-
include_oidc_discovery,
|
|
20
|
-
refresh_discovery_cache,
|
|
21
|
-
router,
|
|
22
|
-
)
|
|
23
|
-
except Exception: # pragma: no cover - dependency-light fallback
|
|
24
|
-
import json
|
|
25
|
-
from functools import lru_cache
|
|
26
|
-
from typing import Any
|
|
27
|
-
|
|
28
|
-
from tigrbl_auth.config.deployment import resolve_deployment
|
|
29
|
-
from tigrbl_auth.config.settings import settings
|
|
30
|
-
from tigrbl_auth.standards.oidc.discovery_metadata import build_openid_config
|
|
31
|
-
from tigrbl_auth.standards.oauth2.rfc8414_metadata import ISSUER, JWKS_PATH
|
|
32
|
-
|
|
33
|
-
api = None
|
|
34
|
-
router = None
|
|
35
|
-
|
|
36
|
-
def _settings_signature(
|
|
37
|
-
settings_obj: object | None = None,
|
|
38
|
-
*,
|
|
39
|
-
profile: str | None = None,
|
|
40
|
-
flag_overrides: dict[str, Any] | None = None,
|
|
41
|
-
) -> str:
|
|
42
|
-
deployment = resolve_deployment(settings_obj or settings, profile=profile, flag_overrides=flag_overrides)
|
|
43
|
-
return json.dumps(deployment.to_manifest(), sort_keys=True)
|
|
44
|
-
|
|
45
|
-
def _build_openid_config(
|
|
46
|
-
settings_obj: object | None = None,
|
|
47
|
-
*,
|
|
48
|
-
profile: str | None = None,
|
|
49
|
-
flag_overrides: dict[str, Any] | None = None,
|
|
50
|
-
) -> dict[str, Any]:
|
|
51
|
-
return build_openid_config(settings_obj or settings, profile=profile, flag_overrides=flag_overrides)
|
|
52
|
-
|
|
53
|
-
@lru_cache(maxsize=8)
|
|
54
|
-
def _cached_openid_config(sig: str) -> dict[str, Any]:
|
|
55
|
-
return _build_openid_config()
|
|
56
|
-
|
|
57
|
-
def refresh_discovery_cache() -> None:
|
|
58
|
-
_cached_openid_config.cache_clear()
|
|
59
|
-
|
|
60
|
-
def include_oidc_discovery(app) -> None:
|
|
61
|
-
return None
|
|
62
|
-
|
|
63
|
-
__all__ = [
|
|
64
|
-
"api",
|
|
65
|
-
"router",
|
|
66
|
-
"JWKS_PATH",
|
|
67
|
-
"ISSUER",
|
|
68
|
-
"include_oidc_discovery",
|
|
69
|
-
"refresh_discovery_cache",
|
|
70
|
-
"_build_openid_config",
|
|
71
|
-
"_cached_openid_config",
|
|
72
|
-
"_settings_signature",
|
|
73
|
-
]
|
|
@@ -1,357 +0,0 @@
|
|
|
1
|
-
from __future__ import annotations
|
|
2
|
-
|
|
3
|
-
"""OpenID Connect RP-Initiated Logout with durable fanout planning and replay protection."""
|
|
4
|
-
|
|
5
|
-
from dataclasses import dataclass
|
|
6
|
-
from datetime import datetime, timezone
|
|
7
|
-
import base64
|
|
8
|
-
import json
|
|
9
|
-
from typing import Any, Final
|
|
10
|
-
from urllib.parse import urlparse
|
|
11
|
-
from uuid import UUID
|
|
12
|
-
|
|
13
|
-
from tigrbl_auth.config.deployment import deployment_from_request, resolve_deployment
|
|
14
|
-
from tigrbl_auth.config.settings import settings
|
|
15
|
-
|
|
16
|
-
try: # dependency-light import path for checkpoint evidence generation
|
|
17
|
-
from tigrbl_auth.framework import HTTPException, status
|
|
18
|
-
except Exception: # pragma: no cover - exercised in dependency-light tests
|
|
19
|
-
class _FallbackStatus:
|
|
20
|
-
HTTP_400_BAD_REQUEST = 400
|
|
21
|
-
HTTP_401_UNAUTHORIZED = 401
|
|
22
|
-
HTTP_404_NOT_FOUND = 404
|
|
23
|
-
|
|
24
|
-
class HTTPException(Exception):
|
|
25
|
-
def __init__(self, status_code: int, detail: Any):
|
|
26
|
-
super().__init__(detail)
|
|
27
|
-
self.status_code = status_code
|
|
28
|
-
self.detail = detail
|
|
29
|
-
|
|
30
|
-
status = _FallbackStatus()
|
|
31
|
-
|
|
32
|
-
STATUS: Final[str] = "rp-initiated-logout-runtime"
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
@dataclass(frozen=True, slots=True)
|
|
36
|
-
class StandardOwner:
|
|
37
|
-
label: str
|
|
38
|
-
title: str
|
|
39
|
-
runtime_status: str
|
|
40
|
-
public_surface: tuple[str, ...]
|
|
41
|
-
notes: str
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
@dataclass(frozen=True, slots=True)
|
|
45
|
-
class LogoutRequestContext:
|
|
46
|
-
client_id: UUID | None
|
|
47
|
-
post_logout_redirect_uri: str | None
|
|
48
|
-
id_token_hint_claims: dict[str, Any] | None
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
OWNER = StandardOwner(
|
|
52
|
-
label="OIDC RP-Initiated Logout",
|
|
53
|
-
title="OpenID Connect RP-Initiated Logout",
|
|
54
|
-
runtime_status=STATUS,
|
|
55
|
-
public_surface=("/logout",),
|
|
56
|
-
notes=(
|
|
57
|
-
"The canonical /logout route validates registered post-logout redirect URIs, validates id_token_hint "
|
|
58
|
-
"claims against issuer/audience/session policy, persists logout fanout plans, and reuses an existing "
|
|
59
|
-
"logout_state record to provide replay-safe idempotence when logout is retried."
|
|
60
|
-
),
|
|
61
|
-
)
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
def _persistence():
|
|
65
|
-
from tigrbl_auth.services import persistence as persistence_module
|
|
66
|
-
|
|
67
|
-
return persistence_module
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
def _frontchannel_builder():
|
|
71
|
-
from tigrbl_auth.standards.oidc.frontchannel_logout import build_frontchannel_descriptor
|
|
72
|
-
|
|
73
|
-
return build_frontchannel_descriptor
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
def _backchannel_builder():
|
|
77
|
-
from tigrbl_auth.standards.oidc.backchannel_logout import build_backchannel_descriptor
|
|
78
|
-
|
|
79
|
-
return build_backchannel_descriptor
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
async def _verify_id_token_hint(token: str, *, issuer: str, audience: str):
|
|
83
|
-
from tigrbl_auth.standards.oidc.id_token import verify_id_token
|
|
84
|
-
|
|
85
|
-
return await verify_id_token(token, issuer=issuer, audience=audience)
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
def _normalized_uris(value: Any) -> list[str]:
|
|
89
|
-
if value is None:
|
|
90
|
-
return []
|
|
91
|
-
if isinstance(value, list):
|
|
92
|
-
return [str(item) for item in value if item]
|
|
93
|
-
if isinstance(value, str):
|
|
94
|
-
return [item for item in value.split() if item]
|
|
95
|
-
return [str(value)]
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
def _normalize_uuid(value: Any) -> UUID | None:
|
|
99
|
-
if value in {None, '', False}:
|
|
100
|
-
return None
|
|
101
|
-
if isinstance(value, UUID):
|
|
102
|
-
return value
|
|
103
|
-
try:
|
|
104
|
-
return UUID(str(value))
|
|
105
|
-
except Exception:
|
|
106
|
-
return None
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def _audiences(claims: dict[str, Any] | None) -> list[str]:
|
|
110
|
-
if not claims:
|
|
111
|
-
return []
|
|
112
|
-
aud = claims.get('aud')
|
|
113
|
-
if aud is None:
|
|
114
|
-
return []
|
|
115
|
-
if isinstance(aud, (list, tuple, set)):
|
|
116
|
-
return [str(item) for item in aud if item not in {None, ''}]
|
|
117
|
-
return [str(aud)] if aud not in {None, ''} else []
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
def _unsafe_decode_jwt_claims(token: str) -> dict[str, Any]:
|
|
121
|
-
try:
|
|
122
|
-
parts = str(token).split('.')
|
|
123
|
-
if len(parts) != 3:
|
|
124
|
-
return {}
|
|
125
|
-
padded = parts[1] + '=' * (-len(parts[1]) % 4)
|
|
126
|
-
return dict(json.loads(base64.urlsafe_b64decode(padded).decode('utf-8')))
|
|
127
|
-
except Exception:
|
|
128
|
-
return {}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
def _require_https_if_present(uri: str) -> None:
|
|
132
|
-
parsed = urlparse(uri)
|
|
133
|
-
if parsed.scheme != 'https':
|
|
134
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, 'post_logout_redirect_uri must use https')
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
def assert_logout_session_active(session_row) -> None:
|
|
138
|
-
if session_row is None:
|
|
139
|
-
return None
|
|
140
|
-
state = str(getattr(session_row, 'session_state', 'active') or 'active').lower()
|
|
141
|
-
if getattr(session_row, 'ended_at', None) is not None or state in {'terminated', 'expired', 'ended', 'revoked'}:
|
|
142
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'expired_session'})
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
async def validate_post_logout_redirect_uri(*, client_id: UUID | None, post_logout_redirect_uri: str | None) -> str | None:
|
|
146
|
-
if not post_logout_redirect_uri:
|
|
147
|
-
return None
|
|
148
|
-
_require_https_if_present(post_logout_redirect_uri)
|
|
149
|
-
if client_id is None:
|
|
150
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_client', 'error_description': 'client_id required when post_logout_redirect_uri is supplied'})
|
|
151
|
-
registration = await _persistence().get_client_registration_async(client_id)
|
|
152
|
-
metadata = dict(getattr(registration, 'registration_metadata', {}) or {})
|
|
153
|
-
allowed = _normalized_uris(metadata.get('post_logout_redirect_uris'))
|
|
154
|
-
if post_logout_redirect_uri not in allowed:
|
|
155
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_request', 'error_description': 'unregistered post_logout_redirect_uri'})
|
|
156
|
-
return post_logout_redirect_uri
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
async def validate_id_token_hint(
|
|
160
|
-
*,
|
|
161
|
-
id_token_hint: str | None,
|
|
162
|
-
client_id: UUID | str | None = None,
|
|
163
|
-
session_id: UUID | str | None = None,
|
|
164
|
-
issuer: str | None = None,
|
|
165
|
-
) -> dict[str, Any] | None:
|
|
166
|
-
if not id_token_hint:
|
|
167
|
-
return None
|
|
168
|
-
effective_issuer = issuer or settings.issuer
|
|
169
|
-
effective_client_id = _normalize_uuid(client_id)
|
|
170
|
-
if effective_client_id is None:
|
|
171
|
-
unverified = _unsafe_decode_jwt_claims(id_token_hint)
|
|
172
|
-
for audience in _audiences(unverified):
|
|
173
|
-
parsed = _normalize_uuid(audience)
|
|
174
|
-
if parsed is not None:
|
|
175
|
-
effective_client_id = parsed
|
|
176
|
-
break
|
|
177
|
-
if effective_client_id is None:
|
|
178
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_id_token_hint', 'error_description': 'unable to derive client_id from id_token_hint'})
|
|
179
|
-
try:
|
|
180
|
-
claims = dict(await _verify_id_token_hint(id_token_hint, issuer=effective_issuer, audience=str(effective_client_id)))
|
|
181
|
-
except Exception as exc:
|
|
182
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_id_token_hint'}) from exc
|
|
183
|
-
if str(claims.get('iss') or '') != effective_issuer:
|
|
184
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_id_token_hint', 'error_description': 'issuer mismatch'})
|
|
185
|
-
audiences = _audiences(claims)
|
|
186
|
-
if str(effective_client_id) not in audiences:
|
|
187
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_id_token_hint', 'error_description': 'audience mismatch'})
|
|
188
|
-
expected_session_id = _normalize_uuid(session_id)
|
|
189
|
-
if expected_session_id is not None:
|
|
190
|
-
sid = _normalize_uuid(claims.get('sid'))
|
|
191
|
-
if sid is not None and sid != expected_session_id:
|
|
192
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_id_token_hint', 'error_description': 'sid mismatch'})
|
|
193
|
-
return claims
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
def resolve_logout_client_id(*, requested_client_id: UUID | str | None, session_row=None, hint_claims: dict[str, Any] | None = None) -> UUID | None:
|
|
197
|
-
requested = _normalize_uuid(requested_client_id)
|
|
198
|
-
session_client = _normalize_uuid(getattr(session_row, 'client_id', None)) if session_row is not None else None
|
|
199
|
-
hint_candidates = {_normalize_uuid(audience) for audience in _audiences(hint_claims)}
|
|
200
|
-
hint_candidates.discard(None)
|
|
201
|
-
|
|
202
|
-
if requested is not None and session_client is not None and requested != session_client:
|
|
203
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_client', 'error_description': 'requested client does not own the session'})
|
|
204
|
-
if requested is not None and hint_candidates and requested not in hint_candidates:
|
|
205
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_client', 'error_description': 'requested client does not match id_token_hint'})
|
|
206
|
-
if session_client is not None and hint_candidates and session_client not in hint_candidates:
|
|
207
|
-
raise HTTPException(status.HTTP_400_BAD_REQUEST, {'error': 'invalid_client', 'error_description': 'session client does not match id_token_hint'})
|
|
208
|
-
|
|
209
|
-
if requested is not None:
|
|
210
|
-
return requested
|
|
211
|
-
if session_client is not None:
|
|
212
|
-
return session_client
|
|
213
|
-
for candidate in hint_candidates:
|
|
214
|
-
return candidate
|
|
215
|
-
return None
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
async def validate_logout_request(
|
|
219
|
-
*,
|
|
220
|
-
requested_client_id: UUID | str | None,
|
|
221
|
-
post_logout_redirect_uri: str | None,
|
|
222
|
-
id_token_hint: str | None,
|
|
223
|
-
session_row=None,
|
|
224
|
-
issuer: str | None = None,
|
|
225
|
-
) -> LogoutRequestContext:
|
|
226
|
-
assert_logout_session_active(session_row)
|
|
227
|
-
prevalidated_client_id = _normalize_uuid(requested_client_id) or _normalize_uuid(getattr(session_row, 'client_id', None))
|
|
228
|
-
hint_claims = await validate_id_token_hint(
|
|
229
|
-
id_token_hint=id_token_hint,
|
|
230
|
-
client_id=prevalidated_client_id,
|
|
231
|
-
session_id=getattr(session_row, 'id', None),
|
|
232
|
-
issuer=issuer,
|
|
233
|
-
)
|
|
234
|
-
client_id = resolve_logout_client_id(requested_client_id=requested_client_id, session_row=session_row, hint_claims=hint_claims)
|
|
235
|
-
redirect_uri = await validate_post_logout_redirect_uri(
|
|
236
|
-
client_id=client_id,
|
|
237
|
-
post_logout_redirect_uri=post_logout_redirect_uri,
|
|
238
|
-
)
|
|
239
|
-
return LogoutRequestContext(
|
|
240
|
-
client_id=client_id,
|
|
241
|
-
post_logout_redirect_uri=redirect_uri,
|
|
242
|
-
id_token_hint_claims=hint_claims,
|
|
243
|
-
)
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
async def build_logout_plan(
|
|
247
|
-
*,
|
|
248
|
-
session_row,
|
|
249
|
-
client_id: UUID | None,
|
|
250
|
-
post_logout_redirect_uri: str | None,
|
|
251
|
-
state: str | None,
|
|
252
|
-
reason: str = 'logout',
|
|
253
|
-
metadata: dict[str, Any] | None = None,
|
|
254
|
-
deployment=None,
|
|
255
|
-
):
|
|
256
|
-
deployment = deployment if deployment is not None else resolve_deployment(settings)
|
|
257
|
-
persistence = _persistence()
|
|
258
|
-
now = datetime.now(timezone.utc).replace(microsecond=0)
|
|
259
|
-
existing = await persistence.get_latest_logout_for_session_async(session_row.id)
|
|
260
|
-
if existing is not None:
|
|
261
|
-
existing_meta = dict(getattr(existing, 'logout_metadata', {}) or {})
|
|
262
|
-
if post_logout_redirect_uri and 'post_logout_redirect_uri' not in existing_meta:
|
|
263
|
-
existing_meta['post_logout_redirect_uri'] = post_logout_redirect_uri
|
|
264
|
-
if state and 'state' not in existing_meta:
|
|
265
|
-
existing_meta['state'] = state
|
|
266
|
-
existing_meta['replay_count'] = int(existing_meta.get('replay_count', 0)) + 1
|
|
267
|
-
existing_meta['replayed_at'] = now.isoformat()
|
|
268
|
-
if metadata:
|
|
269
|
-
existing_meta.update(metadata)
|
|
270
|
-
if existing_meta != dict(getattr(existing, 'logout_metadata', {}) or {}):
|
|
271
|
-
existing = await persistence.update_logout_metadata_async(existing.id, metadata=existing_meta) or existing
|
|
272
|
-
return existing
|
|
273
|
-
|
|
274
|
-
front_required = bool(client_id and deployment.flag_enabled('enable_oidc_frontchannel_logout'))
|
|
275
|
-
back_required = bool(client_id and deployment.flag_enabled('enable_oidc_backchannel_logout'))
|
|
276
|
-
combined_meta = {
|
|
277
|
-
'post_logout_redirect_uri': post_logout_redirect_uri,
|
|
278
|
-
'state': state,
|
|
279
|
-
'client_id': str(client_id) if client_id is not None else None,
|
|
280
|
-
'request_validated_at': now.isoformat(),
|
|
281
|
-
'replay_count': 0,
|
|
282
|
-
'frontchannel_delivery': {'status': 'pending' if front_required else 'not_configured', 'attempts': 0, 'max_retries': 3},
|
|
283
|
-
'backchannel_delivery': {'status': 'pending' if back_required else 'not_configured', 'attempts': 0, 'max_retries': 3},
|
|
284
|
-
}
|
|
285
|
-
if metadata:
|
|
286
|
-
combined_meta.update(metadata)
|
|
287
|
-
logout = await persistence.terminate_session_async(
|
|
288
|
-
session_row.id,
|
|
289
|
-
initiated_by='rp_logout',
|
|
290
|
-
reason=reason,
|
|
291
|
-
frontchannel_required=front_required,
|
|
292
|
-
backchannel_required=back_required,
|
|
293
|
-
metadata=combined_meta,
|
|
294
|
-
)
|
|
295
|
-
if logout is None:
|
|
296
|
-
return None
|
|
297
|
-
|
|
298
|
-
frontchannel = None
|
|
299
|
-
backchannel = None
|
|
300
|
-
if client_id is not None:
|
|
301
|
-
frontchannel = await _frontchannel_builder()(
|
|
302
|
-
client_id=client_id,
|
|
303
|
-
sid=str(session_row.id),
|
|
304
|
-
iss=str(deployment.issuer or settings.issuer),
|
|
305
|
-
logout_id=logout.id,
|
|
306
|
-
)
|
|
307
|
-
backchannel = await _backchannel_builder()(
|
|
308
|
-
client_id=client_id,
|
|
309
|
-
sid=str(session_row.id),
|
|
310
|
-
sub=str(session_row.user_id),
|
|
311
|
-
iss=str(deployment.issuer or settings.issuer),
|
|
312
|
-
logout_id=logout.id,
|
|
313
|
-
)
|
|
314
|
-
plan_meta = dict(logout.logout_metadata or {})
|
|
315
|
-
plan_meta.update({
|
|
316
|
-
'post_logout_redirect_uri': post_logout_redirect_uri,
|
|
317
|
-
'state': state,
|
|
318
|
-
'frontchannel': frontchannel,
|
|
319
|
-
'backchannel': backchannel,
|
|
320
|
-
'frontchannel_delivery': (frontchannel or {}).get('delivery') if isinstance(frontchannel, dict) else {'status': 'not_configured', 'attempts': 0, 'max_retries': 3},
|
|
321
|
-
'backchannel_delivery': (backchannel or {}).get('delivery') if isinstance(backchannel, dict) else {'status': 'not_configured', 'attempts': 0, 'max_retries': 3},
|
|
322
|
-
'idempotent_replay_protection': True,
|
|
323
|
-
'replay_count': 0,
|
|
324
|
-
})
|
|
325
|
-
return await persistence.update_logout_metadata_async(logout.id, metadata=plan_meta) or logout
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
def describe(*, request=None, deployment=None) -> dict[str, object]:
|
|
329
|
-
if deployment is None and request is not None:
|
|
330
|
-
deployment = deployment_from_request(request, settings)
|
|
331
|
-
return {
|
|
332
|
-
'label': OWNER.label,
|
|
333
|
-
'title': OWNER.title,
|
|
334
|
-
'runtime_status': OWNER.runtime_status,
|
|
335
|
-
'public_surface': list(OWNER.public_surface),
|
|
336
|
-
'id_token_hint_validation_supported': True,
|
|
337
|
-
'post_logout_redirect_uri_validation_supported': True,
|
|
338
|
-
'idempotent_replay_protection': True,
|
|
339
|
-
'frontchannel_logout_supported': bool(getattr(deployment, "flag_enabled", lambda *_: True)("enable_oidc_frontchannel_logout")) if deployment is not None else True,
|
|
340
|
-
'backchannel_logout_supported': bool(getattr(deployment, "flag_enabled", lambda *_: True)("enable_oidc_backchannel_logout")) if deployment is not None else True,
|
|
341
|
-
'notes': OWNER.notes,
|
|
342
|
-
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
__all__ = [
|
|
346
|
-
'STATUS',
|
|
347
|
-
'LogoutRequestContext',
|
|
348
|
-
'StandardOwner',
|
|
349
|
-
'OWNER',
|
|
350
|
-
'assert_logout_session_active',
|
|
351
|
-
'build_logout_plan',
|
|
352
|
-
'describe',
|
|
353
|
-
'resolve_logout_client_id',
|
|
354
|
-
'validate_id_token_hint',
|
|
355
|
-
'validate_logout_request',
|
|
356
|
-
'validate_post_logout_redirect_uri',
|
|
357
|
-
]
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
"""UserInfo endpoint for OpenID Connect 1.0.
|
|
2
|
-
|
|
3
|
-
This module implements the `/userinfo` endpoint as described in the
|
|
4
|
-
OpenID Connect Core specification. It is **not** tied to an RFC so it
|
|
5
|
-
lives in the OIDC namespace instead of an `rfcXXXX` module.
|
|
6
|
-
|
|
7
|
-
The endpoint returns a set of claims about the authenticated user based
|
|
8
|
-
on the scopes granted to the access token. Unrequested claim groups are
|
|
9
|
-
omitted from the response.
|
|
10
|
-
"""
|
|
11
|
-
|
|
12
|
-
from __future__ import annotations
|
|
13
|
-
|
|
14
|
-
import inspect
|
|
15
|
-
|
|
16
|
-
from tigrbl_auth.framework import (
|
|
17
|
-
TigrblRouter,
|
|
18
|
-
TigrblApp,
|
|
19
|
-
HTTPException,
|
|
20
|
-
Request,
|
|
21
|
-
Response,
|
|
22
|
-
status,
|
|
23
|
-
)
|
|
24
|
-
|
|
25
|
-
from tigrbl_auth.security import auth as security_auth
|
|
26
|
-
from tigrbl_auth.security import deps as security_deps
|
|
27
|
-
from tigrbl_auth.services.token_service import JWTCoder, InvalidTokenError, _svc
|
|
28
|
-
from tigrbl_auth.tables import User
|
|
29
|
-
from tigrbl_auth.standards.oauth2.rfc6750 import extract_bearer_token
|
|
30
|
-
from tigrbl_auth.framework import JWAAlg
|
|
31
|
-
|
|
32
|
-
api = TigrblRouter()
|
|
33
|
-
router = api
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
async def _resolve_current_user(request: Request) -> User:
|
|
37
|
-
"""Resolve the current principal, honoring app/router dependency overrides."""
|
|
38
|
-
|
|
39
|
-
app = getattr(request, "app", None)
|
|
40
|
-
router = getattr(app, "router", None)
|
|
41
|
-
overrides = dict(getattr(app, "dependency_overrides", {}) or {})
|
|
42
|
-
router_overrides = getattr(router, "dependency_overrides", {})
|
|
43
|
-
if router_overrides:
|
|
44
|
-
overrides.update(router_overrides)
|
|
45
|
-
|
|
46
|
-
for dependency in (
|
|
47
|
-
security_deps.get_current_principal,
|
|
48
|
-
security_auth.get_current_principal,
|
|
49
|
-
):
|
|
50
|
-
override = overrides.get(dependency)
|
|
51
|
-
if override is None:
|
|
52
|
-
continue
|
|
53
|
-
try:
|
|
54
|
-
resolved = override(request)
|
|
55
|
-
except TypeError:
|
|
56
|
-
resolved = override()
|
|
57
|
-
return await resolved if inspect.isawaitable(resolved) else resolved
|
|
58
|
-
|
|
59
|
-
return await security_deps.get_current_principal(request)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
@api.route("/userinfo", methods=["GET"], response_model=None)
|
|
63
|
-
async def userinfo(request: Request) -> Response | dict[str, str]:
|
|
64
|
-
"""Return claims about the authenticated user.
|
|
65
|
-
|
|
66
|
-
The caller must present a valid access token in the ``Authorization``
|
|
67
|
-
header. Returned claims are filtered based on scopes granted in that
|
|
68
|
-
token. If the request ``Accept`` header includes ``application/jwt`` the
|
|
69
|
-
response will be JWS signed.
|
|
70
|
-
"""
|
|
71
|
-
|
|
72
|
-
token = await extract_bearer_token(
|
|
73
|
-
request,
|
|
74
|
-
request.headers.get("Authorization")
|
|
75
|
-
or request.headers.get("authorization", ""),
|
|
76
|
-
)
|
|
77
|
-
if not token:
|
|
78
|
-
raise HTTPException(status.HTTP_401_UNAUTHORIZED, "missing access token")
|
|
79
|
-
try:
|
|
80
|
-
payload = await JWTCoder.default().async_decode(token)
|
|
81
|
-
except InvalidTokenError as exc:
|
|
82
|
-
raise HTTPException(
|
|
83
|
-
status.HTTP_401_UNAUTHORIZED, "invalid access token"
|
|
84
|
-
) from exc
|
|
85
|
-
scopes: set[str] = set(payload.get("scope", "").split())
|
|
86
|
-
user = await _resolve_current_user(request)
|
|
87
|
-
|
|
88
|
-
claims: dict[str, str] = {"sub": str(user.id)}
|
|
89
|
-
if "profile" in scopes:
|
|
90
|
-
claims["name"] = user.username
|
|
91
|
-
if "email" in scopes:
|
|
92
|
-
claims["email"] = user.email
|
|
93
|
-
if "address" in scopes and getattr(user, "address", None):
|
|
94
|
-
claims["address"] = getattr(user, "address")
|
|
95
|
-
if "phone" in scopes and getattr(user, "phone", None):
|
|
96
|
-
claims["phone_number"] = getattr(user, "phone")
|
|
97
|
-
|
|
98
|
-
if "application/jwt" in (
|
|
99
|
-
request.headers.get("Accept") or request.headers.get("accept", "")
|
|
100
|
-
):
|
|
101
|
-
svc, kid = _svc()
|
|
102
|
-
token = await svc.mint(claims, alg=JWAAlg.EDDSA, kid=kid)
|
|
103
|
-
return Response(body=str(token).encode("utf-8"), headers={"content-type": "application/jwt"}, media_type="application/jwt")
|
|
104
|
-
|
|
105
|
-
return claims
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
# ---------------------------------------------------------------------------
|
|
109
|
-
# Tigrbl integration
|
|
110
|
-
# ---------------------------------------------------------------------------
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
def include_oidc_userinfo(app: TigrblApp) -> None:
|
|
114
|
-
"""Attach the UserInfo endpoint to *app* if not already present."""
|
|
115
|
-
|
|
116
|
-
if not any(
|
|
117
|
-
(getattr(route, "path", None) or getattr(route, "path_template", None))
|
|
118
|
-
== "/userinfo"
|
|
119
|
-
for route in app.router.routes
|
|
120
|
-
):
|
|
121
|
-
app.include_router(api)
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
__all__ = ["api", "router", "include_oidc_userinfo"]
|