GUACAMOLE-393: Add session invalidation hooks to UserContext.

This commit is contained in:
Michael Jumper
2017-05-29 20:52:45 -07:00
parent c20457f89b
commit 45adf2fd93
6 changed files with 31 additions and 0 deletions

View File

@@ -204,4 +204,9 @@ public class SharedUserContext implements UserContext {
return Collections.<Form>emptyList();
}
@Override
public void invalidate() {
// Nothing to invalidate
}
}

View File

@@ -191,4 +191,9 @@ public class ModeledUserContext extends RestrictedObject
return ModeledSharingProfile.ATTRIBUTES;
}
@Override
public void invalidate() {
// Nothing to invalidate
}
}

View File

@@ -229,4 +229,9 @@ public class UserContext implements org.apache.guacamole.net.auth.UserContext {
return Collections.<Form>emptyList();
}
@Override
public void invalidate() {
// Nothing to invalidate
}
}

View File

@@ -212,4 +212,11 @@ public interface UserContext {
*/
Collection<Form> getSharingProfileAttributes();
/**
* Invalidates this user context, releasing all associated resources. This
* function will be invoked when the user logs out, or when their session
* is automatically invalidated.
*/
void invalidate();
}

View File

@@ -234,4 +234,9 @@ public class SimpleUserContext implements UserContext {
return Collections.<Form>emptyList();
}
@Override
public void invalidate() {
// Nothing to invalidate
}
}

View File

@@ -252,6 +252,10 @@ public class GuacamoleSession {
}
}
// Invalidate all user contextx
for (UserContext userContext : userContexts)
userContext.invalidate();
// Invalidate the authenticated user object
authenticatedUser.invalidate();