apexauthlib 0.1.6__py3-none-any.whl → 0.1.7__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.
@@ -83,6 +83,21 @@ def get_user_with_full_metadata(
83
83
  )
84
84
 
85
85
 
86
+ def get_user_and_service_users(
87
+ token: TokenDependable,
88
+ auth: AuthApiProviderDependable,
89
+ ) -> tuple[ServiceUserInfo[Any], list[ServiceUserInfo[Any]]]:
90
+ try:
91
+ api = auth.for_token(token)
92
+ return api.full_metadata_for(api.user().id), list(api.users_for_service())
93
+ except Exception as e:
94
+ raise HTTPException(
95
+ status_code=status.HTTP_401_UNAUTHORIZED,
96
+ detail=str(e),
97
+ headers={"WWW-Authenticate": "Bearer"},
98
+ )
99
+
100
+
86
101
  @dataclass
87
102
  class TokenResponse:
88
103
  access_token: str
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: apexauthlib
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: Apex authorization library for services
5
5
  Author: Apex Dev
6
6
  Author-email: dev@apex.ge
@@ -2,10 +2,10 @@ apexauthlib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
2
2
  apexauthlib/entities/__init__.py,sha256=KghMo6a2QWdPzWlMqdGAKOaVvRmTCOIVhXtIHrX7A_M,149
3
3
  apexauthlib/entities/auth.py,sha256=TOs-3eNWodjrI8iFpozsNnn1KQTbPKCllbGzHSPYah8,836
4
4
  apexauthlib/fastapi/__init__.py,sha256=G77C3ZIqjsXdh4fiH5FZyF_hyzVtS3waJJGa_TBGMWE,103
5
- apexauthlib/fastapi/auth.py,sha256=rPQzLSbXEkfjF2PQXvD4XPfGtHVjBKpGuQLNl0-pZCo,3429
5
+ apexauthlib/fastapi/auth.py,sha256=hkvG2BougydElkYbEpwsuSgRoLOLANe6DbVSoa-zBRM,3917
6
6
  apexauthlib/integration/__init__.py,sha256=f2lGbyoGct4kpZ2CUTExHhtQHs-1YR_xanvrj9Y4GiI,87
7
7
  apexauthlib/integration/api.py,sha256=iWkFHkkjXxJvZfBK093zq-mvAtg-g8zvpFxun74znsw,4305
8
- apexauthlib-0.1.6.dist-info/LICENSE,sha256=iai0ILQTDgUXV1cIXl0UzSeOdFpMFK3shn5aqnz_Uro,1065
9
- apexauthlib-0.1.6.dist-info/METADATA,sha256=bEhrSh8mSyjQgsE_NgaLxknesmMw9toPXUmAhzHiT-c,518
10
- apexauthlib-0.1.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
- apexauthlib-0.1.6.dist-info/RECORD,,
8
+ apexauthlib-0.1.7.dist-info/LICENSE,sha256=iai0ILQTDgUXV1cIXl0UzSeOdFpMFK3shn5aqnz_Uro,1065
9
+ apexauthlib-0.1.7.dist-info/METADATA,sha256=Vwk84Dc9EdyV1Rh4mitJ7JW4Sgm7ibfXy8sjiHh5bmo,518
10
+ apexauthlib-0.1.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
11
+ apexauthlib-0.1.7.dist-info/RECORD,,