Bug 51066 - Modify update_openapi_client script to work with auth required OpenAPI schema endpoint
Modify update_openapi_client script to work with auth required OpenAPI schema...
Status: CLOSED FIXED
Product: Components
Classification: Unclassified
Component: udm-rest-api-client
unspecified
Other Linux
: P5 normal (vote)
: ---
Assigned To: Ole Schwiegert
Tobias Wenzel
:
Depends on:
Blocks: 51072
  Show dependency treegraph
 
Reported: 2020-04-06 10:56 CEST by Ole Schwiegert
Modified: 2020-04-15 15:12 CEST (History)
2 users (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 Ole Schwiegert univentionstaff 2020-04-06 10:56:10 CEST
With Bug #50732 the openapi.json is now potentially restricted to authenticated users.

We have to extend the update_openapi_client script to accept credentials for fetching the schema file.
Comment 1 Ole Schwiegert univentionstaff 2020-04-06 11:56:53 CEST
The script now accepts 2 new options --username and --password which are used for BasicAuth in the request if both are present.

This leads to the following behavior:
json is protected and no credentials given: 401 error message
json is protected and wrong credentials given: 401 error message
json is protected and correct credentials given: 200, script runs
json is not protected and no credentials given: 200, script runs
json is not protected and wrong credentials given: 401 error message
json is not protected and correct credentials given: 200, script runs

Version 0.4.0 is released at https://test.pypi.org/project/udm-rest-client/

Please check and REOPEN for release on productive index.
Comment 2 Ole Schwiegert univentionstaff 2020-04-06 12:07:58 CEST
On a system where the UDM API is not updated yet (Before Bug #50732) I observed the same behavior as in json is not protected and *
Comment 3 Tobias Wenzel univentionstaff 2020-04-06 15:49:28 CEST
QA

Please update version according to changes in history (0.4.0 (2020-03-19) -> 0.4.0 (2020-04-06)) on https://test.pypi.org/project/udm-rest-client/ 

- code-review -> code looks @ok
- travis check (build) @ok
- doc was build on rtd (changelog) @ok
- ob das neue paket zu test-pypi @ok und 
- documentation in readme @ok


json is protected and no credentials given: 401 error message @ok
json is protected and wrong credentials given: 401 error message @ok
json is protected and correct credentials given: 200, script runs @ok
json is not protected and no credentials given: 200, script runs @ok
json is not protected and wrong credentials given: 401 error message @ok
json is not protected and correct credentials given: 200, script runs @ok

On a system where the UDM API is not updated yet (Before Bug #50732) I observed the same behavior as in json is not protected and * @ok (4.4.3 errata-427)
Comment 4 Ole Schwiegert univentionstaff 2020-04-07 07:25:35 CEST
Version 0.4.0 published on PyPi: https://pypi.org/project/udm-rest-client/0.4.0/
Comment 5 Tobias Wenzel univentionstaff 2020-04-07 08:38:39 CEST
QA
Version 0.4.0 published on PyPi @ok
Comment 6 Erik Damrose univentionstaff 2020-04-15 15:12:10 CEST
Released with App Update - UCS@school Kelvin REST API 1.1.0