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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: apexauthlib
3
- Version: 0.1.7
3
+ Version: 0.1.9
4
4
  Summary: Apex authorization library for services
5
5
  Author: Apex Dev
6
6
  Author-email: dev@apex.ge
@@ -22,7 +22,7 @@ class User:
22
22
  @dataclass(frozen=True)
23
23
  class Service:
24
24
  service: str
25
- superuser: str
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
- is_superuser: bool
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
- is_superuser=bool(result["is_superuser"]),
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 = 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"]
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["users"]:
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
- is_superuser=bool(raw_user["is_superuser"]),
117
+ is_service_admin=bool(raw_user["is_service_admin"]),
116
118
  metadata=self.formatter.load(raw_user["metadata"]),
117
119
  )
118
120
 
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "apexauthlib"
3
- version = "0.1.7"
3
+ version = "0.1.9"
4
4
  description = "Apex authorization library for services"
5
5
  authors = [{ name = "Apex Dev", email = "dev@apex.ge" }]
6
6
  readme = "README.md"
File without changes
File without changes