mirror of
https://github.com/gyurix1968/guacamole-client.git
synced 2025-09-06 05:07:41 +00:00
GUACAMOLE-393: Add session invalidation hooks to UserContext.
This commit is contained in:
@@ -204,4 +204,9 @@ public class SharedUserContext implements UserContext {
|
||||
return Collections.<Form>emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// Nothing to invalidate
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -191,4 +191,9 @@ public class ModeledUserContext extends RestrictedObject
|
||||
return ModeledSharingProfile.ATTRIBUTES;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// Nothing to invalidate
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -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();
|
||||
|
||||
}
|
||||
|
@@ -234,4 +234,9 @@ public class SimpleUserContext implements UserContext {
|
||||
return Collections.<Form>emptyList();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
// Nothing to invalidate
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -252,6 +252,10 @@ public class GuacamoleSession {
|
||||
}
|
||||
}
|
||||
|
||||
// Invalidate all user contextx
|
||||
for (UserContext userContext : userContexts)
|
||||
userContext.invalidate();
|
||||
|
||||
// Invalidate the authenticated user object
|
||||
authenticatedUser.invalidate();
|
||||
|
||||
|
Reference in New Issue
Block a user