mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-11-22 06:52:13 +08:00
PUT /api/users/{user_id} let a non-admin change their email and display
name while enable_account_interface is false, which the legacy
information/inputs endpoint refuses. Both fields now go through the same
gate, and every UserUpdatePayload field has to be listed as either gated
or exempt, so a new field cannot skip it unnoticed.
Under use_remote_user or disable_local_accounts the email is what the
proxy or identity provider resolves the account by, so
UserManager.update_email no longer lets a non-admin choose it. OIDC
profile sync writes the address the identity provider asserts and marks
the call with asserted_by_identity_provider to bypass the check.
11 lines
438 B
Python
11 lines
438 B
Python
from galaxy.schema.schema import UserUpdatePayload
|
|
from galaxy.webapps.galaxy.api.users import (
|
|
ACCOUNT_IDENTITY_FIELDS,
|
|
ACCOUNT_INTERFACE_EXEMPT_FIELDS,
|
|
)
|
|
|
|
|
|
def test_every_update_payload_field_is_classified_for_the_account_interface_gate():
|
|
assert ACCOUNT_IDENTITY_FIELDS.isdisjoint(ACCOUNT_INTERFACE_EXEMPT_FIELDS)
|
|
assert set(UserUpdatePayload.model_fields) == ACCOUNT_IDENTITY_FIELDS | ACCOUNT_INTERFACE_EXEMPT_FIELDS
|