Bug 54126 - Add expiration date field to User in Kelvin API
Add expiration date field to User in Kelvin API
Status: VERIFIED FIXED
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
UCS@school 5.0
Other Mac OS X 10.1
: P5 normal (vote)
: ---
Assigned To: Daniel Tröder
Johannes Keiser
:
Depends on: 54116
Blocks: 54127
  Show dependency treegraph
 
Reported: 2021-11-24 11:36 CET by Daniel Tröder
Modified: 2021-11-29 15:17 CET (History)
1 user (show)

See Also:
What kind of report is it?: Feature Request
What type of bug is this?: ---
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-11-24 11:36:25 CET
+++ This bug was initially created as a clone of Bug #54116 +++
+++ This bug was initially created as a clone of Bug #54115 +++

Add a field "expiration_date" to the user resource in the Kelvin REST API.
It should be handled by the code in the ucsschool.lib, ported from 5.0.
Comment 1 Daniel Tröder univentionstaff 2021-11-26 11:26:06 CET
As a workaround for Bug 54152 we are implemented:

value = int(time.mktime(time.strptime("2021-11-25", "%Y-%m-%d")) // 3600 // 24 + 1)
# -> value == 18956

And then using as filter "shadowExpire=18956" instead of "shadowExpire=2021-11-25".
Comment 2 Daniel Tröder univentionstaff 2021-11-26 13:46:57 CET
As a workaround for Bug 54159 we are implementing that searches in the Kelvin user resource with "disabled=true/false" are converted to UDM REST API searches with "disabled=1/0".
Comment 3 Daniel Tröder univentionstaff 2021-11-26 17:44:19 CET
Support for the expiration_date field was added to the ucsschool.lib and Kelvin.

[feature/kelvin] de7969b1c Bug #54126: add expiration_date field to ucsschool.lib User model
[feature/kelvin] 729ec6f1d Bug #54126: improve tests
[feature/kelvin] 1944e8b80 Bug #54126: add expiration_date field to user resource
[feature/kelvin] 178ffb8e2 Bug #54126: improve logging

A new Docker image (1.5.1) has been build.
Comment 4 Daniel Tröder univentionstaff 2021-11-29 13:35:16 CET
The test tests/test_route_user.py::test_create was flaky, because it seems that after setting the UDM property "disabled" something goes on (s4 ping pong?) before  the LDAP attribute shadowExpire is set correctly.

[feature/kelvin d76f9c0bf] Bug #54126: fix test: wait for udm/disabled -> ldap/shadowExpire

A new Docker image (1.5.1) has been build.
Comment 5 Johannes Keiser univentionstaff 2021-11-29 15:17:07 CET
OK: installation/upgrade of/to 1.5.1
OK: jenkins 5.0 (https://jenkins.knut.univention.de:8181/job/UCSschool-5.0/job/kelvin%20API/)
~OK: jenkins 4.4 https://jenkins.knut.univention.de:8181/job/UCSschool-4.4/job/HTTP-APIs%20tests/
  94_ucsschool-api-kelvin.10_in_container_tests_kelvin_api.master is flaky in jenkins -- works manually
OK: manual test of user resource (GET/POST/PUT/PATCH)
OK: code review
OK: changelogs
OK: version number
OK: all manual tests for 4.4 and 5.0
-> verified