From 700005e8238ec1cba18feb00c98c3a9997380811 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 11 Sep 2017 18:20:53 -0700 Subject: [PATCH] GUACAMOLE-394: Remove UserRecord interface - recording historical auth tokens doesn't make sense, and removing that turns UserRecord into an empty interface. --- .../jdbc/sharing/user/SharedUserContext.java | 6 +-- .../auth/jdbc/user/ModeledUserContext.java | 6 +-- .../guacamole/auth/ldap/user/UserContext.java | 6 +-- .../guacamole/net/auth/UserContext.java | 18 +++++---- .../apache/guacamole/net/auth/UserRecord.java | 39 ------------------- .../net/auth/simple/SimpleUserContext.java | 6 +-- 6 files changed, 23 insertions(+), 58 deletions(-) delete mode 100644 guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserRecord.java diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/user/SharedUserContext.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/user/SharedUserContext.java index 67cb6e481..4bc54b562 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/user/SharedUserContext.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/sharing/user/SharedUserContext.java @@ -28,6 +28,7 @@ import org.apache.guacamole.auth.jdbc.sharing.connectiongroup.SharedRootConnecti import org.apache.guacamole.auth.jdbc.user.RemoteAuthenticatedUser; import org.apache.guacamole.form.Form; import org.apache.guacamole.net.auth.ActiveConnection; +import org.apache.guacamole.net.auth.ActivityRecord; import org.apache.guacamole.net.auth.ActivityRecordSet; import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.Connection; @@ -37,7 +38,6 @@ import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.User; import org.apache.guacamole.net.auth.UserContext; -import org.apache.guacamole.net.auth.UserRecord; import org.apache.guacamole.net.auth.simple.SimpleActivityRecordSet; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory; import org.apache.guacamole.net.auth.simple.SimpleDirectory; @@ -182,9 +182,9 @@ public class SharedUserContext implements UserContext { } @Override - public ActivityRecordSet getUserHistory() + public ActivityRecordSet getUserHistory() throws GuacamoleException { - return new SimpleActivityRecordSet(); + return new SimpleActivityRecordSet(); } @Override diff --git a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUserContext.java b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUserContext.java index b18b9558a..1b238abf6 100644 --- a/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUserContext.java +++ b/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/user/ModeledUserContext.java @@ -36,6 +36,7 @@ import org.apache.guacamole.auth.jdbc.sharingprofile.ModeledSharingProfile; import org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileDirectory; import org.apache.guacamole.form.Form; import org.apache.guacamole.net.auth.ActiveConnection; +import org.apache.guacamole.net.auth.ActivityRecord; import org.apache.guacamole.net.auth.ActivityRecordSet; import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.Connection; @@ -43,7 +44,6 @@ import org.apache.guacamole.net.auth.ConnectionGroup; import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.User; -import org.apache.guacamole.net.auth.UserRecord; import org.apache.guacamole.net.auth.simple.SimpleActivityRecordSet; /** @@ -165,9 +165,9 @@ public class ModeledUserContext extends RestrictedObject } @Override - public ActivityRecordSet getUserHistory() + public ActivityRecordSet getUserHistory() throws GuacamoleException { - return new SimpleActivityRecordSet(); + return new SimpleActivityRecordSet(); } @Override diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserContext.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserContext.java index b7e9e2708..5e19dcaa1 100644 --- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserContext.java +++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/user/UserContext.java @@ -28,6 +28,7 @@ import org.apache.guacamole.auth.ldap.connection.ConnectionService; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.form.Form; import org.apache.guacamole.net.auth.ActiveConnection; +import org.apache.guacamole.net.auth.ActivityRecord; import org.apache.guacamole.net.auth.ActivityRecordSet; import org.apache.guacamole.net.auth.AuthenticatedUser; import org.apache.guacamole.net.auth.AuthenticationProvider; @@ -37,7 +38,6 @@ import org.apache.guacamole.net.auth.ConnectionRecord; import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.User; -import org.apache.guacamole.net.auth.UserRecord; import org.apache.guacamole.net.auth.simple.SimpleActivityRecordSet; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroup; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory; @@ -212,9 +212,9 @@ public class UserContext implements org.apache.guacamole.net.auth.UserContext { } @Override - public ActivityRecordSet getUserHistory() + public ActivityRecordSet getUserHistory() throws GuacamoleException { - return new SimpleActivityRecordSet(); + return new SimpleActivityRecordSet(); } @Override diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserContext.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserContext.java index 8c741b8d8..1c82f9ce8 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserContext.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserContext.java @@ -143,9 +143,11 @@ public interface UserContext { throws GuacamoleException; /** - * Retrieves all connection records visible to current user. The resulting - * set of connection records can be further filtered and ordered using the - * methods defined on ActivityRecordSet. + * Retrieves all connection records visible to current user. Connection + * history records describe the start and end times of connections, and + * correspond to the times that users connect or disconnect to individual + * remote desktops. The resulting set of connection records can be further + * filtered and ordered using the methods defined on ActivityRecordSet. * * @return * A set of all connection records visible to the current user. @@ -157,9 +159,11 @@ public interface UserContext { throws GuacamoleException; /** - * Retrieves all user records visible to current user. The resulting - * set of user records can be further filtered and ordered using the - * methods defined on ActivityRecordSet. + * Retrieves all user history records visible to current user. User history + * records describe the start and end times of user sessions, and correspond + * to the times that users logged in or out. The resulting set of user + * records can be further filtered and ordered using the methods defined on + * ActivityRecordSet. * * @return * A set of all user records visible to the current user. @@ -167,7 +171,7 @@ public interface UserContext { * @throws GuacamoleException * If an error occurs while retrieving the user records. */ - ActivityRecordSet getUserHistory() throws GuacamoleException; + ActivityRecordSet getUserHistory() throws GuacamoleException; /** * Retrieves a connection group which can be used to view and manipulate diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserRecord.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserRecord.java deleted file mode 100644 index 16ca2c615..000000000 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/UserRecord.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -package org.apache.guacamole.net.auth; - -/** - * A logging record describing when a user started and ended their Guacamole - * session. - */ -public interface UserRecord extends ActivityRecord { - - /** - * Returns the authentication token associated with the user's session, if - * known. If permission is not granted to view the authentication tokens of - * other users, this may be null. - * - * @return - * The authentication token associated with the user's session, or null - * if this information is unavailable. - */ - public String getToken(); - -} diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUserContext.java b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUserContext.java index 360d74ab7..1678d8827 100644 --- a/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUserContext.java +++ b/guacamole-ext/src/main/java/org/apache/guacamole/net/auth/simple/SimpleUserContext.java @@ -27,6 +27,7 @@ import java.util.UUID; import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.form.Form; import org.apache.guacamole.net.auth.ActiveConnection; +import org.apache.guacamole.net.auth.ActivityRecord; import org.apache.guacamole.net.auth.ActivityRecordSet; import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.Connection; @@ -36,7 +37,6 @@ import org.apache.guacamole.net.auth.Directory; import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.User; import org.apache.guacamole.net.auth.UserContext; -import org.apache.guacamole.net.auth.UserRecord; import org.apache.guacamole.protocol.GuacamoleConfiguration; /** @@ -217,9 +217,9 @@ public class SimpleUserContext implements UserContext { } @Override - public ActivityRecordSet getUserHistory() + public ActivityRecordSet getUserHistory() throws GuacamoleException { - return new SimpleActivityRecordSet(); + return new SimpleActivityRecordSet(); } @Override