SimpUser exposes Principal

Closes gh-25191
This commit is contained in:
Rossen Stoyanchev
2020-10-19 21:39:48 +01:00
parent 76eb5e6e2c
commit bfb2ce6e2a
4 changed files with 40 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,11 +16,14 @@
package org.springframework.messaging.simp.user;
import java.security.Principal;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.springframework.lang.Nullable;
/**
* @author Rossen Stoyanchev
*/
@@ -41,6 +44,12 @@ public class TestSimpUser implements SimpUser {
return name;
}
@Nullable
@Override
public Principal getPrincipal() {
return null;
}
@Override
public Set<SimpSession> getSessions() {
return new HashSet<>(this.sessions.values());