-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for using the persistent-auth #42
Conversation
Ivan, we definitely need to cover this with integration tests. See to README how to set things up and you can use this bats suite to install ovirt all-in-one setup. If you use the bats suite, please give the PR 👍 as nobody is willing to test it for some reason :-) Codewise this WFM |
@@ -144,7 +138,12 @@ def http_delete(suburl) | |||
def auth_header | |||
# This is the method for strict_encode64: | |||
encoded_credentials = ["#{@credentials[:username]}:#{@credentials[:password]}"].pack("m0").gsub(/\n/,'') | |||
{ :authorization => "Basic " + encoded_credentials } | |||
headers = { :authorization => "Basic " + encoded_credentials } | |||
if persistent_auth |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to add some ovirt version tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it will just get ignored by older versions and the basic auth will continue to work: it will just not return the jsessionid at the end, so the basic auth will continue to be used for those cases.
Remove details from vms api call headers to avoid timeout
It is better if you avoid using explicitly the Also, when implementing this kind of persistent authentication, it is very important to provide a mechanism that can be used to dispose the server side session, otherwise sessions will potentially accumulate in the server and eventually exhaust its resources. Other oVirt API bindings include a
(Note that there is no Using the |
I just tried this PR and added an initial testcase for it in 29e4501. |
@iNecas ping ^^ can you incorporate and rebase? Interesting patch, nice one. |
Keep in mind that if we want this to fix Foreman, we need to backport this into 0.0.3x series as the 0.1 version is not compatible with Fog/Foreman. |
It is worth adding a test. |
With persisted_auth set to true, we can by-pass the full ovirt authentication, which can rapidly speed-up the response times (at least when running against some external authentication). In my setup, it is 4x faster with this feature turned on. For more details see http://www.ovirt.org/Features/RESTSessionManagement.
…m when testing There was also a problem with waiting for a vm to stop before starting.
Tests added (thanks @epienbroek). I've also added another commit to fix the #100 |
This is great work Ivan, I am gonna to test this now. |
Tests passed, except these two, but you fixed bunch of others so this is PASS :-)
Merging as well into |
Merged as cf4e205, thank you! |
With persisted_auth set to true, we can by-pass the full ovirt authentication,
which can rapidly speed-up the response times
(at least when running against some external authentication).
In my setup, it is 4x faster with this feature turned on. For more details see
http://www.ovirt.org/Features/RESTSessionManagement.