guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/8] incubator-guacamole-client git commit: GUACAMOLE-78: Define a standard identifier for anonymous users.
Date Sun, 14 Aug 2016 01:27:04 GMT
Repository: incubator-guacamole-client
Updated Branches:
  refs/heads/master 49d50ee7e -> 8564f05ea


GUACAMOLE-78: Define a standard identifier for anonymous users.

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/fcefa7a7
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/tree/fcefa7a7
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/diff/fcefa7a7

Branch: refs/heads/master
Commit: fcefa7a7c7a0454994f0e184b70a2b4d631f12ec
Parents: 8e283ef
Author: Michael Jumper <mjumper@apache.org>
Authored: Fri Aug 12 12:51:53 2016 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Fri Aug 12 12:51:53 2016 -0700

----------------------------------------------------------------------
 .../apache/guacamole/net/auth/AuthenticatedUser.java   |  6 ++++++
 .../webapp/app/auth/service/authenticationService.js   | 13 +++++++++++++
 2 files changed, 19 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/fcefa7a7/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java
----------------------------------------------------------------------
diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java
b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java
index 514e65a..b121abf 100644
--- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java
+++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/AuthenticatedUser.java
@@ -29,6 +29,12 @@ package org.apache.guacamole.net.auth;
 public interface AuthenticatedUser extends Identifiable {
 
     /**
+     * The identifier reserved for representing a user that has authenticated
+     * anonymously.
+     */
+    public static final String ANONYMOUS_IDENTIFIER = "";
+
+    /**
      * Returns the AuthenticationProvider that authenticated this user.
      *
      * @return

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-client/blob/fcefa7a7/guacamole/src/main/webapp/app/auth/service/authenticationService.js
----------------------------------------------------------------------
diff --git a/guacamole/src/main/webapp/app/auth/service/authenticationService.js b/guacamole/src/main/webapp/app/auth/service/authenticationService.js
index 2bd6a9f..339a3e1 100644
--- a/guacamole/src/main/webapp/app/auth/service/authenticationService.js
+++ b/guacamole/src/main/webapp/app/auth/service/authenticationService.js
@@ -257,6 +257,19 @@ angular.module('auth').factory('authenticationService', ['$injector',
     };
 
     /**
+     * Returns whether the current user has authenticated anonymously. An
+     * anonymous user is denoted by the identifier reserved by the Guacamole
+     * extension API for anonymous users (the empty string).
+     *
+     * @returns {Boolean}
+     *     true if the current user has authenticated anonymously, false
+     *     otherwise.
+     */
+    service.isAnonymous = function isAnonymous() {
+        return service.getCurrentUsername() === '';
+    };
+
+    /**
      * Returns the username of the current user. If the current user is not
      * logged in, this value may not be valid.
      *


Mime
View raw message