Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -893,6 +893,27 @@ public void addInternalServlet(String name, String pathSpec,
}
webAppContext.addServlet(holder, pathSpec);

// Remove any previous filter attached to the removed servlet path to avoid
// Kerberos replay error.
FilterMapping[] filterMappings = webAppContext.getServletHandler().
getFilterMappings();
for (int i = 0; i < filterMappings.length; i++) {
if (filterMappings[i].getPathSpecs() == null) {
LOG.debug("Skip checking {} filterMappings {} without a path spec.",
filterMappings[i].getFilterName(), filterMappings[i]);
continue;
}
int oldPathSpecsLen = filterMappings[i].getPathSpecs().length;
String[] newPathSpecs =
ArrayUtil.removeFromArray(filterMappings[i].getPathSpecs(), pathSpec);
if (newPathSpecs.length == 0) {
webAppContext.getServletHandler().setFilterMappings(
ArrayUtil.removeFromArray(filterMappings, filterMappings[i]));
} else if (newPathSpecs.length != oldPathSpecsLen) {
filterMappings[i].setPathSpecs(newPathSpecs);
}
}

if (requireAuth && UserGroupInformation.isSecurityEnabled()) {
LOG.info("Adding Kerberos (SPNEGO) filter to {}", name);
ServletHandler handler = webAppContext.getServletHandler();
Expand Down
14 changes: 14 additions & 0 deletions hadoop-ozone/dist/src/main/smoketest/spnego/web.robot
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ ${OM_SERVICE_LIST_URL} http://om:9874/serviceList
${SCM_URL} http://scm:9876
${RECON_URL} http://recon:9888

${SCM_CONF_URL} http://scm:9876/conf
${SCM_JMX_URL} http://scm:9876/jmx
${SCM_STACKS_URL} http://scm:9876/stacks


*** Keywords ***
Verify SPNEGO enabled URL
[arguments] ${url}
Expand Down Expand Up @@ -60,6 +65,15 @@ Test OM Service List
Test SCM portal
Verify SPNEGO enabled URL ${SCM_URL}

Test SCM conf
Verify SPNEGO enabled URL ${SCM_CONF_URL}

Test SCM jmx
Verify SPNEGO enabled URL ${SCM_JMX_URL}

Test SCM stacks
Verify SPNEGO enabled URL ${SCM_STACKS_URL}

Test Recon portal
Verify SPNEGO enabled URL ${RECON_URL}