Skip to content

Commit 071e45d

Browse files
Merge pull request #1968 from kili-technology/lab-3898-others
chore(LAB-3898): remove deprecated user fields
2 parents 2a97709 + ad1fc18 commit 071e45d

File tree

5 files changed

+1
-16
lines changed

5 files changed

+1
-16
lines changed

src/kili/adapters/kili_api_gateway/user/mappers.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ def user_where_mapper(filters: UserFilter) -> Dict:
1111
"""Build the GraphQL UserWhere variable to be sent in an operation."""
1212
return {
1313
"activated": filters.activated,
14-
"apiKey": filters.api_key,
1514
"email": filters.email,
1615
"id": filters.id,
1716
"idIn": filters.id_in,

src/kili/adapters/kili_api_gateway/user/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def get_current_user_query(fragment: str) -> str:
1616
"""Return the GraphQL current user query."""
1717
return f"""
1818
query me {{
19-
data: me {{
19+
data: viewer {{
2020
{fragment}
2121
}}
2222
}}

src/kili/domain/user.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ class UserFilter:
1717

1818
id: Optional[UserId]
1919
activated: Optional[bool] = None
20-
api_key: Optional[str] = None
2120
email: Optional[str] = None
2221
id_in: Optional[List[UserId]] = None
2322
organization_id: Optional["OrganizationId"] = None

src/kili/presentation/client/user.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ class UserClientMethods(BaseClientMethods):
2525
@overload
2626
def users(
2727
self,
28-
api_key: Optional[str] = None,
2928
email: Optional[str] = None,
3029
organization_id: Optional[str] = None,
3130
fields: ListOrTuple[str] = ("email", "id", "firstname", "lastname"),
@@ -40,7 +39,6 @@ def users(
4039
@overload
4140
def users(
4241
self,
43-
api_key: Optional[str] = None,
4442
email: Optional[str] = None,
4543
organization_id: Optional[str] = None,
4644
fields: ListOrTuple[str] = ("email", "id", "firstname", "lastname"),
@@ -55,7 +53,6 @@ def users(
5553
@typechecked
5654
def users(
5755
self,
58-
api_key: Optional[str] = None,
5956
email: Optional[str] = None,
6057
organization_id: Optional[str] = None,
6158
fields: ListOrTuple[str] = ("email", "id", "firstname", "lastname"),
@@ -69,7 +66,6 @@ def users(
6966
"""Get a generator or a list of users given a set of criteria.
7067
7168
Args:
72-
api_key: Query an user by its API Key
7369
email: Email of the user
7470
organization_id: Identifier of the user's organization
7571
fields: All the fields to request among the possible fields for the users.
@@ -94,7 +90,6 @@ def users(
9490

9591
users_gen = UserUseCases(self.kili_api_gateway).list_users(
9692
filters=UserFilter(
97-
api_key=api_key,
9893
email=email,
9994
organization_id=OrganizationId(organization_id) if organization_id else None,
10095
activated=None,
@@ -113,22 +108,19 @@ def users(
113108
def count_users(
114109
self,
115110
organization_id: Optional[str] = None,
116-
api_key: Optional[str] = None,
117111
email: Optional[str] = None,
118112
) -> int:
119113
"""Get user count based on a set of constraints.
120114
121115
Args:
122116
organization_id: Identifier of the user's organization.
123-
api_key: Filter by API Key.
124117
email: Filter by email.
125118
126119
Returns:
127120
The number of organizations with the parameters provided.
128121
"""
129122
return UserUseCases(self.kili_api_gateway).count_users(
130123
UserFilter(
131-
api_key=api_key,
132124
email=email,
133125
organization_id=OrganizationId(organization_id) if organization_id else None,
134126
activated=None,
@@ -191,7 +183,6 @@ def update_password(
191183
user_filter=UserFilter(
192184
email=email,
193185
activated=None,
194-
api_key=None,
195186
id=None,
196187
id_in=None,
197188
organization_id=None,
@@ -227,7 +218,6 @@ def update_properties_in_user(
227218
user_filter=UserFilter(
228219
email=email,
229220
activated=None,
230-
api_key=None,
231221
id=None,
232222
id_in=None,
233223
organization_id=None,

tests/integration/adapters/kili_api_gateway/test_user.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ def test_given_kili_gateway_when_querying_users_list_it_calls_proper_resolver(
4343
{
4444
"where": {
4545
"activated": None,
46-
"apiKey": None,
4746
"email": None,
4847
"id": "fake_user_id",
4948
"idIn": None,
@@ -72,7 +71,6 @@ def test_given_kili_gateway_when_querying_count_users_it_calls_proper_resolver(
7271
{
7372
"where": {
7473
"activated": None,
75-
"apiKey": None,
7674
"email": None,
7775
"id": "fake_user_id",
7876
"idIn": None,
@@ -163,7 +161,6 @@ def test_given_kili_gateway_when_updating_user_it_calls_proper_resolver(
163161
},
164162
"where": {
165163
"activated": None,
166-
"apiKey": None,
167164
"email": None,
168165
"id": "fake_user_id",
169166
"idIn": None,

0 commit comments

Comments
 (0)