usso 0.6.0__tar.gz → 0.8.0__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: A plug-and-play client for integrating universal single sign-on (SSO) with Python frameworks, enabling secure and seamless authentication across microservices.
5
5
  Author-email: Mahdi Kiani <mahdikiany@gmail.com>
6
6
  Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
@@ -45,6 +45,9 @@ Requires-Python: >=3.8
45
45
  Description-Content-Type: text/markdown
46
46
  License-File: LICENSE.txt
47
47
  Requires-Dist: peppercorn
48
+ Requires-Dist: pydantic>=1.8.2
49
+ Requires-Dist: requests>=2.26.0
50
+ Requires-Dist: pyjwt[crypto]
48
51
  Provides-Extra: fastapi
49
52
  Requires-Dist: fastapi>=0.65.0; extra == "fastapi"
50
53
  Requires-Dist: uvicorn[standard]>=0.13.0; extra == "fastapi"
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "usso"
7
- version = "0.6.0"
7
+ version = "0.8.0"
8
8
  description = "A plug-and-play client for integrating universal single sign-on (SSO) with Python frameworks, enabling secure and seamless authentication across microservices."
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
@@ -30,7 +30,10 @@ classifiers = [
30
30
  "Programming Language :: Python :: 3 :: Only",
31
31
  ]
32
32
  dependencies = [
33
- "peppercorn" # Example main dependency
33
+ "peppercorn", # Example main dependency
34
+ "pydantic>=1.8.2",
35
+ "requests>=2.26.0",
36
+ "pyjwt[crypto]"
34
37
  ]
35
38
  optional-dependencies = {"fastapi" = ["fastapi>=0.65.0", "uvicorn[standard]>=0.13.0"],"django" = ["Django>=3.2"],"dev" = ["check-manifest"],"test" = ["coverage"]}
36
39
 
@@ -0,0 +1 @@
1
+ from .core import UserData
@@ -0,0 +1 @@
1
+ from .integration import user_data_from_token, jwt_access_security
@@ -40,13 +40,16 @@ async def user_data_from_token(token: str, **kwargs) -> UserData | None:
40
40
  except jwt.exceptions.InvalidTokenError:
41
41
  if kwargs.get("raise_exception"):
42
42
  raise USSOException(
43
- status_code=HTTP_401_UNAUTHORIZED, error="invalid_token"
43
+ status_code=HTTP_401_UNAUTHORIZED,
44
+ error="invalid_token",
44
45
  )
45
46
  return None
46
47
  except Exception as e:
47
48
  if kwargs.get("raise_exception"):
48
49
  raise USSOException(
49
- status_code=HTTP_401_UNAUTHORIZED, error="error", message=str(e)
50
+ status_code=HTTP_401_UNAUTHORIZED,
51
+ error="error",
52
+ message=str(e),
50
53
  )
51
54
  logger.error(e)
52
55
  return None
@@ -69,5 +72,8 @@ async def jwt_access_security(request: Request) -> UserData | None:
69
72
  return await user_data_from_token(cookie_token, **kwargs)
70
73
 
71
74
  if kwargs.get("raise_exception", True):
72
- raise USSOException(status_code=HTTP_401_UNAUTHORIZED, error="unauthorized")
75
+ raise USSOException(
76
+ status_code=HTTP_401_UNAUTHORIZED,
77
+ error="unauthorized",
78
+ )
73
79
  return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: usso
3
- Version: 0.6.0
3
+ Version: 0.8.0
4
4
  Summary: A plug-and-play client for integrating universal single sign-on (SSO) with Python frameworks, enabling secure and seamless authentication across microservices.
5
5
  Author-email: Mahdi Kiani <mahdikiany@gmail.com>
6
6
  Maintainer-email: Mahdi Kiani <mahdikiany@gmail.com>
@@ -45,6 +45,9 @@ Requires-Python: >=3.8
45
45
  Description-Content-Type: text/markdown
46
46
  License-File: LICENSE.txt
47
47
  Requires-Dist: peppercorn
48
+ Requires-Dist: pydantic>=1.8.2
49
+ Requires-Dist: requests>=2.26.0
50
+ Requires-Dist: pyjwt[crypto]
48
51
  Provides-Extra: fastapi
49
52
  Requires-Dist: fastapi>=0.65.0; extra == "fastapi"
50
53
  Requires-Dist: uvicorn[standard]>=0.13.0; extra == "fastapi"
@@ -11,6 +11,6 @@ src/usso.egg-info/dependency_links.txt
11
11
  src/usso.egg-info/entry_points.txt
12
12
  src/usso.egg-info/requires.txt
13
13
  src/usso.egg-info/top_level.txt
14
- src/usso/usso_fastapi/__init__.py
15
- src/usso/usso_fastapi/integration.py
14
+ src/usso/fastapi/__init__.py
15
+ src/usso/fastapi/integration.py
16
16
  tests/test_simple.py
@@ -1,4 +1,7 @@
1
1
  peppercorn
2
+ pydantic>=1.8.2
3
+ requests>=2.26.0
4
+ pyjwt[crypto]
2
5
 
3
6
  [dev]
4
7
  check-manifest
@@ -1,3 +0,0 @@
1
- from .usso_fastapi import integration as fastapi_integration
2
-
3
- from .core import UserData
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes