usso 0.6.0__py3-none-any.whl → 0.8.0__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.
usso/__init__.py CHANGED
@@ -1,3 +1 @@
1
- from .usso_fastapi import integration as fastapi_integration
2
-
3
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: dev
49
52
  Requires-Dist: check-manifest ; extra == 'dev'
50
53
  Provides-Extra: django
@@ -0,0 +1,12 @@
1
+ usso/__init__.py,sha256=bHjlWFkwxHTNsC0g-aUqynQ8IrtXp1apELqCqsrynns,27
2
+ usso/core.py,sha256=h9dvXVW1ZQN-vp8W2nrqf5Msz9uTXIWJ5cxnWw1SZ_Q,695
3
+ usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
4
+ usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ usso/fastapi/__init__.py,sha256=mLF1jtu9w1WXksXh6F8RoOLnh3s5W9S22iPq6uF6zQU,66
6
+ usso/fastapi/integration.py,sha256=WGDSYGMRA-jguHzyQr96iGZEoV_pbP0OaCRt_Tm6mtg,2583
7
+ usso-0.8.0.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
8
+ usso-0.8.0.dist-info/METADATA,sha256=lIRDYs4ltP6v89MCLDl8eBFs4bCbY5zxbS4D-RPvdw0,4305
9
+ usso-0.8.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
10
+ usso-0.8.0.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
11
+ usso-0.8.0.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
12
+ usso-0.8.0.dist-info/RECORD,,
File without changes
@@ -1,12 +0,0 @@
1
- usso/__init__.py,sha256=378nEiZJMlubUbb6jecqoi5IRy3plKhQcL_CI58LSgQ,89
2
- usso/core.py,sha256=h9dvXVW1ZQN-vp8W2nrqf5Msz9uTXIWJ5cxnWw1SZ_Q,695
3
- usso/exceptions.py,sha256=hawOAuVbvQtjgRfwp1KFZ4SmV7fh720y5Gom9JVA8W8,504
4
- usso/package_data.dat,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- usso/usso_fastapi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
- usso/usso_fastapi/integration.py,sha256=HBcyoYV5a23lr-Jz06m3aDSlXGrK9Gi5rrTMnwF9NQs,2498
7
- usso-0.6.0.dist-info/LICENSE.txt,sha256=ceC9ZJOV9H6CtQDcYmHOS46NA3dHJ_WD4J9blH513pc,1081
8
- usso-0.6.0.dist-info/METADATA,sha256=6eLV0pdsgkEY1T1NoVT3v6GcO0wVCGzNpitkNdpueQE,4211
9
- usso-0.6.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
10
- usso-0.6.0.dist-info/entry_points.txt,sha256=4Zgpm5ELaAWPf0jPGJFz1_X69H7un8ycT3WdGoJ0Vvk,35
11
- usso-0.6.0.dist-info/top_level.txt,sha256=g9Jf6h1Oyidh0vPiFni7UHInTJjSvu6cUalpLTIvthg,5
12
- usso-0.6.0.dist-info/RECORD,,
File without changes