[NO ISSUE][*DB] Refactor UDF auth header access
Change-Id: I41023663e1212c0c8789873e63c9bfbeae48cea8
Reviewed-on: https://asterix-gerrit.ics.uci.edu/c/asterixdb/+/17390
Integration-Tests: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Tested-by: Jenkins <jenkins@fulliautomatix.ics.uci.edu>
Reviewed-by: Murtadha Hubail <mhubail@apache.org>
diff --git a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfApiServlet.java b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfApiServlet.java
index 3d0f7fc..47685d8 100644
--- a/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfApiServlet.java
+++ b/asterixdb/asterix-app/src/main/java/org/apache/asterix/api/http/server/NCUdfApiServlet.java
@@ -81,7 +81,7 @@
protected final IReceptionist receptionist;
protected Path workingDir;
- protected String sysAuthHeader;
+ private String sysAuthHeader;
private ILibraryManager libraryManager;
private int timeout;
@@ -250,7 +250,7 @@
}
URI downloadURI = createDownloadURI(libraryTempFile);
doCreate(dvAndName.getFirst(), dvAndName.getSecond(), language,
- ExternalLibraryUtils.digestToHexString(digest), downloadURI, true, sysAuthHeader,
+ ExternalLibraryUtils.digestToHexString(digest), downloadURI, true, getSysAuthHeader(),
requestReference, request);
} else if (op == LibraryOperation.DELETE) {
//DELETE semantics imply ifExists
@@ -281,6 +281,10 @@
}
}
+ protected String getSysAuthHeader() {
+ return sysAuthHeader;
+ }
+
private void writeException(Exception e, IServletResponse response) {
response.setStatus(toHttpErrorStatus(e));
PrintWriter responseWriter = response.writer();