Review Board 1.7.22


SQOOP-664 Send user name as HTTP header in client to server communication

Review Request #9683 - Created Feb. 28, 2013 and submitted

Abraham Elmahrek
SQOOP-664
Reviewers
Sqoop
jarcec
sqoop-sqoop2
commit cbbd044f7b3da77741f50c5a5082b57a3b49c1e2
Author: Abraham Elmahrek <abraham@elmahrek.com>
Date:   Fri Mar 1 00:56:18 2013 -0800

    SQOOP-664 Send user name as HTTP header in client to server communication
    
    Using a custom HTTP header "User-Name" following convention defined in rfc-6648.
    User name of user executing sqoop is sent to the server.

:100644 100644 1720507... 1b5d34c... M  client/src/main/java/org/apache/sqoop/client/request/Request.java
:100644 100644 c6b6569... 9685d96... M  server/src/main/java/org/apache/sqoop/server/RequestContext.java
Ran all unit tests and verified client is sending header to server.
client/src/main/java/org/apache/sqoop/client/request/Request.java
Revision 17205070b87ac1904c055ba2d4fa7b773f2f3034 New Change
[20] 47 lines
[+20] [+] protected Builder getBuilder(String url) {
48

    
   
48

   
49
    // Provide filter that will rebuild exception that is sent from server
49
    // Provide filter that will rebuild exception that is sent from server
50
    resource.addFilter(serverExceptionFilter);
50
    resource.addFilter(serverExceptionFilter);
51

    
   
51

   
52
    return resource
52
    return resource

    
   
53
      // Provide name of user executing request.

    
   
54
      .header(SqoopProtocolConstants.HEADER_SQOOP_USERNAME, System.getProperty("user.name"))
53
      // Sqoop is using JSON for data transfers
55
      // Sqoop is using JSON for data transfers
54
      .accept(MediaType.APPLICATION_JSON_TYPE)
56
      .accept(MediaType.APPLICATION_JSON_TYPE)
55
      // Transfer client locale to return client specific data
57
      // Transfer client locale to return client specific data
56
      .acceptLanguage(Locale.getDefault());
58
      .acceptLanguage(Locale.getDefault());
57
  }
59
  }
[+20] [20] 50 lines
common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java
Revision 93c786d7be26f2097ea83ef675e2d4a8c4938d60 New Change
 
server/src/main/java/org/apache/sqoop/server/RequestContext.java
Revision c6b6569a9c19860fe8d1138040c1ffaa1ce5844e New Change
 
  1. client/src/main/java/org/apache/sqoop/client/request/Request.java: Loading...
  2. common/src/main/java/org/apache/sqoop/common/SqoopProtocolConstants.java: Loading...
  3. server/src/main/java/org/apache/sqoop/server/RequestContext.java: Loading...