You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/09/07 23:01:20 UTC

[3/6] guacamole-client git commit: GUACAMOLE-611: Advise administrator to set "skip-if-unavailable" if similar internal errors should be tolerated in the future.

GUACAMOLE-611: Advise administrator to set "skip-if-unavailable" if similar internal errors should be tolerated in the future.

Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/cc742f21
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/cc742f21
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/cc742f21

Branch: refs/heads/master
Commit: cc742f214339fbece37f0797a8c338212dcb0b63
Parents: 8fae19d
Author: Michael Jumper <mj...@apache.org>
Authored: Sat Aug 25 13:27:44 2018 -0700
Committer: Michael Jumper <mj...@apache.org>
Committed: Sat Aug 25 13:45:41 2018 -0700

----------------------------------------------------------------------
 .../extension/AuthenticationProviderFacade.java | 23 ++++++++++++++++++++
 .../guacamole/extension/ExtensionModule.java    |  2 +-
 2 files changed, 24 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/cc742f21/guacamole/src/main/java/org/apache/guacamole/extension/AuthenticationProviderFacade.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/AuthenticationProviderFacade.java b/guacamole/src/main/java/org/apache/guacamole/extension/AuthenticationProviderFacade.java
index ecb0a40..3b8fd62 100644
--- a/guacamole/src/main/java/org/apache/guacamole/extension/AuthenticationProviderFacade.java
+++ b/guacamole/src/main/java/org/apache/guacamole/extension/AuthenticationProviderFacade.java
@@ -154,6 +154,25 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
 
     }
 
+    /**
+     * Logs a warning that the authentication process will be entirely aborted
+     * due to an internal error, advising the administrator to set the
+     * "skip-if-unavailable" property if error encountered is expected and
+     * should be tolerated.
+     */
+    private void warnAuthAborted() {
+        String identifier = getIdentifier();
+        logger.warn("The \"{}\" authentication provider has encountered an "
+                + "internal error which will halt the authentication "
+                + "process. If this is unexpected or you are the developer of "
+                + "this authentication provider, you may wish to enable "
+                + "debug-level logging. If this is expected and you wish to "
+                + "ignore such failures in the future, please set \"{}: {}\" "
+                + "within your guacamole.properties.",
+                identifier, ExtensionModule.SKIP_IF_UNAVAILABLE.getName(),
+                identifier);
+    }
+
     @Override
     public AuthenticatedUser authenticateUser(Credentials credentials)
             throws GuacamoleException {
@@ -186,6 +205,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
                 return null;
             }
 
+            warnAuthAborted();
             throw e;
 
         }
@@ -198,6 +218,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
                 return null;
             }
 
+            warnAuthAborted();
             throw e;
 
         }
@@ -251,6 +272,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
                 return null;
             }
 
+            warnAuthAborted();
             throw e;
 
         }
@@ -263,6 +285,7 @@ public class AuthenticationProviderFacade implements AuthenticationProvider {
                 return null;
             }
 
+            warnAuthAborted();
             throw e;
 
         }

http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/cc742f21/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
----------------------------------------------------------------------
diff --git a/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java b/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
index 05bdfc1..ae8c463 100644
--- a/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
+++ b/guacamole/src/main/java/org/apache/guacamole/extension/ExtensionModule.java
@@ -93,7 +93,7 @@ public class ExtensionModule extends ServletModule {
      * providers that are not within this list will halt the authentication
      * process entirely.
      */
-    private final StringSetProperty SKIP_IF_UNAVAILABLE = new StringSetProperty() {
+    public static final StringSetProperty SKIP_IF_UNAVAILABLE = new StringSetProperty() {
 
         @Override
         public String getName() {