Skip to content

API: External ID for User entity cannot be set via API #2186

@baierjan

Description

@baierjan

Description of the problem

When using data_source=1 (i.e. configuration data external), User entity cannot be create via API endpoint /api/v4/users due to missing externalid attribute

Your environment

DOMjudge 8.2.1

Steps to reproduce

  • set data_source to 1 (configuration data external)
  • make API call
    curl -XPOST https://domserver/api/v4/users -Fusername=demo -Fname=demo -Fpassword= -F"roles[]=team"

Expected behaviour

External id can be set via API call or is automatically created. Like in the Teams entity, id attribute should be included in the API call:
curl -XPOST https://domserver/api/v4/users -Fid=demo -Fusername=demo -Fname=demo -Fpassword= -F"roles[]=team" and that should set the external id if using configuration data external mode.

{"last_login_time":null,"last_api_login_time":null,"first_login_time":null,"team":null,"team_id":null,"roles":["team"],"type":"team","id":demo,"username":"demo","name":"demo","email":null,"last_ip":null,"ip":null,"enabled":true}

Actual behaviour

API call returns:

{"last_login_time":null,"last_api_login_time":null,"first_login_time":null,"team":null,"team_id":null,"roles":["team"],"type":"team","id":null,"username":"demo","name":"demo","email":null,"last_ip":null,"ip":null,"enabled":true}

No external id for the entity is created and the configuration checker shows an error "User XY does not have an external ID" which needs to be fixed by manually editing all User entities via GUI.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions