Skip to content

Commit 0952a1b

Browse files
authored
[Auth] Fix IG4 group type (mlrun#9242)
### 📝 Description IG4 Authentication client was using the wrong Group gRPC schema type to extract the user's group from the authentication endpoint response (`GET /self`). As can be seen here, the correct type is `usergroup.Group` and not `group.Group`, as `group` is a reserved gRPC word: ```json { "metadata": { "id": "4ea81f45-37b2-49ed-b776-7aa3ae7af44b", "resourceType": "user", "username": "normal-user" }, "relationships": [ { "@type": "type.googleapis.com/usergroup.Group", "metadata": { "id": "f464c016-65ae-431b-8d3a-b563c59a187b", "path": "/test-group" }, "spec": { "name": "test-group" } } ], "spec": { "email": "normal-user@iguazio.com", "firstName": "normal-user", "lastName": "normal-user" }, "status": { "active": true, "createdAt": "2026-01-21T09:44:58.668Z", "ctx": "a2e839df739960d54e13f4f7fe2127cb", "groupIds": [ "f464c016-65ae-431b-8d3a-b563c59a187b" ], "lastActivity": "2026-01-25T14:40:13Z", "lastLogin": "2026-01-25T14:25:29Z", "statusCode": 200 } } ``` --- ### 🛠️ Changes Made - `server/py/framework/utils/clients/iguazio/v4.py` : changed the `_GROUP_TYPE_VALUE` constant to the correct type. --- ### ✅ Checklist - [ ] I updated the documentation (if applicable) - [x] I have tested the changes in this PR - [ ] I confirmed whether my changes are covered by system tests - [ ] If yes, I ran all relevant system tests and ensured they passed before submitting this PR - [ ] I updated existing system tests and/or added new ones if needed to cover my changes - [ ] If I introduced a deprecation: - [ ] I followed the [Deprecation Guidelines](./DEPRECATION.md) - [ ] I updated the relevant Jira ticket for documentation --- ### 🧪 Testing Using the `iguazio` client: 1. Created a user and a group 2. Assigned user to group 3. Created project 4. Assigned group as project Admin 5. Performed operations as the user - Success :white_check_mark: --- ### 🔗 References - Ticket link: https://iguazio.atlassian.net/browse/IG4-1184 - Orca schema definition: https://github.com/iguazio/orca/blob/9f5818389844549e4b878cd885f8f5f992ae87e2/backend/proto/v1/resources/usergroup.proto#L10 --- ### 🚨 Breaking Changes? - [ ] Yes (explain below) - [x] No <!-- If yes, describe what needs to be changed downstream: --> --- ### 🔍️ Additional Notes <!-- Anything else reviewers should know (follow-up tasks, known issues, affected areas etc.). --> <!-- ### 📸 Screenshots / Logs -->
1 parent 5c82d97 commit 0952a1b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

server/py/framework/utils/clients/iguazio/v4.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
from framework.utils.clients.iguazio.base import BaseAsyncClient, BaseClient
3636

3737
_GROUP_TYPE_KEY = "@type"
38-
_GROUP_TYPE_VALUE = "type.googleapis.com/group.Group"
38+
_GROUP_TYPE_VALUE = "type.googleapis.com/usergroup.Group"
3939

4040

4141
class Client(BaseClient, project_follower.Member):

server/py/services/api/tests/unit/utils/clients/iguazio/test_iguazio_v4.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ def _verify_session_with_body_mock(*args, **kwargs):
143143
"metadata": {},
144144
"relationships": [
145145
{
146-
"@type": "type.googleapis.com/group.Group",
146+
"@type": "type.googleapis.com/usergroup.Group",
147147
"metadata": {
148148
"id": "dummy-group-id-g1",
149149
},
@@ -155,7 +155,7 @@ def _verify_session_with_body_mock(*args, **kwargs):
155155
"metadata": {"username": "dummy-user"},
156156
"relationships": [
157157
{
158-
"@type": "type.googleapis.com/group.Group",
158+
"@type": "type.googleapis.com/usergroup.Group",
159159
"metadata": {"id": "dummy-group-id-g1"},
160160
},
161161
],
@@ -165,7 +165,7 @@ def _verify_session_with_body_mock(*args, **kwargs):
165165
"metadata": "not-a-dict",
166166
"relationships": [
167167
{
168-
"@type": "type.googleapis.com/group.Group",
168+
"@type": "type.googleapis.com/usergroup.Group",
169169
"metadata": {
170170
"id": "dummy-group-id-g1",
171171
},
@@ -307,7 +307,7 @@ async def test_verify_request_session_single_group_untyped(
307307
"metadata": {"username": "dummy-user", "id": "dummy-id"},
308308
"relationships": [
309309
{
310-
"@type": "type.googleapis.com/group.Group",
310+
"@type": "type.googleapis.com/usergroup.Group",
311311
"metadata": {"id": "valid-group-id"},
312312
},
313313
{
@@ -343,7 +343,7 @@ def sample_user_info(username="dummy-user", user_id="dummy-user-id", group_ids=N
343343
"metadata": {"resourceType": "user", "username": username, "id": user_id},
344344
"relationships": [
345345
{
346-
"@type": "type.googleapis.com/group.Group",
346+
"@type": "type.googleapis.com/usergroup.Group",
347347
"metadata": {"id": gid},
348348
}
349349
for gid in group_ids
@@ -727,11 +727,11 @@ def _generate_igv4_httpx_exception(
727727
},
728728
"relationships": [
729729
{
730-
"@type": "type.googleapis.com/group.Group",
730+
"@type": "type.googleapis.com/usergroup.Group",
731731
"metadata": {"id": "group1"},
732732
},
733733
{
734-
"@type": "type.googleapis.com/group.Group",
734+
"@type": "type.googleapis.com/usergroup.Group",
735735
"metadata": {"id": "group2"},
736736
},
737737
],

0 commit comments

Comments
 (0)