DMTF/python-redfish-library

Suggestion to login again with the same credential

TheoMornicoQarnot opened this issue · 2 comments

Hello,
(First, thanks for your job)

I use this library in a service to communicate with a Redfish server, I use session for faster-processing when I have multiple commands.

But in my case, sometime I need to login again because the Redfish server close my session (no command since a long-time).

I use an extern timeout (to detect when the Redfish server close my session), but with this library implementation I need to give my credential each time. (An automatic reconnection would be a great feature for me, but I am not sure it's in this project scope)

I suppose you set username and password to null after successfully login because each time you login it's supposed there is some change in credentials ?

Anyway, I found strange you can set your credentials in constructor, use login a first time without credentials, but you need to set them again if you want login again...

Proposition

Don't set username and password to null after successful login.

I'd have to ask around about this... I find it odd too, but I wonder if the thought was along the lines of "if I'm done with the credentials, I should discard them so they're not in memory anymore".

Yes that's my guess too, but in this case I don't think it should be possible to set theses values in the constructor.
At the moment, we find ourselves in a rather odd in-between situation. It can be set in memory during the initializer, then it's discard.