Bug 52787 - Do not list exam users when searching with the Kelvin API
Do not list exam users when searching with the Kelvin API
Status: CLOSED FIXED
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
UCS@school 4.4
Other Linux
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Tobias Wenzel
:
Depends on:
Blocks: 52784
  Show dependency treegraph
 
Reported: 2021-02-12 13:31 CET by Daniel Tröder
Modified: 2021-02-23 09:29 CET (History)
1 user (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
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 Daniel Tröder univentionstaff 2021-02-12 13:31:03 CET
When listing/searching UCS@school users using the Kelvin API, exam users are also listed.
This should not be the case, as they are temporary objects exclusively for the exam mode that should not be meddled with. They may also confuse API users.
But being real UCS@school user objects, API users should be able to retrieve them, when they so desire explictely.

* resource list operation -> no exam users included
* resource get  operation -> exam user can be requested
Comment 1 Daniel Tröder univentionstaff 2021-02-12 13:33:43 CET
When no role is provided, exam users are not included anymore.
They can still be retrieved explictely.
Tests for both features are included:

[feature/kelvin] ae192b145 Bug #52787: exam users are not included in searches anymore, but can be retrieved explicitely
Comment 2 Tobias Wenzel univentionstaff 2021-02-15 16:13:12 CET
QA → All OK, already in feature/kelvin → VERIFY

* resource list operation → no exam users included
* resource get  operation → exam user can be requested

→ sounds good to me.

Code → looks good.


curl -X GET "http://$host/ucsschool/kelvin/v1/users/?school=DEMOSCHOOL"  -H "accept: application/json" -H "Authorization: Bearer $token"

→ no exam users included

curl -X GET "http://10.200.47.12/ucsschool/kelvin/v1/users/exam-demo_student" -H  "accept: application/json" -H  "Authorization: Bearer $token"

→ returns exam user with name exam-demo_student

Tests → passing, including new tests:

tests/test_route_user.py::test_search_returns_no_exam_user PASSED 
tests/test_route_user.py::test_get_returns_exam_user PASSED
Comment 3 Daniel Tröder univentionstaff 2021-02-23 09:29:59 CET
A Kelvin API app with the changes in this bug has been published.