apexauthlib 0.1.5__tar.gz → 0.1.6__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.
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/PKG-INFO +1 -1
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/integration/api.py +22 -1
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/pyproject.toml +1 -1
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/LICENSE +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/README.md +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/__init__.py +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/entities/__init__.py +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/entities/auth.py +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/fastapi/__init__.py +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/fastapi/auth.py +0 -0
- {apexauthlib-0.1.5 → apexauthlib-0.1.6}/apexauthlib/integration/__init__.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from dataclasses import dataclass, field
|
|
4
|
-
from typing import Any, Generic, Mapping
|
|
4
|
+
from typing import Any, Generic, Iterable, Mapping
|
|
5
5
|
|
|
6
6
|
from apexdevkit.formatter import DataclassFormatter, Formatter
|
|
7
7
|
from apexdevkit.http import FluentHttp, JsonDict
|
|
@@ -95,6 +95,27 @@ class AuthApi(Generic[ItemT]):
|
|
|
95
95
|
metadata=self.formatter.load(result["metadata"]),
|
|
96
96
|
)
|
|
97
97
|
|
|
98
|
+
def users_for_service(self) -> Iterable[ServiceUserInfo[ItemT]]:
|
|
99
|
+
result = JsonDict(
|
|
100
|
+
(
|
|
101
|
+
self.http.with_header("Authorization", f"Bearer {self.token}")
|
|
102
|
+
.get()
|
|
103
|
+
.on_endpoint(f"/services/{self.service_name}/users")
|
|
104
|
+
.on_failure(raises=RuntimeError)
|
|
105
|
+
.json()
|
|
106
|
+
)
|
|
107
|
+
)["data"]["users"]
|
|
108
|
+
|
|
109
|
+
for raw_user in result["users"]:
|
|
110
|
+
user = dict(raw_user["user"])
|
|
111
|
+
user["hashed_password"] = "unknown"
|
|
112
|
+
|
|
113
|
+
yield ServiceUserInfo[ItemT](
|
|
114
|
+
user=self.user_formatter.load(user),
|
|
115
|
+
is_superuser=bool(raw_user["is_superuser"]),
|
|
116
|
+
metadata=self.formatter.load(raw_user["metadata"]),
|
|
117
|
+
)
|
|
118
|
+
|
|
98
119
|
|
|
99
120
|
@dataclass
|
|
100
121
|
class AuthCodeApi:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|