swarmauri_auth_idp_cognito 0.1.0.dev24__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,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 [2025] [Jacob Stewart @ Swarmauri]
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,127 @@
1
+ Metadata-Version: 2.4
2
+ Name: swarmauri_auth_idp_cognito
3
+ Version: 0.1.0.dev24
4
+ Summary: AWS Cognito OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity provider implementations for Swarmauri
5
+ License-Expression: Apache-2.0
6
+ License-File: LICENSE
7
+ Keywords: swarmauri,sdk,experimental,identity,oauth2,oauth21,oidc,cognito,aws,idp
8
+ Author: Jacob Stewart
9
+ Author-email: jacob@swarmauri.com
10
+ Requires-Python: >=3.10,<3.13
11
+ Classifier: Development Status :: 1 - Planning
12
+ Classifier: Intended Audience :: Developers
13
+ Classifier: License :: OSI Approved :: Apache Software License
14
+ Classifier: Natural Language :: English
15
+ Classifier: Programming Language :: Python
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3 :: Only
18
+ Classifier: Programming Language :: Python :: 3.10
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Topic :: Internet :: WWW/HTTP :: Session
22
+ Classifier: Topic :: Security :: Cryptography
23
+ Requires-Dist: httpx
24
+ Requires-Dist: pyjwt[crypto] (>=2.8)
25
+ Requires-Dist: swarmauri_base
26
+ Requires-Dist: swarmauri_core
27
+ Description-Content-Type: text/markdown
28
+
29
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/master/assets/swarmauri.brand.theme.svg)
30
+
31
+ <p align="center">
32
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
33
+ <img src="https://img.shields.io/pypi/dm/swarmauri_auth_idp_cognito" alt="PyPI - Downloads"/></a>
34
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_cognito/">
35
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_cognito.svg"/></a>
36
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
37
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_auth_idp_cognito" alt="PyPI - Python Version"/></a>
38
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
39
+ <img src="https://img.shields.io/pypi/l/swarmauri_auth_idp_cognito" alt="PyPI - License"/></a>
40
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
41
+ <img src="https://img.shields.io/pypi/v/swarmauri_auth_idp_cognito?label=swarmauri_auth_idp_cognito&color=green" alt="PyPI - swarmauri_auth_idp_cognito"/></a>
42
+ </p>
43
+
44
+ ---
45
+
46
+ # Swarmauri Auth IDP Cognito
47
+
48
+ AWS Cognito OAuth 2.0, OAuth 2.1, and OIDC 1.0 login and app-client flows packaged for the Swarmauri ecosystem.
49
+
50
+ ## Features
51
+
52
+ - PKCE-enabled authorization code logins with signed state payloads to prevent tampering.
53
+ - Automatic discovery of Cognito endpoints with resilient HTTP retry semantics.
54
+ - ID token verification against Cognito JWKS with graceful fallback to the UserInfo endpoint.
55
+ - Machine-to-machine app clients supporting shared secrets or JWT-based client assertions.
56
+ - ComponentBase-registered classes for seamless Swarmauri plugin discovery and configuration.
57
+
58
+ ## Installation
59
+
60
+ ### pip
61
+
62
+ ```bash
63
+ pip install swarmauri_auth_idp_cognito
64
+ ```
65
+
66
+ ### uv (project)
67
+
68
+ ```bash
69
+ uv add swarmauri_auth_idp_cognito
70
+ ```
71
+
72
+ ### uv (environment)
73
+
74
+ ```bash
75
+ uv pip install swarmauri_auth_idp_cognito
76
+ ```
77
+
78
+ ## Usage
79
+
80
+ Instantiate the login classes with your Cognito issuer, app client credentials, and redirect URI.
81
+ Persist the returned state between `auth_url` and `exchange*` calls to prevent replay attacks.
82
+
83
+ ```python
84
+ from pydantic import SecretBytes, SecretStr
85
+ from swarmauri_auth_idp_cognito import CognitoOAuth21Login
86
+
87
+ login = CognitoOAuth21Login(
88
+ issuer="https://example-domain.auth.us-east-1.amazoncognito.com",
89
+ client_id="example-client-id",
90
+ client_secret=SecretStr("example-secret"),
91
+ redirect_uri="https://example.com/callback",
92
+ state_secret=SecretBytes(b"super-secret-state-key"),
93
+ )
94
+
95
+ # Within an async context:
96
+ # auth_payload = await login.auth_url()
97
+ # identity = await login.exchange_and_identity(code, auth_payload["state"])
98
+ print(login.client_id)
99
+ ```
100
+
101
+ ### Expected Workflow
102
+
103
+ 1. Call `auth_url()` and redirect the user agent to the returned authorization URL.
104
+ 2. Persist the state value and later validate it when Cognito posts back to your callback.
105
+ 3. Call `exchange_and_identity()` (or `exchange()` for the OIDC login) to normalize identity claims.
106
+ 4. Use the normalized payload to provision sessions, issue downstream tokens, or audit login activity.
107
+
108
+ App client classes expose the same `access_token` coroutine to support background services
109
+ and machine-to-machine integrations.
110
+
111
+ ## Entry Points
112
+
113
+ The distribution registers the following entry points:
114
+
115
+ - `swarmauri.auth_idp:CognitoOAuth20Login`
116
+ - `swarmauri.auth_idp:CognitoOAuth21Login`
117
+ - `swarmauri.auth_idp:CognitoOIDC10Login`
118
+ - `swarmauri.auth_idp:CognitoOAuth20AppClient`
119
+ - `swarmauri.auth_idp:CognitoOAuth21AppClient`
120
+ - `swarmauri.auth_idp:CognitoOIDC10AppClient`
121
+
122
+ ## Contributing
123
+
124
+ To contribute to swarmauri-sdk, review the
125
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md),
126
+ including development workflow, testing, and coding standards.
127
+
@@ -0,0 +1,98 @@
1
+ ![Swarmauri Logo](https://github.com/swarmauri/swarmauri-sdk/blob/master/assets/swarmauri.brand.theme.svg)
2
+
3
+ <p align="center">
4
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
5
+ <img src="https://img.shields.io/pypi/dm/swarmauri_auth_idp_cognito" alt="PyPI - Downloads"/></a>
6
+ <a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_cognito/">
7
+ <img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_cognito.svg"/></a>
8
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
9
+ <img src="https://img.shields.io/pypi/pyversions/swarmauri_auth_idp_cognito" alt="PyPI - Python Version"/></a>
10
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
11
+ <img src="https://img.shields.io/pypi/l/swarmauri_auth_idp_cognito" alt="PyPI - License"/></a>
12
+ <a href="https://pypi.org/project/swarmauri_auth_idp_cognito/">
13
+ <img src="https://img.shields.io/pypi/v/swarmauri_auth_idp_cognito?label=swarmauri_auth_idp_cognito&color=green" alt="PyPI - swarmauri_auth_idp_cognito"/></a>
14
+ </p>
15
+
16
+ ---
17
+
18
+ # Swarmauri Auth IDP Cognito
19
+
20
+ AWS Cognito OAuth 2.0, OAuth 2.1, and OIDC 1.0 login and app-client flows packaged for the Swarmauri ecosystem.
21
+
22
+ ## Features
23
+
24
+ - PKCE-enabled authorization code logins with signed state payloads to prevent tampering.
25
+ - Automatic discovery of Cognito endpoints with resilient HTTP retry semantics.
26
+ - ID token verification against Cognito JWKS with graceful fallback to the UserInfo endpoint.
27
+ - Machine-to-machine app clients supporting shared secrets or JWT-based client assertions.
28
+ - ComponentBase-registered classes for seamless Swarmauri plugin discovery and configuration.
29
+
30
+ ## Installation
31
+
32
+ ### pip
33
+
34
+ ```bash
35
+ pip install swarmauri_auth_idp_cognito
36
+ ```
37
+
38
+ ### uv (project)
39
+
40
+ ```bash
41
+ uv add swarmauri_auth_idp_cognito
42
+ ```
43
+
44
+ ### uv (environment)
45
+
46
+ ```bash
47
+ uv pip install swarmauri_auth_idp_cognito
48
+ ```
49
+
50
+ ## Usage
51
+
52
+ Instantiate the login classes with your Cognito issuer, app client credentials, and redirect URI.
53
+ Persist the returned state between `auth_url` and `exchange*` calls to prevent replay attacks.
54
+
55
+ ```python
56
+ from pydantic import SecretBytes, SecretStr
57
+ from swarmauri_auth_idp_cognito import CognitoOAuth21Login
58
+
59
+ login = CognitoOAuth21Login(
60
+ issuer="https://example-domain.auth.us-east-1.amazoncognito.com",
61
+ client_id="example-client-id",
62
+ client_secret=SecretStr("example-secret"),
63
+ redirect_uri="https://example.com/callback",
64
+ state_secret=SecretBytes(b"super-secret-state-key"),
65
+ )
66
+
67
+ # Within an async context:
68
+ # auth_payload = await login.auth_url()
69
+ # identity = await login.exchange_and_identity(code, auth_payload["state"])
70
+ print(login.client_id)
71
+ ```
72
+
73
+ ### Expected Workflow
74
+
75
+ 1. Call `auth_url()` and redirect the user agent to the returned authorization URL.
76
+ 2. Persist the state value and later validate it when Cognito posts back to your callback.
77
+ 3. Call `exchange_and_identity()` (or `exchange()` for the OIDC login) to normalize identity claims.
78
+ 4. Use the normalized payload to provision sessions, issue downstream tokens, or audit login activity.
79
+
80
+ App client classes expose the same `access_token` coroutine to support background services
81
+ and machine-to-machine integrations.
82
+
83
+ ## Entry Points
84
+
85
+ The distribution registers the following entry points:
86
+
87
+ - `swarmauri.auth_idp:CognitoOAuth20Login`
88
+ - `swarmauri.auth_idp:CognitoOAuth21Login`
89
+ - `swarmauri.auth_idp:CognitoOIDC10Login`
90
+ - `swarmauri.auth_idp:CognitoOAuth20AppClient`
91
+ - `swarmauri.auth_idp:CognitoOAuth21AppClient`
92
+ - `swarmauri.auth_idp:CognitoOIDC10AppClient`
93
+
94
+ ## Contributing
95
+
96
+ To contribute to swarmauri-sdk, review the
97
+ [guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md),
98
+ including development workflow, testing, and coding standards.
@@ -0,0 +1,88 @@
1
+ [project]
2
+ name = "swarmauri_auth_idp_cognito"
3
+ version = "0.1.0.dev24"
4
+ description = "AWS Cognito OAuth 2.0 / OAuth 2.1 / OIDC 1.0 identity provider implementations for Swarmauri"
5
+ license = "Apache-2.0"
6
+ readme = "README.md"
7
+ requires-python = ">=3.10,<3.13"
8
+ repository = "https://github.com/swarmauri/swarmauri-sdk"
9
+ authors = [{ name = "Jacob Stewart", email = "jacob@swarmauri.com" }]
10
+ classifiers = [
11
+ "Development Status :: 1 - Planning",
12
+ "Intended Audience :: Developers",
13
+ "License :: OSI Approved :: Apache Software License",
14
+ "Natural Language :: English",
15
+ "Programming Language :: Python",
16
+ "Programming Language :: Python :: 3",
17
+ "Programming Language :: Python :: 3 :: Only",
18
+ "Programming Language :: Python :: 3.10",
19
+ "Programming Language :: Python :: 3.11",
20
+ "Programming Language :: Python :: 3.12",
21
+ "Topic :: Internet :: WWW/HTTP :: Session",
22
+ "Topic :: Security :: Cryptography",
23
+ ]
24
+ dependencies = [
25
+ "swarmauri_core",
26
+ "swarmauri_base",
27
+ "httpx",
28
+ "pyjwt[crypto]>=2.8",
29
+ ]
30
+ keywords = [
31
+ "swarmauri",
32
+ "sdk",
33
+ "experimental",
34
+ "identity",
35
+ "oauth2",
36
+ "oauth21",
37
+ "oidc",
38
+ "cognito",
39
+ "aws",
40
+ "idp",
41
+ ]
42
+
43
+ [tool.uv.sources]
44
+ swarmauri_tests_pylicense = { workspace = true }
45
+ swarmauri_core = { workspace = true }
46
+ swarmauri_base = { workspace = true }
47
+
48
+ [tool.pytest.ini_options]
49
+ markers = [
50
+ "test: standard test",
51
+ "unit: Unit tests",
52
+ "i9n: Integration tests",
53
+ "r8n: Regression tests",
54
+ "acceptance: Acceptance tests",
55
+ "perf: Performance tests",
56
+ "example: Documentation examples",
57
+ ]
58
+ timeout = 300
59
+ log_cli = true
60
+ log_cli_level = "INFO"
61
+ log_cli_format = "%(asctime)s [%(levelname)s] %(message)s"
62
+ log_cli_date_format = "%Y-%m-%d %H:%M:%S"
63
+ asyncio_default_fixture_loop_scope = "function"
64
+ addopts = "--pylicense-accept-deps=sniffio"
65
+
66
+ [dependency-groups]
67
+ dev = [
68
+ "pytest>=8.0",
69
+ "pytest-asyncio>=0.24.0",
70
+ "pytest-xdist>=3.6.1",
71
+ "pytest-json-report>=1.5.0",
72
+ "pytest-timeout>=2.3.1",
73
+ "pytest-benchmark>=4.0.0",
74
+ "ruff>=0.9.9",
75
+ "swarmauri_tests_pylicense",
76
+ ]
77
+
78
+ [build-system]
79
+ requires = ["poetry-core>=1.0.0"]
80
+ build-backend = "poetry.core.masonry.api"
81
+
82
+ [project.entry-points.'swarmauri.auth_idp']
83
+ CognitoOAuth20Login = "swarmauri_auth_idp_cognito:CognitoOAuth20Login"
84
+ CognitoOAuth21Login = "swarmauri_auth_idp_cognito:CognitoOAuth21Login"
85
+ CognitoOIDC10Login = "swarmauri_auth_idp_cognito:CognitoOIDC10Login"
86
+ CognitoOAuth20AppClient = "swarmauri_auth_idp_cognito:CognitoOAuth20AppClient"
87
+ CognitoOAuth21AppClient = "swarmauri_auth_idp_cognito:CognitoOAuth21AppClient"
88
+ CognitoOIDC10AppClient = "swarmauri_auth_idp_cognito:CognitoOIDC10AppClient"
@@ -0,0 +1,105 @@
1
+ """Shared helpers for Cognito login implementations."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ from typing import Any, Callable, Mapping, Optional
7
+
8
+ import jwt
9
+ from pydantic import ConfigDict, PrivateAttr
10
+
11
+ from swarmauri_base.auth_idp.http import RetryingAsyncClient
12
+ from swarmauri_base.auth_idp.utils import verify_state
13
+
14
+
15
+ def _load_signing_key(jwks: Mapping[str, Any], kid: str) -> Any:
16
+ """Return the cryptographic key referenced by ``kid``."""
17
+
18
+ for entry in jwks.get("keys", []):
19
+ if entry.get("kid") == kid:
20
+ kty = entry.get("kty", "RSA").upper()
21
+ serialized = json.dumps(entry)
22
+ if kty == "EC":
23
+ return jwt.algorithms.ECAlgorithm.from_jwk(serialized)
24
+ return jwt.algorithms.RSAAlgorithm.from_jwk(serialized)
25
+ raise ValueError("signing key not found")
26
+
27
+
28
+ class CognitoLoginMixin:
29
+ """Provide shared discovery, HTTP, and state helpers for Cognito logins."""
30
+
31
+ model_config = ConfigDict(extra="forbid")
32
+
33
+ _http_client_factory: Callable[[], RetryingAsyncClient] = PrivateAttr(
34
+ default=RetryingAsyncClient
35
+ )
36
+ _discovery: Optional[Mapping[str, Any]] = PrivateAttr(default=None)
37
+
38
+ def _state_secret_value(self) -> bytes:
39
+ return self.state_secret.get_secret_value()
40
+
41
+ def _client_secret_value(self) -> str:
42
+ return self.client_secret.get_secret_value()
43
+
44
+ def _state_payload(self, state: str) -> Mapping[str, Any]:
45
+ return verify_state(self._state_secret_value(), state)
46
+
47
+ async def _metadata(self) -> Mapping[str, Any]:
48
+ if self._discovery is None:
49
+ url = f"{self.issuer.rstrip('/')}/.well-known/openid-configuration"
50
+ self._discovery = await self._http_get(url)
51
+ return self._discovery
52
+
53
+ async def _http_get(
54
+ self, url: str, *, headers: Optional[Mapping[str, str]] = None
55
+ ) -> Mapping[str, Any]:
56
+ request_headers = {"Accept": "application/json"}
57
+ if headers:
58
+ request_headers.update(headers)
59
+ async with self._http_client_factory() as client:
60
+ response = await client.get_retry(url, headers=request_headers)
61
+ response.raise_for_status()
62
+ return response.json()
63
+
64
+ async def _http_post(
65
+ self,
66
+ url: str,
67
+ *,
68
+ data: Mapping[str, Any],
69
+ headers: Optional[Mapping[str, str]] = None,
70
+ ) -> Mapping[str, Any]:
71
+ request_headers = {"Accept": "application/json"}
72
+ if headers:
73
+ request_headers.update(headers)
74
+ async with self._http_client_factory() as client:
75
+ response = await client.post_retry(url, data=data, headers=request_headers)
76
+ response.raise_for_status()
77
+ return response.json()
78
+
79
+ async def _decode_id_token(
80
+ self,
81
+ id_token: Optional[str],
82
+ *,
83
+ jwks_uri: str,
84
+ expected_audience: str,
85
+ issuer: str,
86
+ ) -> Mapping[str, Any]:
87
+ if not id_token:
88
+ raise ValueError("no id_token in response")
89
+ header = jwt.get_unverified_header(id_token)
90
+ kid = header.get("kid")
91
+ if not kid:
92
+ raise ValueError("missing kid in id_token header")
93
+ jwks = await self._http_get(jwks_uri)
94
+ signer = _load_signing_key(jwks, kid)
95
+ algorithm = header.get("alg", "RS256")
96
+ return jwt.decode(
97
+ id_token,
98
+ signer,
99
+ algorithms=[algorithm],
100
+ audience=expected_audience,
101
+ issuer=issuer,
102
+ )
103
+
104
+
105
+ __all__ = ["CognitoLoginMixin"]
@@ -0,0 +1,59 @@
1
+ """Cognito OAuth 2.0 client credentials app client implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import time
6
+ from typing import Callable, Optional, Tuple
7
+
8
+ from pydantic import ConfigDict, Field, PrivateAttr, SecretStr
9
+ from swarmauri_base.ComponentBase import ComponentBase
10
+ from swarmauri_base.auth_idp import OAuth20AppClientBase
11
+ from swarmauri_base.auth_idp.http import RetryingAsyncClient
12
+
13
+
14
+ @ComponentBase.register_type(OAuth20AppClientBase, "CognitoOAuth20AppClient")
15
+ class CognitoOAuth20AppClient(OAuth20AppClientBase):
16
+ """Request machine-to-machine access tokens from Cognito's OAuth 2.0 endpoint."""
17
+
18
+ model_config = ConfigDict(extra="forbid")
19
+
20
+ base_url: str
21
+ client_id: str
22
+ client_secret: SecretStr
23
+ cache_skew_seconds: int = Field(default=30, ge=0)
24
+ _http_client_factory: Callable[[], RetryingAsyncClient] = PrivateAttr(
25
+ default=RetryingAsyncClient
26
+ )
27
+ _cached_token: Optional[Tuple[str, float]] = PrivateAttr(default=None)
28
+
29
+ def _token_endpoint(self) -> str:
30
+ return f"{self.base_url.rstrip('/')}/oauth2/token"
31
+
32
+ def _client_secret_value(self) -> str:
33
+ return self.client_secret.get_secret_value()
34
+
35
+ async def _fetch_token(self, scope: Optional[str]) -> Tuple[str, float]:
36
+ form = {"grant_type": "client_credentials"}
37
+ if scope:
38
+ form["scope"] = scope
39
+ auth = (self.client_id, self._client_secret_value())
40
+ async with self._http_client_factory() as client:
41
+ response = await client.post_retry(
42
+ self._token_endpoint(),
43
+ data=form,
44
+ auth=auth,
45
+ headers={"Accept": "application/json"},
46
+ )
47
+ response.raise_for_status()
48
+ payload = response.json()
49
+ expires_at = time.time() + int(payload.get("expires_in", 3600))
50
+ return payload["access_token"], expires_at
51
+
52
+ async def access_token(self, scope: Optional[str] = None) -> str:
53
+ cached = self._cached_token
54
+ now = time.time()
55
+ if cached and now < cached[1] - self.cache_skew_seconds:
56
+ return cached[0]
57
+ token, expires_at = await self._fetch_token(scope)
58
+ self._cached_token = (token, expires_at)
59
+ return token
@@ -0,0 +1,68 @@
1
+ """Cognito OAuth 2.0 Authorization Code login implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Mapping
6
+
7
+ from pydantic import Field, SecretBytes, SecretStr
8
+ from swarmauri_base.ComponentBase import ComponentBase
9
+ from swarmauri_base.auth_idp import OAuth20LoginBase, make_pkce_pair, sign_state
10
+
11
+ from .CognitoLoginMixin import CognitoLoginMixin
12
+
13
+
14
+ @ComponentBase.register_type(OAuth20LoginBase, "CognitoOAuth20Login")
15
+ class CognitoOAuth20Login(CognitoLoginMixin, OAuth20LoginBase):
16
+ """AWS Cognito OAuth 2.0 Authorization Code flow with PKCE."""
17
+
18
+ issuer: str
19
+ client_id: str
20
+ client_secret: SecretStr
21
+ redirect_uri: str
22
+ state_secret: SecretBytes
23
+ scope: str = Field(default="openid email profile")
24
+
25
+ async def auth_url(self) -> Mapping[str, str]:
26
+ metadata = await self._metadata()
27
+ verifier, challenge = make_pkce_pair()
28
+ state = sign_state(self._state_secret_value(), {"verifier": verifier})
29
+ endpoint = metadata["authorization_endpoint"]
30
+ url = (
31
+ f"{endpoint}?response_type=code"
32
+ f"&client_id={self.client_id}&redirect_uri={self.redirect_uri}"
33
+ f"&scope={self.scope}&state={state}"
34
+ f"&code_challenge={challenge}&code_challenge_method=S256"
35
+ )
36
+ return {"url": url, "state": state}
37
+
38
+ async def exchange_and_identity(self, code: str, state: str) -> Mapping[str, Any]:
39
+ payload = self._state_payload(state)
40
+ metadata = await self._metadata()
41
+ form = {
42
+ "grant_type": "authorization_code",
43
+ "code": code,
44
+ "redirect_uri": self.redirect_uri,
45
+ "client_id": self.client_id,
46
+ "client_secret": self._client_secret_value(),
47
+ "code_verifier": payload["verifier"],
48
+ }
49
+ token_json = await self._http_post(metadata["token_endpoint"], data=form)
50
+ access_token = token_json["access_token"]
51
+ userinfo_endpoint = metadata.get("userinfo_endpoint") or (
52
+ f"{self.issuer.rstrip('/')}/oauth2/userInfo"
53
+ )
54
+ userinfo_headers = {
55
+ "Authorization": f"Bearer {access_token}",
56
+ "Accept": "application/json",
57
+ }
58
+ userinfo_json = await self._http_get(
59
+ userinfo_endpoint, headers=userinfo_headers
60
+ )
61
+ name = userinfo_json.get("name") or userinfo_json.get("given_name") or "Unknown"
62
+ return {
63
+ "issuer": "cognito-oauth2",
64
+ "sub": userinfo_json.get("sub"),
65
+ "email": userinfo_json.get("email"),
66
+ "name": name,
67
+ "raw": {"tokens": token_json, "userinfo": userinfo_json},
68
+ }
@@ -0,0 +1,103 @@
1
+ """Cognito OAuth 2.1 client credentials app client implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import json
6
+ import time
7
+ from typing import Any, Callable, Dict, Mapping, Optional, Tuple
8
+
9
+ import jwt
10
+ from pydantic import ConfigDict, Field, PrivateAttr, SecretStr
11
+ from swarmauri_base.ComponentBase import ComponentBase
12
+ from swarmauri_base.auth_idp import OAuth21AppClientBase
13
+ from swarmauri_base.auth_idp.http import RetryingAsyncClient
14
+
15
+
16
+ @ComponentBase.register_type(OAuth21AppClientBase, "CognitoOAuth21AppClient")
17
+ class CognitoOAuth21AppClient(OAuth21AppClientBase):
18
+ """Request OAuth 2.1 access tokens using either client secrets or JWT assertions."""
19
+
20
+ model_config = ConfigDict(extra="forbid")
21
+
22
+ base_url: str
23
+ client_id: str
24
+ client_secret: Optional[SecretStr] = None
25
+ private_key_jwk: Optional[Dict[str, Any]] = None
26
+ cache_skew_seconds: int = Field(default=30, ge=0)
27
+ _http_client_factory: Callable[[], RetryingAsyncClient] = PrivateAttr(
28
+ default=RetryingAsyncClient
29
+ )
30
+ _cached_token: Optional[Tuple[str, float]] = PrivateAttr(default=None)
31
+
32
+ def _token_endpoint(self) -> str:
33
+ return f"{self.base_url.rstrip('/')}/oauth2/token"
34
+
35
+ def _client_secret_value(self) -> Optional[str]:
36
+ return self.client_secret.get_secret_value() if self.client_secret else None
37
+
38
+ @staticmethod
39
+ def _load_private_key(jwk_payload: Mapping[str, Any], algorithm: str) -> Any:
40
+ serialized = json.dumps(jwk_payload)
41
+ if algorithm.upper().startswith("ES"):
42
+ return jwt.algorithms.ECAlgorithm.from_jwk(serialized)
43
+ return jwt.algorithms.RSAAlgorithm.from_jwk(serialized)
44
+
45
+ def _client_assertion_body(self) -> Dict[str, str]:
46
+ if not self.private_key_jwk:
47
+ return {}
48
+ algorithm = self.private_key_jwk.get("alg", "RS256")
49
+ key = self._load_private_key(self.private_key_jwk, algorithm)
50
+ now = int(time.time())
51
+ payload = {
52
+ "iss": self.client_id,
53
+ "sub": self.client_id,
54
+ "aud": self._token_endpoint(),
55
+ "iat": now,
56
+ "exp": now + 300,
57
+ "jti": str(now),
58
+ }
59
+ headers: Dict[str, str] = {}
60
+ if kid := self.private_key_jwk.get("kid"):
61
+ headers["kid"] = kid
62
+ assertion = jwt.encode(
63
+ payload, key=key, algorithm=algorithm, headers=headers or None
64
+ )
65
+ return {
66
+ "client_assertion_type": "urn:ietf:params:oauth:client-assertion-type:jwt-bearer",
67
+ "client_assertion": assertion,
68
+ }
69
+
70
+ async def _fetch_token(self, scope: Optional[str]) -> Tuple[str, float]:
71
+ form = {"grant_type": "client_credentials"}
72
+ if scope:
73
+ form["scope"] = scope
74
+ body = self._client_assertion_body()
75
+ auth = None
76
+ if body:
77
+ form["client_id"] = self.client_id
78
+ else:
79
+ secret = self._client_secret_value()
80
+ if not secret:
81
+ raise ValueError("client_secret or private_key_jwk must be provided")
82
+ auth = (self.client_id, secret)
83
+ payload = {**form, **body}
84
+ async with self._http_client_factory() as client:
85
+ response = await client.post_retry(
86
+ self._token_endpoint(),
87
+ data=payload,
88
+ auth=auth,
89
+ headers={"Accept": "application/json"},
90
+ )
91
+ response.raise_for_status()
92
+ data = response.json()
93
+ expires_at = time.time() + int(data.get("expires_in", 3600))
94
+ return data["access_token"], expires_at
95
+
96
+ async def access_token(self, scope: Optional[str] = None) -> str:
97
+ cached = self._cached_token
98
+ now = time.time()
99
+ if cached and now < cached[1] - self.cache_skew_seconds:
100
+ return cached[0]
101
+ token, expires_at = await self._fetch_token(scope)
102
+ self._cached_token = (token, expires_at)
103
+ return token
@@ -0,0 +1,63 @@
1
+ """Cognito OAuth 2.1 Authorization Code login implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Mapping
6
+
7
+ from pydantic import Field, SecretBytes, SecretStr
8
+ from swarmauri_base.ComponentBase import ComponentBase
9
+ from swarmauri_base.auth_idp import OAuth21LoginBase, make_pkce_pair, sign_state
10
+
11
+ from .CognitoLoginMixin import CognitoLoginMixin
12
+
13
+
14
+ @ComponentBase.register_type(OAuth21LoginBase, "CognitoOAuth21Login")
15
+ class CognitoOAuth21Login(CognitoLoginMixin, OAuth21LoginBase):
16
+ """AWS Cognito OAuth 2.1 Authorization Code flow leveraging OIDC discovery."""
17
+
18
+ issuer: str
19
+ client_id: str
20
+ client_secret: SecretStr
21
+ redirect_uri: str
22
+ state_secret: SecretBytes
23
+ scope: str = Field(default="openid email profile")
24
+
25
+ async def auth_url(self) -> Mapping[str, str]:
26
+ metadata = await self._metadata()
27
+ verifier, challenge = make_pkce_pair()
28
+ state = sign_state(self._state_secret_value(), {"verifier": verifier})
29
+ endpoint = metadata["authorization_endpoint"]
30
+ url = (
31
+ f"{endpoint}?response_type=code"
32
+ f"&client_id={self.client_id}&redirect_uri={self.redirect_uri}"
33
+ f"&scope={self.scope}&state={state}"
34
+ f"&code_challenge={challenge}&code_challenge_method=S256"
35
+ )
36
+ return {"url": url, "state": state}
37
+
38
+ async def exchange_and_identity(self, code: str, state: str) -> Mapping[str, Any]:
39
+ payload = self._state_payload(state)
40
+ metadata = await self._metadata()
41
+ form = {
42
+ "grant_type": "authorization_code",
43
+ "code": code,
44
+ "redirect_uri": self.redirect_uri,
45
+ "client_id": self.client_id,
46
+ "client_secret": self._client_secret_value(),
47
+ "code_verifier": payload["verifier"],
48
+ }
49
+ token_json = await self._http_post(metadata["token_endpoint"], data=form)
50
+ claims = await self._decode_id_token(
51
+ token_json.get("id_token"),
52
+ jwks_uri=metadata["jwks_uri"],
53
+ expected_audience=self.client_id,
54
+ issuer=metadata.get("issuer", self.issuer),
55
+ )
56
+ name = claims.get("name") or claims.get("given_name") or "Unknown"
57
+ return {
58
+ "issuer": "cognito-oauth21",
59
+ "sub": claims["sub"],
60
+ "email": claims.get("email"),
61
+ "name": name,
62
+ "raw": {"tokens": token_json},
63
+ }
@@ -0,0 +1,69 @@
1
+ """Cognito OIDC 1.0 client credentials app client implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ import time
6
+ from typing import Any, Callable, Mapping, Optional, Tuple
7
+
8
+ from pydantic import ConfigDict, Field, PrivateAttr, SecretStr
9
+ from swarmauri_base.ComponentBase import ComponentBase
10
+ from swarmauri_base.auth_idp import OIDC10AppClientBase
11
+ from swarmauri_base.auth_idp.http import RetryingAsyncClient
12
+
13
+
14
+ @ComponentBase.register_type(OIDC10AppClientBase, "CognitoOIDC10AppClient")
15
+ class CognitoOIDC10AppClient(OIDC10AppClientBase):
16
+ """Request machine-to-machine tokens using Cognito's OIDC discovery metadata."""
17
+
18
+ model_config = ConfigDict(extra="forbid")
19
+
20
+ issuer: str
21
+ client_id: str
22
+ client_secret: SecretStr
23
+ cache_skew_seconds: int = Field(default=30, ge=0)
24
+ _http_client_factory: Callable[[], RetryingAsyncClient] = PrivateAttr(
25
+ default=RetryingAsyncClient
26
+ )
27
+ _cached_token: Optional[Tuple[str, float]] = PrivateAttr(default=None)
28
+ _discovery: Optional[Mapping[str, Any]] = PrivateAttr(default=None)
29
+
30
+ def _client_secret_value(self) -> str:
31
+ return self.client_secret.get_secret_value()
32
+
33
+ async def _metadata(self) -> Mapping[str, Any]:
34
+ if self._discovery is None:
35
+ url = f"{self.issuer.rstrip('/')}/.well-known/openid-configuration"
36
+ async with self._http_client_factory() as client:
37
+ response = await client.get_retry(
38
+ url, headers={"Accept": "application/json"}
39
+ )
40
+ response.raise_for_status()
41
+ self._discovery = response.json()
42
+ return self._discovery
43
+
44
+ async def _fetch_token(self, scope: Optional[str]) -> Tuple[str, float]:
45
+ metadata = await self._metadata()
46
+ form = {"grant_type": "client_credentials"}
47
+ if scope:
48
+ form["scope"] = scope
49
+ auth = (self.client_id, self._client_secret_value())
50
+ async with self._http_client_factory() as client:
51
+ response = await client.post_retry(
52
+ metadata["token_endpoint"],
53
+ data=form,
54
+ auth=auth,
55
+ headers={"Accept": "application/json"},
56
+ )
57
+ response.raise_for_status()
58
+ payload = response.json()
59
+ expires_at = time.time() + int(payload.get("expires_in", 3600))
60
+ return payload["access_token"], expires_at
61
+
62
+ async def access_token(self, scope: Optional[str] = None) -> str:
63
+ cached = self._cached_token
64
+ now = time.time()
65
+ if cached and now < cached[1] - self.cache_skew_seconds:
66
+ return cached[0]
67
+ token, expires_at = await self._fetch_token(scope)
68
+ self._cached_token = (token, expires_at)
69
+ return token
@@ -0,0 +1,74 @@
1
+ """Cognito OpenID Connect 1.0 Authorization Code login implementation."""
2
+
3
+ from __future__ import annotations
4
+
5
+ from typing import Any, Mapping
6
+
7
+ from pydantic import Field, SecretBytes, SecretStr
8
+ from swarmauri_base.ComponentBase import ComponentBase
9
+ from swarmauri_base.auth_idp import OIDC10LoginBase, make_pkce_pair, sign_state
10
+
11
+ from .CognitoLoginMixin import CognitoLoginMixin
12
+
13
+
14
+ @ComponentBase.register_type(OIDC10LoginBase, "CognitoOIDC10Login")
15
+ class CognitoOIDC10Login(CognitoLoginMixin, OIDC10LoginBase):
16
+ """AWS Cognito OIDC 1.0 Authorization Code flow with ID token validation."""
17
+
18
+ issuer: str
19
+ client_id: str
20
+ client_secret: SecretStr
21
+ redirect_uri: str
22
+ state_secret: SecretBytes
23
+ scope: str = Field(default="openid email profile")
24
+
25
+ async def auth_url(self) -> Mapping[str, str]:
26
+ metadata = await self._metadata()
27
+ verifier, challenge = make_pkce_pair()
28
+ state = sign_state(self._state_secret_value(), {"verifier": verifier})
29
+ endpoint = metadata["authorization_endpoint"]
30
+ url = (
31
+ f"{endpoint}?response_type=code"
32
+ f"&client_id={self.client_id}&redirect_uri={self.redirect_uri}"
33
+ f"&scope={self.scope}&state={state}"
34
+ f"&code_challenge={challenge}&code_challenge_method=S256"
35
+ )
36
+ return {"url": url, "state": state}
37
+
38
+ async def exchange(self, code: str, state: str) -> Mapping[str, Any]:
39
+ payload = self._state_payload(state)
40
+ metadata = await self._metadata()
41
+ form = {
42
+ "grant_type": "authorization_code",
43
+ "code": code,
44
+ "redirect_uri": self.redirect_uri,
45
+ "client_id": self.client_id,
46
+ "client_secret": self._client_secret_value(),
47
+ "code_verifier": payload["verifier"],
48
+ }
49
+ token_json = await self._http_post(metadata["token_endpoint"], data=form)
50
+ claims = await self._decode_id_token(
51
+ token_json.get("id_token"),
52
+ jwks_uri=metadata["jwks_uri"],
53
+ expected_audience=self.client_id,
54
+ issuer=metadata.get("issuer", self.issuer),
55
+ )
56
+ email = claims.get("email")
57
+ name = claims.get("name") or claims.get("given_name") or "Unknown"
58
+ if (not email or name == "Unknown") and metadata.get("userinfo_endpoint"):
59
+ headers = {
60
+ "Authorization": f"Bearer {token_json['access_token']}",
61
+ "Accept": "application/json",
62
+ }
63
+ userinfo_json = await self._http_get(
64
+ metadata["userinfo_endpoint"], headers=headers
65
+ )
66
+ email = userinfo_json.get("email") or email
67
+ name = userinfo_json.get("name") or name
68
+ return {
69
+ "issuer": "cognito-oidc",
70
+ "sub": claims["sub"],
71
+ "email": email,
72
+ "name": name,
73
+ "raw": {"tokens": token_json},
74
+ }
@@ -0,0 +1,17 @@
1
+ """AWS Cognito identity provider implementations for Swarmauri."""
2
+
3
+ from .CognitoOAuth20AppClient import CognitoOAuth20AppClient
4
+ from .CognitoOAuth20Login import CognitoOAuth20Login
5
+ from .CognitoOAuth21AppClient import CognitoOAuth21AppClient
6
+ from .CognitoOAuth21Login import CognitoOAuth21Login
7
+ from .CognitoOIDC10AppClient import CognitoOIDC10AppClient
8
+ from .CognitoOIDC10Login import CognitoOIDC10Login
9
+
10
+ __all__ = [
11
+ "CognitoOAuth20AppClient",
12
+ "CognitoOAuth20Login",
13
+ "CognitoOAuth21AppClient",
14
+ "CognitoOAuth21Login",
15
+ "CognitoOIDC10AppClient",
16
+ "CognitoOIDC10Login",
17
+ ]