GUACAMOLE-394: Remove UserRecord interface - recording historical auth tokens doesn't make sense, and removing that turns UserRecord into an empty interface.

This commit is contained in:
Michael Jumper
2017-09-11 18:20:53 -07:00
parent 5340f55361
commit 700005e823
6 changed files with 23 additions and 58 deletions

View File

@@ -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.auth.jdbc.user.RemoteAuthenticatedUser;
import org.apache.guacamole.form.Form; import org.apache.guacamole.form.Form;
import org.apache.guacamole.net.auth.ActiveConnection; 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.ActivityRecordSet;
import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.AuthenticationProvider;
import org.apache.guacamole.net.auth.Connection; 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.SharingProfile;
import org.apache.guacamole.net.auth.User; import org.apache.guacamole.net.auth.User;
import org.apache.guacamole.net.auth.UserContext; 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.SimpleActivityRecordSet;
import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory;
import org.apache.guacamole.net.auth.simple.SimpleDirectory; import org.apache.guacamole.net.auth.simple.SimpleDirectory;
@@ -182,9 +182,9 @@ public class SharedUserContext implements UserContext {
} }
@Override @Override
public ActivityRecordSet<UserRecord> getUserHistory() public ActivityRecordSet<ActivityRecord> getUserHistory()
throws GuacamoleException { throws GuacamoleException {
return new SimpleActivityRecordSet<UserRecord>(); return new SimpleActivityRecordSet<ActivityRecord>();
} }
@Override @Override

View File

@@ -36,6 +36,7 @@ import org.apache.guacamole.auth.jdbc.sharingprofile.ModeledSharingProfile;
import org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileDirectory; import org.apache.guacamole.auth.jdbc.sharingprofile.SharingProfileDirectory;
import org.apache.guacamole.form.Form; import org.apache.guacamole.form.Form;
import org.apache.guacamole.net.auth.ActiveConnection; 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.ActivityRecordSet;
import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.AuthenticationProvider;
import org.apache.guacamole.net.auth.Connection; 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.Directory;
import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.SharingProfile;
import org.apache.guacamole.net.auth.User; 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.SimpleActivityRecordSet;
/** /**
@@ -165,9 +165,9 @@ public class ModeledUserContext extends RestrictedObject
} }
@Override @Override
public ActivityRecordSet<UserRecord> getUserHistory() public ActivityRecordSet<ActivityRecord> getUserHistory()
throws GuacamoleException { throws GuacamoleException {
return new SimpleActivityRecordSet<UserRecord>(); return new SimpleActivityRecordSet<ActivityRecord>();
} }
@Override @Override

View File

@@ -28,6 +28,7 @@ import org.apache.guacamole.auth.ldap.connection.ConnectionService;
import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.form.Form; import org.apache.guacamole.form.Form;
import org.apache.guacamole.net.auth.ActiveConnection; 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.ActivityRecordSet;
import org.apache.guacamole.net.auth.AuthenticatedUser; import org.apache.guacamole.net.auth.AuthenticatedUser;
import org.apache.guacamole.net.auth.AuthenticationProvider; 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.Directory;
import org.apache.guacamole.net.auth.SharingProfile; import org.apache.guacamole.net.auth.SharingProfile;
import org.apache.guacamole.net.auth.User; 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.SimpleActivityRecordSet;
import org.apache.guacamole.net.auth.simple.SimpleConnectionGroup; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroup;
import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory; import org.apache.guacamole.net.auth.simple.SimpleConnectionGroupDirectory;
@@ -212,9 +212,9 @@ public class UserContext implements org.apache.guacamole.net.auth.UserContext {
} }
@Override @Override
public ActivityRecordSet<UserRecord> getUserHistory() public ActivityRecordSet<ActivityRecord> getUserHistory()
throws GuacamoleException { throws GuacamoleException {
return new SimpleActivityRecordSet<UserRecord>(); return new SimpleActivityRecordSet<ActivityRecord>();
} }
@Override @Override

View File

@@ -143,9 +143,11 @@ public interface UserContext {
throws GuacamoleException; throws GuacamoleException;
/** /**
* Retrieves all connection records visible to current user. The resulting * Retrieves all connection records visible to current user. Connection
* set of connection records can be further filtered and ordered using the * history records describe the start and end times of connections, and
* methods defined on ActivityRecordSet. * 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 * @return
* A set of all connection records visible to the current user. * A set of all connection records visible to the current user.
@@ -157,9 +159,11 @@ public interface UserContext {
throws GuacamoleException; throws GuacamoleException;
/** /**
* Retrieves all user records visible to current user. The resulting * Retrieves all user history records visible to current user. User history
* set of user records can be further filtered and ordered using the * records describe the start and end times of user sessions, and correspond
* methods defined on ActivityRecordSet. * 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 * @return
* A set of all user records visible to the current user. * A set of all user records visible to the current user.
@@ -167,7 +171,7 @@ public interface UserContext {
* @throws GuacamoleException * @throws GuacamoleException
* If an error occurs while retrieving the user records. * If an error occurs while retrieving the user records.
*/ */
ActivityRecordSet<UserRecord> getUserHistory() throws GuacamoleException; ActivityRecordSet<ActivityRecord> getUserHistory() throws GuacamoleException;
/** /**
* Retrieves a connection group which can be used to view and manipulate * Retrieves a connection group which can be used to view and manipulate

View File

@@ -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();
}

View File

@@ -27,6 +27,7 @@ import java.util.UUID;
import org.apache.guacamole.GuacamoleException; import org.apache.guacamole.GuacamoleException;
import org.apache.guacamole.form.Form; import org.apache.guacamole.form.Form;
import org.apache.guacamole.net.auth.ActiveConnection; 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.ActivityRecordSet;
import org.apache.guacamole.net.auth.AuthenticationProvider; import org.apache.guacamole.net.auth.AuthenticationProvider;
import org.apache.guacamole.net.auth.Connection; 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.SharingProfile;
import org.apache.guacamole.net.auth.User; import org.apache.guacamole.net.auth.User;
import org.apache.guacamole.net.auth.UserContext; import org.apache.guacamole.net.auth.UserContext;
import org.apache.guacamole.net.auth.UserRecord;
import org.apache.guacamole.protocol.GuacamoleConfiguration; import org.apache.guacamole.protocol.GuacamoleConfiguration;
/** /**
@@ -217,9 +217,9 @@ public class SimpleUserContext implements UserContext {
} }
@Override @Override
public ActivityRecordSet<UserRecord> getUserHistory() public ActivityRecordSet<ActivityRecord> getUserHistory()
throws GuacamoleException { throws GuacamoleException {
return new SimpleActivityRecordSet<UserRecord>(); return new SimpleActivityRecordSet<ActivityRecord>();
} }
@Override @Override