Alon Bar-Lev has posted comments on this change.

Change subject: webadmin: Small cleanup in RestApiSessionManager
......................................................................


Patch Set 1:

(3 comments)

http://gerrit.ovirt.org/#/c/35708/1/frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java
File 
frontend/webadmin/modules/webadmin/src/main/java/org/ovirt/engine/ui/webadmin/plugin/restapi/RestApiSessionManager.java:

Line 139
Line 140
Line 141
Line 142
Line 143
from what I see we get the session id twice in this sequence, pass it to 
function?


Line 68:     private static final Logger logger = 
Logger.getLogger(RestApiSessionManager.class.getName());
Line 69: 
Line 70:     private static final String PREFER_HEADER = "Prefer"; //$NON-NLS-1$
Line 71:     private static final String SESSION_ID_HEADER = "JSESSIONID"; 
//$NON-NLS-1$
Line 72:     private static final String CSRF_HEADER = SESSION_ID_HEADER;
I think it is confusing to refer the same header with two names.
Line 73:     private static final String ENGINE_AUTH_TOKEN_HEADER = 
"OVIRT-INTERNAL-ENGINE-AUTH-TOKEN"; //$NON-NLS-1$
Line 74: 
Line 75:     private static final String SESSION_ID_KEY = "RestApiSessionId"; 
//$NON-NLS-1$
Line 76:     private static final String DEFAULT_SESSION_TIMEOUT = "30"; 
//$NON-NLS-1$


Line 126:         RequestBuilder builder = createRequest();
Line 127: 
Line 128:         // Enforce expiry of existing session when acquiring new 
session
Line 129:         String preferValue = builder.getHeader(PREFER_HEADER);
Line 130:         builder.setHeader(PREFER_HEADER, preferValue + ", new-auth"); 
//$NON-NLS-1$
usually getHeader does not work properly in http frameworks, I was quite 
surprised it is possible.
Line 131: 
Line 132:         // Map this (physical) REST API session to current user's 
(logical) Engine session
Line 133:         builder.setHeader(ENGINE_AUTH_TOKEN_HEADER, engineAuthToken);
Line 134: 


-- 
To view, visit http://gerrit.ovirt.org/35708
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I98ad53785726c4ed1a8b1eaaf4fd473052496c3e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Vojtech Szocs <vsz...@redhat.com>
Gerrit-Reviewer: Alexander Wels <aw...@redhat.com>
Gerrit-Reviewer: Alon Bar-Lev <alo...@redhat.com>
Gerrit-Reviewer: automat...@ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to