From 82a50727d801c34b27483b81be7a4b6d02be123f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 3 Mar 2021 14:40:46 -0600 Subject: [PATCH 1/3] Issue #6026 - Cleaning up uncovered HTTP methods warning Signed-off-by: Joakim Erdfelt --- .../jetty/security/ConstraintSecurityHandler.java | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java index 55416fd4dbc1..d82907f2839a 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java @@ -716,8 +716,8 @@ protected boolean checkWebResourcePermissions(String pathInContext, Request requ public void dump(Appendable out, String indent) throws IOException { dumpObjects(out, indent, - DumpableCollection.from("roles", _roles), - DumpableCollection.from("constraints", _constraintMappings)); + DumpableCollection.from("roles", _roles), + DumpableCollection.from("constraints", _constraintMappings)); } @Override @@ -741,14 +741,9 @@ public boolean checkPathsWithUncoveredHttpMethods() Set paths = getPathsWithUncoveredHttpMethods(); if (paths != null && !paths.isEmpty()) { - ContextHandler.Context currentContext = ContextHandler.getCurrentContext(); - - for (String p : paths) - { - LOG.warn("{} has uncovered http methods for path: {}", currentContext, p); - } - if (LOG.isDebugEnabled()) - LOG.debug("{} has uncovered http methods", currentContext, new Throwable()); + LOG.warn("{} has paths with uncovered http methods: [{}]", + ContextHandler.getCurrentContext(), + String.join(", ", paths)); return true; } return false; From da83f05c402d7a3c531e16c612c314cf6a4e793d Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 9 Mar 2021 10:22:48 -0600 Subject: [PATCH 2/3] Issue #6026 - tweaking output Signed-off-by: Joakim Erdfelt --- .../eclipse/jetty/security/ConstraintSecurityHandler.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java index d82907f2839a..768eef068236 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java @@ -741,9 +741,8 @@ public boolean checkPathsWithUncoveredHttpMethods() Set paths = getPathsWithUncoveredHttpMethods(); if (paths != null && !paths.isEmpty()) { - LOG.warn("{} has paths with uncovered http methods: [{}]", - ContextHandler.getCurrentContext(), - String.join(", ", paths)); + LOG.warn("{} has uncovered http methods for the following paths: {}", + ContextHandler.getCurrentContext(), paths); return true; } return false; From 74ecf3675b4c2602573082f2a53baa728b755863 Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Tue, 9 Mar 2021 10:25:39 -0600 Subject: [PATCH 3/3] Issue #6026 - Limiting scope of PR Signed-off-by: Joakim Erdfelt --- .../eclipse/jetty/security/ConstraintSecurityHandler.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java index 768eef068236..de7fd0025b3a 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/ConstraintSecurityHandler.java @@ -716,8 +716,8 @@ protected boolean checkWebResourcePermissions(String pathInContext, Request requ public void dump(Appendable out, String indent) throws IOException { dumpObjects(out, indent, - DumpableCollection.from("roles", _roles), - DumpableCollection.from("constraints", _constraintMappings)); + DumpableCollection.from("roles", _roles), + DumpableCollection.from("constraints", _constraintMappings)); } @Override @@ -741,7 +741,7 @@ public boolean checkPathsWithUncoveredHttpMethods() Set paths = getPathsWithUncoveredHttpMethods(); if (paths != null && !paths.isEmpty()) { - LOG.warn("{} has uncovered http methods for the following paths: {}", + LOG.warn("{} has uncovered HTTP methods for the following paths: {}", ContextHandler.getCurrentContext(), paths); return true; }