uyuni-project / uyuni-tools

Tools to work with containerized Uyuni server
Apache License 2.0
14 stars 18 forks source link

Add support for login and logout api options #410

Closed aaannz closed 1 week ago

aaannz commented 2 months ago

What does this PR change?

Add support for login and logout api options.

Login will store session cookie together with server to the ~/.config/.uyuni-api file. Next api calls will try to load session from this file and use it.

If session is detected to be expired (by issuing get user/listAssignableRoles), if mgrctl api is run in terminal it asks for user and password. If not, call is aborted.

Logout command removes the file with stored session and also calls auth/logout.

Test coverage

Links

Issue(s): https://github.com/uyuni-project/uyuni-tools/issues/239 Port: https://github.com/SUSE/uyuni-tools/pull/14

Changelogs

Make sure the changelogs entries you are adding are compliant with https://github.com/uyuni-project/uyuni/wiki/Contributing#changelogs and https://github.com/uyuni-project/uyuni/wiki/Contributing#uyuni-projectuyuni-repository

If you don't need a changelog check, please mark this checkbox:

If you uncheck the checkbox after the PR is created, you will need to re-run changelog_test (see below)

Before you merge

Check How to branch and merge properly!