Repository navigation
Conversation
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Infrastructure as Code | View in Orca | ||
| SAST | View in Orca | ||
| Secrets | View in Orca | ||
| Vulnerabilities | View in Orca |
|
To avoid any confusion in the future about your contribution to Weaviate, we work with a Contributor License Agreement. If you agree, you can simply add a comment to this PR that you agree with the CLA so that we can merge. |
|
I agree to the Contributor License Agreement. |
| @@ -0,0 +1,91 @@ | |||
| from typing import Any, Dict, List, Union | |||
There was a problem hiding this comment.
these mock tests can be replaced with a simple extension of an integration test:
integration/test_rbac.py::test_get_assigned_users_db already creates a db user and a role and assigns it. OIDC is enabled on the RBAC container, so the test can extend straight from there:
+ client.users.db.delete(user_id=names)
client.users.db.create(user_id=names)
...
assert assigned_users[0].user_type == UserTypes.DB_DYNAMIC
+ # an OIDC user with the same id keeps the role when the db user's is revoked
+ client.users.oidc.assign_roles(user_id=names, role_names=names)
+ client.users.db.revoke_roles(user_id=names, role_names=names)
+ assigned_users = client.roles.get_user_assignments(names)
+ assert len(assigned_users) == 1
+ assert assigned_users[0].user_type == UserTypes.OIDC
There was a problem hiding this comment.
Done: removed the mock test and extended test_get_assigned_users_db with the OIDC assignment and db revoke sequence you suggested. CI is the first live run.
|
Done. Dropped the mock file and extended
On |
The typed
users.db.revoke_roles()andusers.oidc.revoke_roles()APIs construct auserTypediscriminator, but_revoke_roles_from_userposts a new roles-only dictionary. Send the already constructed payload, matching the assignment path.The regression uses real synchronous/asynchronous clients and
pytest_httpserverto inspect request JSON. It covers DB/OIDC users, role strings/lists, and the deprecated untyped entry points.Validation on Python 3.12.8:
7266681a: 8 failures / 4 passing compatibility controls; fixed: 12 passed. Independently repeated..venv/bin/python -m pytest -q test mock_tests --tb=short: 647 passed, 1 skipped (the existing unimplemented collection-model test).Dependencies follow the existing development/test requirements; no dependency or configuration changes. The full suite required the repository's original PNG fixture, included before the passing run. Live Weaviate and other Python/platform versions were not run; these regressions verify the client's actual HTTP payload.