apexauthlib 0.1.7__tar.gz → 0.1.9__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.7 → apexauthlib-0.1.9}/PKG-INFO +1 -1
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/entities/auth.py +2 -2
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/integration/api.py +14 -12
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/pyproject.toml +1 -1
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/LICENSE +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/README.md +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/__init__.py +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/entities/__init__.py +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/fastapi/__init__.py +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/fastapi/auth.py +0 -0
- {apexauthlib-0.1.7 → apexauthlib-0.1.9}/apexauthlib/integration/__init__.py +0 -0
|
@@ -22,7 +22,7 @@ class User:
|
|
|
22
22
|
@dataclass(frozen=True)
|
|
23
23
|
class Service:
|
|
24
24
|
service: str
|
|
25
|
-
|
|
25
|
+
admins: list[str]
|
|
26
26
|
|
|
27
27
|
|
|
28
28
|
@dataclass(frozen=True)
|
|
@@ -46,5 +46,5 @@ class Client:
|
|
|
46
46
|
@dataclass(frozen=True)
|
|
47
47
|
class ServiceUserInfo(Generic[ItemT]):
|
|
48
48
|
user: User
|
|
49
|
-
|
|
49
|
+
is_service_admin: bool
|
|
50
50
|
metadata: ItemT
|
|
@@ -91,28 +91,30 @@ class AuthApi(Generic[ItemT]):
|
|
|
91
91
|
|
|
92
92
|
return ServiceUserInfo[ItemT](
|
|
93
93
|
user=self.user_formatter.load(user),
|
|
94
|
-
|
|
94
|
+
is_service_admin=bool(result["is_service_admin"]),
|
|
95
95
|
metadata=self.formatter.load(result["metadata"]),
|
|
96
96
|
)
|
|
97
97
|
|
|
98
98
|
def users_for_service(self) -> Iterable[ServiceUserInfo[ItemT]]:
|
|
99
|
-
result =
|
|
100
|
-
(
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
99
|
+
result = list(
|
|
100
|
+
JsonDict(
|
|
101
|
+
(
|
|
102
|
+
self.http.with_header("Authorization", f"Bearer {self.token}")
|
|
103
|
+
.get()
|
|
104
|
+
.on_endpoint(f"/services/{self.service_name}/users")
|
|
105
|
+
.on_failure(raises=RuntimeError)
|
|
106
|
+
.json()
|
|
107
|
+
)
|
|
108
|
+
)["data"]["users"]
|
|
109
|
+
)
|
|
108
110
|
|
|
109
|
-
for raw_user in result
|
|
111
|
+
for raw_user in result:
|
|
110
112
|
user = dict(raw_user["user"])
|
|
111
113
|
user["hashed_password"] = "unknown"
|
|
112
114
|
|
|
113
115
|
yield ServiceUserInfo[ItemT](
|
|
114
116
|
user=self.user_formatter.load(user),
|
|
115
|
-
|
|
117
|
+
is_service_admin=bool(raw_user["is_service_admin"]),
|
|
116
118
|
metadata=self.formatter.load(raw_user["metadata"]),
|
|
117
119
|
)
|
|
118
120
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|