DMTF / Redfish-Mockup-Server

A simple Python 3.4 program that can be copied into a folder at the top of any Redfish mockup and can serve Redfish requests on the specified IP/port.
Other
83 stars 37 forks source link

Fixed bug where server would get stuck in infinite loop when adding a member. #100

Closed omnistat closed 10 months ago

omnistat commented 10 months ago

Fix for #98. This should prevent an infinite loop in the event of adding a member when:

I encountered this immediately upon spinning up the mockup server to use a redfish query tool which naturally requested a session. I understand that Redfish-Mockup-Server is meant to be a demo limited in functionality and scope, however I’m hoping these fixes just add a bit more reliability for those that don’t want to spend time debugging or changing their mockup server schema.

mraineri commented 10 months ago

Great addition!

One thing I think that would also be very handy while you're adding this... Would you be willing to also add the X-Auth-Token header to the response with a random value if the user is performing a POST to the SessionCollection? I think that would greatly help other tools that use session login by default and expect a session token. It shouldn't need to be tracked by the mockup server; it could be generated, returned, and tossed.

mraineri commented 10 months ago

Actually, the token value doesn't even need to be random... it could be static since the mockup server has no enforcement of the token usage...

omnistat commented 10 months ago

This latest commit should do it. An X-Auth-Token of 1234567890ABCDEF will be returned in the header if sending a POST to SessionService/Sessions. I don't think the X-Auth-Token needs to have a specific format as far as I am aware.

mraineri commented 10 months ago

Looks good to me! I'll show this to others and we'll get a new version of the tool published.

mraineri commented 10 months ago

Merging; thanks for adding this!