@@ -75,23 +75,17 @@ private SecurityPathMatches(final boolean denyUncoveredHttpMethods, final PathSe |
75 | 75 | * @return <code>true</code> If no security path information has been defined |
76 | 76 | */ |
77 | 77 | public boolean isEmpty() { |
78 | | - return isDefaultPathSecurityEmpty() && |
| 78 | + return defaultPathSecurityInformation.excludedMethodRoles.isEmpty() && |
| 79 | + defaultPathSecurityInformation.perMethodRequiredRoles.isEmpty() && |
| 80 | + defaultPathSecurityInformation.defaultRequiredRoles.isEmpty() && |
79 | 81 | exactPathRoleInformation.isEmpty() && |
80 | 82 | prefixPathRoleInformation.isEmpty() && |
81 | 83 | extensionRoleInformation.isEmpty(); |
82 | 84 | } |
83 | 85 |
|
84 | | - public boolean isDefaultPathSecurityEmpty() { |
85 | | - return defaultPathSecurityInformation.excludedMethodRoles.isEmpty() && |
86 | | - defaultPathSecurityInformation.perMethodRequiredRoles.isEmpty() && |
87 | | - defaultPathSecurityInformation.defaultRequiredRoles.isEmpty(); |
88 | | - } |
89 | | - |
90 | 86 | public SecurityPathMatch getSecurityInfo(final String path, final String method) { |
91 | 87 | RuntimeMatch currentMatch = new RuntimeMatch(); |
92 | | - if (!isDefaultPathSecurityEmpty()) { |
93 | | - handleMatch(method, defaultPathSecurityInformation, currentMatch); |
94 | | - } |
| 88 | + handleMatch(method, defaultPathSecurityInformation, currentMatch); |
95 | 89 | PathSecurityInformation match = exactPathRoleInformation.get(path); |
96 | 90 | PathSecurityInformation extensionMatch = null; |
97 | 91 | if (match != null) { |
@@ -190,18 +184,6 @@ private void handleMatch(final String method, final PathSecurityInformation exac |
190 | 184 | transport(currentMatch, role.transportGuaranteeType); |
191 | 185 | currentMatch.constraints.add(new SingleConstraintMatch(role.emptyRoleSemantic, role.roles)); |
192 | 186 | } |
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 | | - } |
205 | 187 | } |
206 | 188 | for (ExcludedMethodRoles excluded : exact.excludedMethodRoles) { |
207 | 189 | if (!excluded.methods.contains(method)) { |
|