swarmauri_auth_idp_github 0.2.0.dev5__py3-none-any.whl → 0.11.0.dev2__py3-none-any.whl
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.
- swarmauri_auth_idp_github/GitHubAppClientMixin.py +3 -1
- swarmauri_auth_idp_github/GitHubOAuth20Login.py +3 -1
- swarmauri_auth_idp_github/GitHubOAuth21Login.py +3 -1
- swarmauri_auth_idp_github/GitHubOAuthLoginMixin.py +8 -2
- {swarmauri_auth_idp_github-0.2.0.dev5.dist-info → swarmauri_auth_idp_github-0.11.0.dev2.dist-info}/METADATA +16 -13
- swarmauri_auth_idp_github-0.11.0.dev2.dist-info/RECORD +12 -0
- {swarmauri_auth_idp_github-0.2.0.dev5.dist-info → swarmauri_auth_idp_github-0.11.0.dev2.dist-info}/WHEEL +1 -1
- swarmauri_auth_idp_github-0.2.0.dev5.dist-info/RECORD +0 -12
- {swarmauri_auth_idp_github-0.2.0.dev5.dist-info → swarmauri_auth_idp_github-0.11.0.dev2.dist-info}/entry_points.txt +0 -0
- {swarmauri_auth_idp_github-0.2.0.dev5.dist-info → swarmauri_auth_idp_github-0.11.0.dev2.dist-info}/licenses/LICENSE +0 -0
|
@@ -42,7 +42,9 @@ class GitHubAppClientMixin:
|
|
|
42
42
|
def _app_jwt(self) -> str:
|
|
43
43
|
now = int(time.time())
|
|
44
44
|
payload = {"iat": now - 60, "exp": now + 600, "iss": self.app_id}
|
|
45
|
-
return jwt.encode(
|
|
45
|
+
return jwt.encode(
|
|
46
|
+
payload, self._private_key_value(), algorithm="RS256"
|
|
47
|
+
)
|
|
46
48
|
|
|
47
49
|
def _request_payload(self) -> Dict[str, Any]:
|
|
48
50
|
payload: Dict[str, Any] = {}
|
|
@@ -18,7 +18,9 @@ class GitHubOAuth20Login(GitHubOAuthLoginMixin, OAuth20LoginBase):
|
|
|
18
18
|
payload = await self._auth_payload()
|
|
19
19
|
return {"url": payload["url"], "state": payload["state"]}
|
|
20
20
|
|
|
21
|
-
async def exchange_and_identity(
|
|
21
|
+
async def exchange_and_identity(
|
|
22
|
+
self, code: str, state: str
|
|
23
|
+
) -> Mapping[str, Any]:
|
|
22
24
|
tokens = await self._exchange_tokens(code, state)
|
|
23
25
|
profile = await self._fetch_profile(tokens["access_token"])
|
|
24
26
|
return {
|
|
@@ -18,7 +18,9 @@ class GitHubOAuth21Login(GitHubOAuthLoginMixin, OAuth21LoginBase):
|
|
|
18
18
|
payload = await self._auth_payload()
|
|
19
19
|
return {"url": payload["url"], "state": payload["state"]}
|
|
20
20
|
|
|
21
|
-
async def exchange_and_identity(
|
|
21
|
+
async def exchange_and_identity(
|
|
22
|
+
self, code: str, state: str
|
|
23
|
+
) -> Mapping[str, Any]:
|
|
22
24
|
tokens = await self._exchange_tokens(code, state)
|
|
23
25
|
profile = await self._fetch_profile(tokens["access_token"])
|
|
24
26
|
return {
|
|
@@ -59,7 +59,9 @@ class GitHubOAuthLoginMixin:
|
|
|
59
59
|
)
|
|
60
60
|
return {"url": url, "state": state, "verifier": verifier}
|
|
61
61
|
|
|
62
|
-
async def _exchange_tokens(
|
|
62
|
+
async def _exchange_tokens(
|
|
63
|
+
self, code: str, state: str
|
|
64
|
+
) -> Mapping[str, Any]:
|
|
63
65
|
payload = verify_state(self._state_secret_value(), state)
|
|
64
66
|
form = {
|
|
65
67
|
"client_id": self.client_id,
|
|
@@ -108,7 +110,11 @@ class GitHubOAuthLoginMixin:
|
|
|
108
110
|
None,
|
|
109
111
|
)
|
|
110
112
|
fallback = primary or next(
|
|
111
|
-
(
|
|
113
|
+
(
|
|
114
|
+
entry
|
|
115
|
+
for entry in emails
|
|
116
|
+
if isinstance(entry, Mapping)
|
|
117
|
+
),
|
|
112
118
|
None,
|
|
113
119
|
)
|
|
114
120
|
if fallback:
|
|
@@ -1,47 +1,48 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: swarmauri_auth_idp_github
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.11.0.dev2
|
|
4
4
|
Summary: GitHub OAuth 2.0 / OAuth 2.1 identity provider implementations for Swarmauri
|
|
5
5
|
License-Expression: Apache-2.0
|
|
6
6
|
License-File: LICENSE
|
|
7
7
|
Keywords: swarmauri,sdk,experimental,identity,oauth2,oauth21,github,idp
|
|
8
8
|
Author: Jacob Stewart
|
|
9
9
|
Author-email: jacob@swarmauri.com
|
|
10
|
-
Requires-Python: >=3.10,<3.
|
|
10
|
+
Requires-Python: >=3.10,<3.15
|
|
11
11
|
Classifier: Development Status :: 1 - Planning
|
|
12
12
|
Classifier: Intended Audience :: Developers
|
|
13
13
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
14
|
Classifier: Natural Language :: English
|
|
15
|
+
Classifier: Topic :: Internet :: WWW/HTTP
|
|
16
|
+
Classifier: Topic :: Security :: Cryptography
|
|
15
17
|
Classifier: Programming Language :: Python
|
|
16
18
|
Classifier: Programming Language :: Python :: 3
|
|
17
19
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
18
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
19
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
20
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
-
Classifier:
|
|
22
|
-
Classifier:
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
25
|
Requires-Dist: httpx (>=0.27)
|
|
24
26
|
Requires-Dist: pyjwt[crypto] (>=2.8)
|
|
25
27
|
Requires-Dist: swarmauri_base
|
|
26
28
|
Requires-Dist: swarmauri_core
|
|
27
29
|
Description-Content-Type: text/markdown
|
|
28
30
|
|
|
29
|
-

|
|
30
32
|
|
|
31
33
|
<p align="center">
|
|
34
|
+
<a href="https://pepy.tech/project/swarmauri_auth_idp_github/">
|
|
35
|
+
<img src="https://static.pepy.tech/badge/swarmauri_auth_idp_github/month" alt="PyPI - Downloads"/></a>
|
|
36
|
+
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_auth_idp_github/">
|
|
37
|
+
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/standards/swarmauri_auth_idp_github.svg"/></a>
|
|
32
38
|
<a href="https://pypi.org/project/swarmauri_auth_idp_github/">
|
|
33
|
-
<img src="https://img.shields.io/
|
|
34
|
-
<a href="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_github/">
|
|
35
|
-
<img alt="Hits" src="https://hits.sh/github.com/swarmauri/swarmauri-sdk/tree/master/pkgs/experimental/swarmauri_auth_idp_github.svg"/></a>
|
|
36
|
-
<a href="https://pypi.org/project/swarmauri_auth_idp_github/">
|
|
37
|
-
<img src="https://img.shields.io/pypi/pyversions/swarmauri_auth_idp_github" alt="PyPI - Python Version"/></a>
|
|
39
|
+
<img src="https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13%20%7C%203.14-blue" alt="PyPI - Python Version"/></a>
|
|
38
40
|
<a href="https://pypi.org/project/swarmauri_auth_idp_github/">
|
|
39
41
|
<img src="https://img.shields.io/pypi/l/swarmauri_auth_idp_github" alt="PyPI - License"/></a>
|
|
40
42
|
<a href="https://pypi.org/project/swarmauri_auth_idp_github/">
|
|
41
43
|
<img src="https://img.shields.io/pypi/v/swarmauri_auth_idp_github?label=swarmauri_auth_idp_github&color=green" alt="PyPI - swarmauri_auth_idp_github"/></a>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
---
|
|
44
|
+
<a href="https://discord.gg/N4UpBuQv8T">
|
|
45
|
+
<img src="https://img.shields.io/badge/Discord-Join%20Chat-5865F2?logo=discord&logoColor=white" alt="Discord"/></a></p>
|
|
45
46
|
|
|
46
47
|
# Swarmauri Auth IDP GitHub
|
|
47
48
|
|
|
@@ -118,3 +119,5 @@ To contribute to swarmauri-sdk, review the
|
|
|
118
119
|
[guidelines for contributing](https://github.com/swarmauri/swarmauri-sdk/blob/master/CONTRIBUTING.md)
|
|
119
120
|
which cover development workflow, testing, and coding standards.
|
|
120
121
|
|
|
122
|
+
|
|
123
|
+
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
swarmauri_auth_idp_github/GitHubAppClientMixin.py,sha256=O0i-3ZHAUaF7qJ1xjrmsTC5_2u-xlmfmPmUEc5Zdxo8,3740
|
|
2
|
+
swarmauri_auth_idp_github/GitHubOAuth20AppClient.py,sha256=bxOh9GKH0Iq1KYaiF5fZT0eAwF4nnvpCO9nGuiXfnOU,776
|
|
3
|
+
swarmauri_auth_idp_github/GitHubOAuth20Login.py,sha256=F45KfP2cAafZb_TrFFCxuuM_BwqedDS8Dh5qRyP8GF4,1179
|
|
4
|
+
swarmauri_auth_idp_github/GitHubOAuth21AppClient.py,sha256=Fw2ZJITz5E5xHifRqpiQLhPWCZFP7iDMFV6XmTsZSos,776
|
|
5
|
+
swarmauri_auth_idp_github/GitHubOAuth21Login.py,sha256=Kwml6ZWLJbYINNcNPZmtGASCZeEB7Il1uKOksq4uQ6Y,1179
|
|
6
|
+
swarmauri_auth_idp_github/GitHubOAuthLoginMixin.py,sha256=fvLR5_Ja3g2iHVnAj7xEoWgAdA3p17njMzou5nuc0VQ,4755
|
|
7
|
+
swarmauri_auth_idp_github/__init__.py,sha256=kWBQypWyfGZQXClW-rDgW2mhzpu_x_1KQ2dG0DGAe18,410
|
|
8
|
+
swarmauri_auth_idp_github-0.11.0.dev2.dist-info/METADATA,sha256=SzGkRHJ-SlqNzeTS9cXJgUziWorMrc0EFI2HS1SQL2o,4852
|
|
9
|
+
swarmauri_auth_idp_github-0.11.0.dev2.dist-info/WHEEL,sha256=eY7nduwzv-ldUxpzbRlxwvC693Hg6PX8bWDjEHjZ_dk,88
|
|
10
|
+
swarmauri_auth_idp_github-0.11.0.dev2.dist-info/entry_points.txt,sha256=Kyl5ULzQvFKfdh81CReMHOtLVSSsE63J0mgj7ggZRuk,294
|
|
11
|
+
swarmauri_auth_idp_github-0.11.0.dev2.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
|
|
12
|
+
swarmauri_auth_idp_github-0.11.0.dev2.dist-info/RECORD,,
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
swarmauri_auth_idp_github/GitHubAppClientMixin.py,sha256=weKQX7z2wdULEkJdRvqpD25_W2E0qX-pGUfSslUonkY,3718
|
|
2
|
-
swarmauri_auth_idp_github/GitHubOAuth20AppClient.py,sha256=bxOh9GKH0Iq1KYaiF5fZT0eAwF4nnvpCO9nGuiXfnOU,776
|
|
3
|
-
swarmauri_auth_idp_github/GitHubOAuth20Login.py,sha256=O_WhYJE3RM0_5NWl0Fgasfcr23qULW6r6PD3J6taciw,1165
|
|
4
|
-
swarmauri_auth_idp_github/GitHubOAuth21AppClient.py,sha256=Fw2ZJITz5E5xHifRqpiQLhPWCZFP7iDMFV6XmTsZSos,776
|
|
5
|
-
swarmauri_auth_idp_github/GitHubOAuth21Login.py,sha256=Qt2KIDsbhDZC_Pv5Ggu344n8D-KRWJQGhADisbQtJ9Q,1165
|
|
6
|
-
swarmauri_auth_idp_github/GitHubOAuthLoginMixin.py,sha256=IglqswmCEXX9hEvS0b2dnW5_k2nQT2bXrWbZu20Sypo,4615
|
|
7
|
-
swarmauri_auth_idp_github/__init__.py,sha256=kWBQypWyfGZQXClW-rDgW2mhzpu_x_1KQ2dG0DGAe18,410
|
|
8
|
-
swarmauri_auth_idp_github-0.2.0.dev5.dist-info/METADATA,sha256=D4FUHCgura2odzk8q9AAhYgs71xijtTvmKnLY-TFNvg,4542
|
|
9
|
-
swarmauri_auth_idp_github-0.2.0.dev5.dist-info/WHEEL,sha256=kJCRJT_g0adfAJzTx2GUMmS80rTJIVHRCfG0DQgLq3o,88
|
|
10
|
-
swarmauri_auth_idp_github-0.2.0.dev5.dist-info/entry_points.txt,sha256=Kyl5ULzQvFKfdh81CReMHOtLVSSsE63J0mgj7ggZRuk,294
|
|
11
|
-
swarmauri_auth_idp_github-0.2.0.dev5.dist-info/licenses/LICENSE,sha256=djUXOlCxLVszShEpZXshZ7v33G-2qIC_j9KXpWKZSzQ,11359
|
|
12
|
-
swarmauri_auth_idp_github-0.2.0.dev5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|