Bug 50933 - Kelvin user create return 404 despite successful creation
Kelvin user create return 404 despite successful creation
Status: NEW
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: UCS@school maintainers
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-03-11 13:40 CET by Valentin Heidelberger
Modified: 2020-03-24 11:58 CET (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 2: A Pain – users won’t like this once they notice it
User Pain: 0.057
Enterprise Customer affected?:
School Customer affected?: Yes
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Valentin Heidelberger univentionstaff 2020-03-11 13:40:34 CET
According to the docs, the Kelvin API should return "201 Created" when a user was created successfully. Instead it returns a "404 Not found" in spite of the user being created successfully.

root@master:~# univention-ldapsearch uid=bob1
root@master:~# cat create.json
{
    "name": "bob1",
    "school": "https://master.ucs.demo/ucsschool/kelvin/v1/schools/DEMOSCHOOL",
    "firstname": "Bob",
    "lastname": "Marleyyy",
    "birthday": "1945-02-06",
    "disabled": true,
    "email": null,
    "record_uid": "bob25",
    "roles": ["https://master.ucs.demo/ucsschool/kelvin/v1/roles/teacher"],
    "schools": ["https://master.ucs.demo/ucsschool/kelvin/v1/schools/DEMOSCHOOL"],
    "source_uid": "Reggae DB",
    "password": "univention",
    "udm_properties": {
        "title": "Mr."
    }
}

root@master:~# curl -i -k -X POST "https://master.ucs.demo/ucsschool/kelvin/v1/users/" \
>     -H "accept: application/json" \
>     -H "Content-Type: application/json" \
>     -H "Authorization: Bearer eyJ0eXAiOiJKV1QiL..." \
>     -d "$(<create.json)"

HTTP/1.1 404 Not Found
Date: Wed, 11 Mar 2020 12:26:34 GMT
Server: uvicorn
content-length: 112
content-type: application/json
Via: 1.1 master.ucs.demo

{"message":"No python class: 'uid=bob1,cn=lehrer,cn=users,ou=DEMOSCHOOL,dc=ucs,dc=demo' is not a ImportTeacher"}

root@master:~# univention-ldapsearch uid=bob1
dn: uid=bob1,cn=lehrer,cn=users,ou=DEMOSCHOOL,dc=ucs,dc=demo
uid: bob1
...