Bug 54305 - The hostname for objects in the kelvin api is case sensitiv
Summary: The hostname for objects in the kelvin api is case sensitiv
Status: CLOSED FIXED
Alias: None
Product: UCS@school
Classification: Unclassified
Component: HTTP-API (Kelvin)
Version: UCS@school 5.0
Hardware: Other Linux
: P5 normal
Target Milestone: ---
Assignee: Johannes Königer
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-06 11:15 CET by Jürn Brodersen
Modified: 2023-10-18 14:15 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 4: Minor Usability: Impairs usability in secondary 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.046
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Customer ID:
Max CVSS v3 score:


Attachments
Suggested patch (624 bytes, patch)
2022-01-06 11:15 CET, Jürn Brodersen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jürn Brodersen univentionstaff 2022-01-06 11:15:28 CET
Created attachment 10895 [details]
Suggested patch

The hostname for objects in the kelvin api is case sensitive

The function "unscheme_and_unquote" in "kelvin-api/ucsschool/kelvin/routers/user.py" is used to normalize urls identifying school objects. The function does not normalize the case of the domain name.
This results in exceptions from the "url_to_name" function in "kelvin-api/ucsschool/kelvin/urls.py" if the calculated url and given url differ in case, even if they refer to the same object.

The attached patch normalizes the domainname case.

Some notes:
I think it would be nice if we rename the "unscheme_and_unquote" function to something like "normalize_url". I was expecting that unscheme meant that the scheme will be completely removed, instead it is changed to http.

The "NoObject" exception from "url_to_name" should also include the calculated url ("calc_url"). That would have made debugging, a lot easier.
Comment 3 Johannes Königer univentionstaff 2023-10-18 14:15:18 CEST
The fix has been published with Kelvin version 1.9.0.