This is an automated email from the ASF dual-hosted git repository.

more pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/knox.git


The following commit(s) were added to refs/heads/master by this push:
     new 812fd52e9 KNOX-2825 - Webshell - Only add Default provider iff it is 
found in the provider contributor map (#649)
812fd52e9 is described below

commit 812fd52e9af3cb3b86f60adc5791ea6d21808c3a
Author: Sandeep Moré <moresand...@gmail.com>
AuthorDate: Mon Oct 17 16:22:19 2022 -0400

    KNOX-2825 - Webshell - Only add Default provider iff it is found in the 
provider contributor map (#649)
---
 .../java/org/apache/knox/gateway/deploy/DeploymentFactory.java    | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/gateway-server/src/main/java/org/apache/knox/gateway/deploy/DeploymentFactory.java
 
b/gateway-server/src/main/java/org/apache/knox/gateway/deploy/DeploymentFactory.java
index 323458eff..a8ae6c810 100644
--- 
a/gateway-server/src/main/java/org/apache/knox/gateway/deploy/DeploymentFactory.java
+++ 
b/gateway-server/src/main/java/org/apache/knox/gateway/deploy/DeploymentFactory.java
@@ -260,7 +260,13 @@ public abstract class DeploymentFactory {
     // for some tests the number of providers are limited to the classpath of 
the module
     // and exceptions will be thrown as topologies are deployed even though 
they will
     // work fine at actual server runtime.
-    if (PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion") != null) {
+
+    // SRM: Only add "Default" provider iff it is found in the provider 
contributor map
+    // There could be cases where service loader might find other
+    // identity-assertion providers e.g. JWTAuthCodeAsserter
+    if (PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion") != null &&
+        PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion").keySet() != null &&
+        
PROVIDER_CONTRIBUTOR_MAP.get("identity-assertion").keySet().contains("Default"))
 {
       // check for required providers and add the defaults if missing
       if (!providerMap.containsKey("identity-assertion")) {
         Provider idassertion = new Provider();

Reply via email to