[Engine-devel] REST session management

Hey, The following wiki page describes a new feature - supporting session management via the REST API: http://www.ovirt.org/wiki/Features/RESTSessionManagement Please review and comment. Thank you, Oved

Hi Oved, +1 for this feature. [[As a background to the others on the list, this feature is absolutely essential for certain types of ISV integration. Many ISVs need to mirror the RHEV inventory (i.e. all VMs, clusters, basically any object managed by RHEV) in realtime to their own database. The way they do this currently is by polling /api/events and look for changes. In order to be able to react to changes fast, they typically poll every 5 seconds. The query itself is very efficient, so it doesn't cause a whole lot of load on RHEV-M. But it floods the log with login/logout events. This persistent session feature is a solution for that.]] Actually my vote would go for your variation #2: The client passes the "Prefer" header field on every request, besides the last one. When the server gets a request with a JSESSIONID, and without the "Prefer" header, it logs out the session. It's mostly my gut feeling, but i would say it has these advantages: 1. It is more explicit, as on every request you confirm that you still want the authenticated session to be maintained. 2. It is also consistent with the default we have chosen of no persistent authentication. 3. It does not need a second header, so it is somewhat simpler. Regards, Geert On 04/15/2012 01:06 PM, Oved Ourfalli wrote:
Hey,
The following wiki page describes a new feature - supporting session management via the REST API: http://www.ovirt.org/wiki/Features/RESTSessionManagement
Please review and comment.
Thank you, Oved
-- Geert Jansen Sr. Product Marketing Manager, Red Hat Enterprise Virtualization Red Hat S.r.L. O: +39 095 916287 Via G. Fara 26 C: +39 348 1980079 (when in US: 415-623-0542) Milan 20124, Italy E: gjansen@redhat.com

----- Original Message -----
From: "Geert Jansen" <gjansen@redhat.com> To: "Oved Ourfalli" <ovedo@redhat.com> Cc: "engine-devel" <engine-devel@ovirt.org>, "Eoghan Glynn" <eglynn@redhat.com> Sent: Monday, April 16, 2012 10:26:18 AM Subject: Re: [Engine-devel] REST session management
Hi Oved,
+1 for this feature.
[[As a background to the others on the list, this feature is absolutely essential for certain types of ISV integration. Many ISVs need to mirror the RHEV inventory (i.e. all VMs, clusters, basically any object managed by RHEV) in realtime to their own database. The way they do this currently is by polling /api/events and look for changes. In order to be able to react to changes fast, they typically poll every 5 seconds. The query itself is very efficient, so it doesn't cause a whole lot of load on RHEV-M. But it floods the log with login/logout events. This persistent session feature is a solution for that.]]
Thank you for the background. I'll add it to the wiki page.
Actually my vote would go for your variation #2:
The client passes the "Prefer" header field on every request, besides the last one. When the server gets a request with a JSESSIONID, and without the "Prefer" header, it logs out the session.
It's mostly my gut feeling, but i would say it has these advantages:
1. It is more explicit, as on every request you confirm that you still want the authenticated session to be maintained. 2. It is also consistent with the default we have chosen of no persistent authentication. 3. It does not need a second header, so it is somewhat simpler.
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner. The only doubt I have about that is that from reading on the new "Prefer" header, I got the feeling that it is more relevant on session negotiation, and less something you would pass on every request in the session, but I'm not sure about that.
Regards, Geert
On 04/15/2012 01:06 PM, Oved Ourfalli wrote:
Hey,
The following wiki page describes a new feature - supporting session management via the REST API: http://www.ovirt.org/wiki/Features/RESTSessionManagement
Please review and comment.
Thank you, Oved
-- Geert Jansen Sr. Product Marketing Manager, Red Hat Enterprise Virtualization
Red Hat S.r.L. O: +39 095 916287 Via G. Fara 26 C: +39 348 1980079 (when in US: 415-623-0542) Milan 20124, Italy E: gjansen@redhat.com _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Oved Ourfalli" <ovedo@redhat.com> To: "Geert Jansen" <gjansen@redhat.com> Cc: "engine-devel" <engine-devel@ovirt.org>, "Eoghan Glynn" <eglynn@redhat.com> Sent: Monday, April 16, 2012 10:44:31 AM Subject: Re: [Engine-devel] REST session management
----- Original Message -----
From: "Geert Jansen" <gjansen@redhat.com> To: "Oved Ourfalli" <ovedo@redhat.com> Cc: "engine-devel" <engine-devel@ovirt.org>, "Eoghan Glynn" <eglynn@redhat.com> Sent: Monday, April 16, 2012 10:26:18 AM Subject: Re: [Engine-devel] REST session management
Hi Oved,
+1 for this feature.
[[As a background to the others on the list, this feature is absolutely essential for certain types of ISV integration. Many ISVs need to mirror the RHEV inventory (i.e. all VMs, clusters, basically any object managed by RHEV) in realtime to their own database. The way they do this currently is by polling /api/events and look for changes. In order to be able to react to changes fast, they typically poll every 5 seconds. The query itself is very efficient, so it doesn't cause a whole lot of load on RHEV-M. But it floods the log with login/logout events. This persistent session feature is a solution for that.]]
Thank you for the background. I'll add it to the wiki page.
Actually my vote would go for your variation #2:
The client passes the "Prefer" header field on every request, besides the last one. When the server gets a request with a JSESSIONID, and without the "Prefer" header, it logs out the session.
It's mostly my gut feeling, but i would say it has these advantages:
1. It is more explicit, as on every request you confirm that you still want the authenticated session to be maintained. 2. It is also consistent with the default we have chosen of no persistent authentication. 3. It does not need a second header, so it is somewhat simpler.
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner. I would go for both - release mechanism (for proper handling) and timeout mechanism for garbage collection. (refer to: http://blog.synopse.info/post/2011/05/24/How-to-implement-RESTful-authentica...)
The only doubt I have about that is that from reading on the new "Prefer" header, I got the feeling that it is more relevant on session negotiation, and less something you would pass on every request in the session, but I'm not sure about that.
Regards, Geert
On 04/15/2012 01:06 PM, Oved Ourfalli wrote:
Hey,
The following wiki page describes a new feature - supporting session management via the REST API: http://www.ovirt.org/wiki/Features/RESTSessionManagement
Please review and comment.
Thank you, Oved
-- Geert Jansen Sr. Product Marketing Manager, Red Hat Enterprise Virtualization
Red Hat S.r.L. O: +39 095 916287 Via G. Fara 26 C: +39 348 1980079 (when in US: 415-623-0542) Milan 20124, Italy E: gjansen@redhat.com _______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 04/16/2012 10:04 AM, Miki Kenneth wrote:
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner.
I would go for both - release mechanism (for proper handling) and timeout mechanism for garbage collection. (refer to: http://blog.synopse.info/post/2011/05/24/How-to-implement-RESTful-authentica...)
Agreed we need both. I think that for security purposes, it is important to have a "log out" function. That way, client applications can decide depending on their local security requirements whether or not it is acceptable to leave a session open. Regards, Geert

----- Original Message -----
From: "Geert Jansen" <gjansen@redhat.com> To: "Miki Kenneth" <mkenneth@redhat.com> Cc: "Oved Ourfalli" <ovedo@redhat.com>, "engine-devel" <engine-devel@ovirt.org>, "Eoghan Glynn" <eglynn@redhat.com> Sent: Monday, April 16, 2012 11:34:26 AM Subject: Re: [Engine-devel] REST session management
On 04/16/2012 10:04 AM, Miki Kenneth wrote:
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner.
I would go for both - release mechanism (for proper handling) and timeout mechanism for garbage collection. (refer to: http://blog.synopse.info/post/2011/05/24/How-to-implement-RESTful-authentica...)
Agreed we need both. I think that for security purposes, it is important to have a "log out" function. That way, client applications can decide depending on their local security requirements whether or not it is acceptable to leave a session open.
So (unless someone objects) let's go for option #2 (using the Prefer header on each and every request, and release the session once it is not there). Thank you, Oved
Regards, Geert

On 04/16/2012 11:44 AM, Oved Ourfalli wrote:
----- Original Message -----
From: "Geert Jansen"<gjansen@redhat.com> To: "Miki Kenneth"<mkenneth@redhat.com> Cc: "Oved Ourfalli"<ovedo@redhat.com>, "engine-devel"<engine-devel@ovirt.org>, "Eoghan Glynn"<eglynn@redhat.com> Sent: Monday, April 16, 2012 11:34:26 AM Subject: Re: [Engine-devel] REST session management
On 04/16/2012 10:04 AM, Miki Kenneth wrote:
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner.
I would go for both - release mechanism (for proper handling) and timeout mechanism for garbage collection. (refer to: http://blog.synopse.info/post/2011/05/24/How-to-implement-RESTful-authentica...) Agreed we need both. I think that for security purposes, it is important to have a "log out" function. That way, client applications can decide depending on their local security requirements whether or not it is acceptable to leave a session open.
So (unless someone objects) let's go for option #2 (using the Prefer header on each and every request, and release the session once it is not there).
My only objection is that you implement a draft spec and implement a header without even bothering to register it - or asking if there is such an identical-purposed header with a different name which may get registered / is already in use somewhere. Y.
Thank you, Oved
Regards, Geert
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

----- Original Message -----
From: "Yaniv Kaul" <ykaul@redhat.com> To: "Oved Ourfalli" <ovedo@redhat.com> Cc: "engine-devel" <engine-devel@ovirt.org>, "Eoghan Glynn" <eglynn@redhat.com> Sent: Monday, April 16, 2012 2:03:26 PM Subject: Re: [Engine-devel] REST session management
On 04/16/2012 11:44 AM, Oved Ourfalli wrote:
----- Original Message -----
From: "Geert Jansen"<gjansen@redhat.com> To: "Miki Kenneth"<mkenneth@redhat.com> Cc: "Oved Ourfalli"<ovedo@redhat.com>, "engine-devel"<engine-devel@ovirt.org>, "Eoghan Glynn"<eglynn@redhat.com> Sent: Monday, April 16, 2012 11:34:26 AM Subject: Re: [Engine-devel] REST session management
On 04/16/2012 10:04 AM, Miki Kenneth wrote:
I Agree on that, although I'm not sure whether it is really needed to release the session, rather then rely on timeout. If we indeed need to provide a way to release the session then I agree this is the best alternative. But if we don't then it will make the API to the client more (but not very) complex in that manner.
I would go for both - release mechanism (for proper handling) and timeout mechanism for garbage collection. (refer to: http://blog.synopse.info/post/2011/05/24/How-to-implement-RESTful-authentica...) Agreed we need both. I think that for security purposes, it is important to have a "log out" function. That way, client applications can decide depending on their local security requirements whether or not it is acceptable to leave a session open.
So (unless someone objects) let's go for option #2 (using the Prefer header on each and every request, and release the session once it is not there).
My only objection is that you implement a draft spec and implement a header without even bothering to register it - or asking if there is such an identical-purposed header with a different name which may get registered / is already in use somewhere. Y.
One of the reasons of posting to this mailing list is to try and get information on alternatives. I already looked for similar headers, but I'll take another look to see if others exist. Any idea where I can get an official answer for that? Looked in http://www.iana.org/assignments/message-headers/perm-headers.html, but it was hard to find a more suitable header there. We can have a dedicated header of our own in that matter, but better being standard. BTW, from what I read the acceptance process is in its final stages, but I'm not too familiar with the process, so hard to say how much time will it take for it to be complete.
Thank you, Oved
Regards, Geert
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel
_______________________________________________ Engine-devel mailing list Engine-devel@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-devel

On 04/16/2012 01:03 PM, Yaniv Kaul wrote:
So (unless someone objects) let's go for option #2 (using the Prefer header on each and every request, and release the session once it is not there).
My only objection is that you implement a draft spec and implement a header without even bothering to register it - or asking if there is such an identical-purposed header with a different name which may get registered / is already in use somewhere.
This is somewhat of a red herring though. HTTP Prefer was created exactly for the purpose of indicating a preference for a certain behavior of response. Have a look at section 9.1.1 of the draft RFC for the initial preferences and you'll see the preferences that are already registered. HTTP Prefer also defines a registration process for the possible values of this header. The process requires an email to preferences@ietf.org with a 14 day response time. The alternative to HTTP Prefer would be creating a new header (as i am not aware of any other /approved/ header that fits the bill). This requires writing an RFC and get it approved, which would take much longer, and which would likely get the comment of "Why aren't you using Prefer". Even if HTTP Prefer, for whatever reason, unexpectedly does not become a standard, i think in practice this does not impact us in any way. Regards Geert

This is a multi-part message in MIME format. --------------040008030508030100010909 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit On 04/16/2012 03:31 PM, Geert Jansen wrote:
On 04/16/2012 01:03 PM, Yaniv Kaul wrote:
So (unless someone objects) let's go for option #2 (using the Prefer header on each and every request, and release the session once it is not there).
My only objection is that you implement a draft spec and implement a header without even bothering to register it - or asking if there is such an identical-purposed header with a different name which may get registered / is already in use somewhere.
This is somewhat of a red herring though.
HTTP Prefer was created exactly for the purpose of indicating a preference for a certain behavior of response. Have a look at section 9.1.1 of the draft RFC for the initial preferences and you'll see the preferences that are already registered.
HTTP Prefer also defines a registration process for the possible values of this header. The process requires an email to preferences@ietf.org with a 14 day response time.
The alternative to HTTP Prefer would be creating a new header (as i am not aware of any other /approved/ header that fits the bill). This requires writing an RFC and get it approved, which would take much longer, and which would likely get the comment of "Why aren't you using Prefer".
I'm more worried about "persistent-auth" than 'prefer'. We could always contact the draft author (jasnell@gmail.com) and ask for his opinion. Y.
Even if HTTP Prefer, for whatever reason, unexpectedly does not become a standard, i think in practice this does not impact us in any way.
Regards Geert
--------------040008030508030100010909 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit <html> <head> <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> </head> <body text="#000000" bgcolor="#FFFFFF"> On 04/16/2012 03:31 PM, Geert Jansen wrote: <blockquote cite="mid:4F8C112F.1060703@redhat.com" type="cite"> <br> On 04/16/2012 01:03 PM, Yaniv Kaul wrote: <br> <br> <blockquote type="cite"> <blockquote type="cite">So (unless someone objects) let's go for option #2 (using the Prefer <br> header on each and every request, and release the session once it is <br> not there). <br> </blockquote> <br> My only objection is that you implement a draft spec and implement a <br> header without even bothering to register it - or asking if there is <br> such an identical-purposed header with a different name which may get <br> registered / is already in use somewhere. <br> </blockquote> <br> This is somewhat of a red herring though. <br> <br> HTTP Prefer was created exactly for the purpose of indicating a preference for a certain behavior of response. Have a look at section 9.1.1 of the draft RFC for the initial preferences and you'll see the preferences that are already registered. <br> <br> HTTP Prefer also defines a registration process for the possible values of this header. The process requires an email to <a class="moz-txt-link-abbreviated" href="mailto:preferences@ietf.org">preferences@ietf.org</a> with a 14 day response time. <br> <br> The alternative to HTTP Prefer would be creating a new header (as i am not aware of any other /approved/ header that fits the bill). This requires writing an RFC and get it approved, which would take much longer, and which would likely get the comment of "Why aren't you using Prefer". <br> </blockquote> <br> I'm more worried about "persistent-auth" than 'prefer'. We could always contact the draft author (<a class="moz-txt-link-abbreviated" href="mailto:jasnell@gmail.com">jasnell@gmail.com</a>) and ask for his opinion.<br> Y.<br> <br> <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1"> <blockquote cite="mid:4F8C112F.1060703@redhat.com" type="cite"> <br> Even if HTTP Prefer, for whatever reason, unexpectedly does not become a standard, i think in practice this does not impact us in any way. <br> <br> Regards <br> Geert <br> </blockquote> <br> </body> </html> --------------040008030508030100010909--

On 04/16/2012 04:34 PM, Yaniv Kaul wrote:
The alternative to HTTP Prefer would be creating a new header (as i am not aware of any other /approved/ header that fits the bill). This requires writing an RFC and get it approved, which would take much longer, and which would likely get the comment of "Why aren't you using Prefer".
I'm more worried about "persistent-auth" than 'prefer'. We could always contact the draft author (jasnell@gmail.com) and ask for his opinion.
I can do this. Regards, Geert
participants (4)
-
Geert Jansen
-
Miki Kenneth
-
Oved Ourfalli
-
Yaniv Kaul