You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by mj...@apache.org on 2017/10/27 17:51:45 UTC

[07/25] incubator-guacamole-client git commit: GUACAMOLE-362: Fix style issue; remove unnecessary LocalEnvironment initilization.

GUACAMOLE-362: Fix style issue; remove unnecessary LocalEnvironment initilization.


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

Branch: refs/heads/master
Commit: 87fba0ed7bb640e305a81626e6e6b03cc57221ea
Parents: 1c33310
Author: Nick Couchman <vn...@apache.org>
Authored: Wed Aug 23 10:21:24 2017 -0400
Committer: Nick Couchman <ni...@yahoo.com>
Committed: Fri Oct 27 13:05:12 2017 -0400

----------------------------------------------------------------------
 .../auth/cas/AuthenticationProviderService.java        | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/87fba0ed/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
----------------------------------------------------------------------
diff --git a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
index 6a13a83..1797060 100644
--- a/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
+++ b/extensions/guacamole-auth-cas/src/main/java/org/apache/guacamole/auth/cas/AuthenticationProviderService.java
@@ -39,9 +39,9 @@ import javax.crypto.Cipher;
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpSession;
 import javax.xml.bind.DatatypeConverter;
-import org.apache.guacamole.GuacamoleException;
-import org.apache.guacamole.environment.LocalEnvironment;
+import org.apache.guacamole.environment.Environment;
 import org.apache.guacamole.form.Field;
+import org.apache.guacamole.GuacamoleException;
 import org.apache.guacamole.net.auth.Credentials;
 import org.apache.guacamole.net.auth.credentials.CredentialsInfo;
 import org.apache.guacamole.net.auth.credentials.GuacamoleInsufficientCredentialsException;
@@ -71,6 +71,12 @@ public class AuthenticationProviderService {
     private ConfigurationService confService;
 
     /**
+     * The Guacamole server environment.
+     */
+    @Inject
+    private Environment environment;
+
+    /**
      * Service for validating received ID tickets.
      */
     @Inject
@@ -150,6 +156,7 @@ public class AuthenticationProviderService {
      * @return
      *     The decrypted password, or null if it is unable to
      *     decrypt the password.
+     *
      * @throws GuacamoleException
      *     If unable to get Guacamole configuration data
      */
@@ -163,7 +170,7 @@ public class AuthenticationProviderService {
         try {
 
             // Open and read the file specified in the configuration.
-            File keyFile = new File(new LocalEnvironment().getGuacamoleHome(), confService.getClearpassKey().toString());
+            File keyFile = new File(environment.getGuacamoleHome(), confService.getClearpassKey().toString());
             InputStream keyInput = new BufferedInputStream(new FileInputStream(keyFile));
             final byte[] keyBytes = new byte[(int) keyFile.length()];
             keyInput.read(keyBytes);