5
0
mirror of https://github.com/apache/sqoop.git synced 2025-05-05 01:51:37 +08:00

SQOOP-1775: Sqoop2: Migrate to URL parameter user.name instead of using header

(Abraham Elmahrek via Jarek Jarcec Cecho)
This commit is contained in:
Jarek Jarcec Cecho 2014-11-21 17:37:27 -08:00
parent 39ab0a6f25
commit ad35c19a1d
3 changed files with 2 additions and 6 deletions

View File

@ -56,8 +56,6 @@ protected String doHttpRequest(String strURL, String method, String data) {
HttpURLConnection conn = new AuthenticatedURL().openConnection(url, token);
conn.setRequestMethod(method);
// Provide name of user executing request
conn.setRequestProperty(SqoopProtocolConstants.HEADER_SQOOP_USERNAME, System.getProperty("user.name"));
// Sqoop is using JSON for data transfers
conn.setRequestProperty("Accept", MediaType.APPLICATION_JSON);
// Transfer client locale to return client specific data

View File

@ -18,8 +18,6 @@
package org.apache.sqoop.common;
public final class SqoopProtocolConstants {
public static final String HEADER_SQOOP_USERNAME = "sqoop-user-name";
public static final String HEADER_SQOOP_ERROR_CODE = "sqoop-error-code";
public static final String HEADER_SQOOP_ERROR_MESSAGE = "sqoop-error-message";

View File

@ -17,8 +17,8 @@
*/
package org.apache.sqoop.server;
import org.apache.hadoop.security.authentication.client.PseudoAuthenticator;
import org.apache.sqoop.common.SqoopException;
import org.apache.sqoop.common.SqoopProtocolConstants;
import org.apache.sqoop.server.common.ServerError;
import javax.servlet.http.HttpServletRequest;
@ -119,6 +119,6 @@ public Locale getAcceptLanguageHeader() {
* @return Name of user sending the request
*/
public String getUserName() {
return request.getHeader(SqoopProtocolConstants.HEADER_SQOOP_USERNAME);
return request.getParameter(PseudoAuthenticator.USER_NAME);
}
}