GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Merge pull request #1429 from fl4via/UNDERTOW-2213 · undertow-io/undertow@8a62c9c

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • servlet/src/main/java/io/undertow/servlet/handlers/security
    • SecurityPathMatches.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎servlet/src/main/java/io/undertow/servlet/handlers/security/SecurityPathMatches.java‎

Copy file name to clipboardExpand all lines: servlet/src/main/java/io/undertow/servlet/handlers/security/SecurityPathMatches.java
+4-22Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -75,23 +75,17 @@ private SecurityPathMatches(final boolean denyUncoveredHttpMethods, final PathSe
7575
* @return <code>true</code> If no security path information has been defined
7676
*/
7777
public boolean isEmpty() {
78-
return isDefaultPathSecurityEmpty() &&
78+
return defaultPathSecurityInformation.excludedMethodRoles.isEmpty() &&
79+
defaultPathSecurityInformation.perMethodRequiredRoles.isEmpty() &&
80+
defaultPathSecurityInformation.defaultRequiredRoles.isEmpty() &&
7981
exactPathRoleInformation.isEmpty() &&
8082
prefixPathRoleInformation.isEmpty() &&
8183
extensionRoleInformation.isEmpty();
8284
}
8385

84-
public boolean isDefaultPathSecurityEmpty() {
85-
return defaultPathSecurityInformation.excludedMethodRoles.isEmpty() &&
86-
defaultPathSecurityInformation.perMethodRequiredRoles.isEmpty() &&
87-
defaultPathSecurityInformation.defaultRequiredRoles.isEmpty();
88-
}
89-
9086
public SecurityPathMatch getSecurityInfo(final String path, final String method) {
9187
RuntimeMatch currentMatch = new RuntimeMatch();
92-
if (!isDefaultPathSecurityEmpty()) {
93-
handleMatch(method, defaultPathSecurityInformation, currentMatch);
94-
}
88+
handleMatch(method, defaultPathSecurityInformation, currentMatch);
9589
PathSecurityInformation match = exactPathRoleInformation.get(path);
9690
PathSecurityInformation extensionMatch = null;
9791
if (match != null) {
@@ -190,18 +184,6 @@ private void handleMatch(final String method, final PathSecurityInformation exac
190184
transport(currentMatch, role.transportGuaranteeType);
191185
currentMatch.constraints.add(new SingleConstraintMatch(role.emptyRoleSemantic, role.roles));
192186
}
193-
} else if (denyUncoveredHttpMethods) {
194-
if (exact.perMethodRequiredRoles.size() == 0) {
195-
// 13.8.4. When HTTP methods are not enumerated within a security-constraint, the protections defined by the
196-
// constraint apply to the complete set of HTTP (extension) methods.
197-
currentMatch.uncovered = false;
198-
currentMatch.constraints.add(new SingleConstraintMatch(SecurityInfo.EmptyRoleSemantic.PERMIT, new HashSet<>()));
199-
} else {
200-
//at this point method info is null, but there is match, above if will be triggered for default path, we need to flip it?
201-
// keep currentMatch.uncovered value as true (this is the value that is initially set)
202-
currentMatch.constraints.clear();
203-
currentMatch.constraints.add(new SingleConstraintMatch(SecurityInfo.EmptyRoleSemantic.DENY, new HashSet<>()));
204-
}
205187
}
206188
for (ExcludedMethodRoles excluded : exact.excludedMethodRoles) {
207189
if (!excluded.methods.contains(method)) {

0 commit comments

Comments
0 (0)
You are visitor 01402605 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.