[ovirt-devel] [UI plugins] replacing RestApiSessionAcquired event
Martin Sivak
msivak at redhat.com
Mon Jan 25 10:14:52 UTC 2016
Hi,
that is a nice improvement, but I have one question.. how are we going
to use this when we have no direct access to the xhr object? jQuery
and Angular abstractions come to my mind..
Martin
On Fri, Jan 22, 2016 at 1:43 PM, Vojtech Szocs <vszocs at redhat.com> wrote:
> Hi,
>
> in oVirt 4.0 the RestApiSessionAcquired event will be replaced
> with API to create authenticated requests for Engine services.
>
> Using REST API persistent session mechanism where UI acquires
> a single session to be shared by all UI plugins led us to many
> problems in the past, typically observed by end users as "Auth
> Required" browser popups.
>
> The new API proposed by [1] creates XMLHttpRequest object with
> following properties:
> * sets "Authorization: Bearer xxx" header before sending
> * logs request and response details (enabled via API option)
>
> [1] https://gerrit.ovirt.org/#/c/49278/
>
> Example:
>
> var xhr = api.createEngineHttpRequest();
> xhr.open('GET', 'http://example.com/ovirt-engine/api', true);
> xhr.setRequestHeader('Accept', 'application/json');
> xhr.send(null);
>
> Since REST API persistent session mechanism currently relies
> on cookie (JSESSIONID), individual UI plugins should not try
> to create a REST session on their own to avoid any clashes.
>
> Regards,
> Vojtech
> _______________________________________________
> Devel mailing list
> Devel at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/devel
More information about the Devel
mailing list