GUACAMOLE-1723: Simplify active window check; do not refresh from DB during active sessions.

This commit is contained in:
James Muehlner
2022-12-02 04:35:56 +00:00
parent 18d971a837
commit 89945caa5f
22 changed files with 123 additions and 432 deletions

View File

@@ -162,4 +162,9 @@ public class DelegatingUserContext implements UserContext {
return userContext.getPrivileged();
}
@Override
public boolean isValid() {
return userContext.isValid();
}
}

View File

@@ -40,6 +40,27 @@ public interface UserContext {
*/
User self();
/**
* Returns true if the session for the User associated with this user
* context is valid, or false otherwise. If the session is not valid,
* the webapp can be expected to terminate the session within a short
* period of time.
*
* NOTE: The webapp currently checks once a minute, and terminates any
* session marked as invalid.
*
* @return
* true if the session for the User associated with this user
* context is valid, or false otherwise.
*/
default boolean isValid() {
// A user context is always valid unless explicitly updated by an
// implementation
return true;
}
/**
* Returns an arbitrary REST resource representing this UserContext. The
* REST resource returned must be properly annotated with JSR-311