Skip to content

Commit 632cb1f

Browse files
fregataaclaude
andcommitted
fix(BA-5795): set main_access_key in component test user fixtures
The admin/regular user fixtures were missing `main_access_key`, causing `ensure_host_permission_allowed_by_user` to fail with ObjectNotFound when resolving the user's keypair resource policy. Also fix module docstring in vfolder_v2.py to not overstate RBAC coverage. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0c686f4 commit 632cb1f

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

src/ai/backend/manager/services/vfolder/actions/vfolder_v2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""V2 vfolder actions — RBAC-enforced via SingleEntityActionProcessor."""
1+
"""V2 vfolder action definitions."""
22

33
import uuid
44
from dataclasses import dataclass

tests/component/conftest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,11 @@ async def admin_user_fixture(
770770
user=str(data.user_uuid),
771771
)
772772
)
773+
await conn.execute(
774+
users.update()
775+
.where(users.c.uuid == str(data.user_uuid))
776+
.values(main_access_key=data.keypair.access_key)
777+
)
773778
await conn.execute(
774779
sa.insert(association_groups_users).values(
775780
group_id=str(group_fixture),
@@ -791,6 +796,9 @@ async def admin_user_fixture(
791796
association_groups_users.c.user_id == str(data.user_uuid)
792797
)
793798
)
799+
await conn.execute(
800+
users.update().where(users.c.uuid == str(data.user_uuid)).values(main_access_key=None)
801+
)
794802
await conn.execute(
795803
keypairs.delete().where(keypairs.c.access_key == data.keypair.access_key)
796804
)
@@ -850,6 +858,11 @@ async def regular_user_fixture(
850858
user=str(data.user_uuid),
851859
)
852860
)
861+
await conn.execute(
862+
users.update()
863+
.where(users.c.uuid == str(data.user_uuid))
864+
.values(main_access_key=data.keypair.access_key)
865+
)
853866
await conn.execute(
854867
sa.insert(association_groups_users).values(
855868
group_id=str(group_fixture),
@@ -868,6 +881,9 @@ async def regular_user_fixture(
868881
association_groups_users.c.user_id == str(data.user_uuid)
869882
)
870883
)
884+
await conn.execute(
885+
users.update().where(users.c.uuid == str(data.user_uuid)).values(main_access_key=None)
886+
)
871887
await conn.execute(
872888
keypairs.delete().where(keypairs.c.access_key == data.keypair.access_key)
873889
)

0 commit comments

Comments
 (0)