Repository navigation
fix: Gate trustee and tenant-id user attributes (ovcs) - #4244
BelSequent wants to merge 3 commits into
Conversation
create-user, edit-user and user imports now need trustee-write to give a user's `trustee` attribute a new value, including through encrypted attributes. An edit that sends back the current value needs only the usual permissions and leaves `trustee` out of the update. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@coderabbitai review |
Action performed
|
Parent issue: https://github.com/sequentech/meta/issues/13924
Port of the release/10.0 fix (#3606).
create-userneedstrustee-writewhen the request gives the new user atrustee, andedit-userwhen it gives an existing user atrusteeother than the current one, compared in any order. An edit that sends back the current value needs only the usual permissions and leavestrusteeout of the update, so it can't undo a change made after the check. Atrusteeamong the encrypted voter attributes always needstrustee-write. The attribute name is a new sharedTRUSTEE_ATTR_NAMEin sequent-core, and the sequent-core WASM package is regenerated.On ovcs the create and edit permissions live in
services/access.rs(create_user_permissions,edit_user_access, plustrustee_edit_permissionfor the edit's comparison with the stored user), andedit-userreads the user through the identity port. ovcs already refuses any clienttenant-idoncreate-user(reject_tenant_id_attribute), so that half of the 10.0 fix is not ported. ovcs user imports check restricted columns against the importer's permissions, so a non-emptytrusteecell now also needstrustee-write(TrusteePolicyinImportUsersPrivileges), for user imports and for the voters file of an election event import; release/10.0 has no such import check. The users and roles permissions page documents the rules.Validation: new tests in
tests/support/access_policy.rs(create with a trustee, plain and encrypted, changed and unchanged trustees in any order, edits without one, import privileges),route_permissions.rscases for both routes, route tests inaccount_audit_routes.rsagainst a scripted Keycloak (an unchanged trustee passes withuser-writeand a later Keycloak value is kept; a new one is refused withouttrustee-writeand written with it; a failed read is refused),trustee_cells_require_allowed_policyin windmill'simport_users.rs, and the updated import privilege tables inuser_task_orchestration.rsandinsert_election_event.rs. The port was not built or run outside CI (the fix was tested on release/10.0) and relies on this PR's CI.python3 -m scripts.dev.wasm --check-packagepasses for the regenerated package.🤖 Generated with Claude Code
Summary by CodeRabbit