-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Add createdTime
field to SessionInformation
#17513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -133,7 +133,9 @@ public void registerNewSession(String sessionId, Object principal) { | |
if (this.logger.isDebugEnabled()) { | ||
this.logger.debug(LogMessage.format("Registering session %s, for principal %s", sessionId, principal)); | ||
} | ||
this.sessionIds.put(sessionId, new SessionInformation(principal, sessionId, new Date())); | ||
Date currentDate = new Date(); | ||
this.sessionIds.put(sessionId, new SessionInformation(principal, sessionId, new Date(currentDate.getTime()), | ||
new Date(currentDate.getTime()))); | ||
Comment on lines
+136
to
+138
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think that's okay, since we wouldn't want to have a link to the same Date? |
||
this.principals.compute(principal, (key, sessionsUsedByPrincipal) -> { | ||
if (sessionsUsedByPrincipal == null) { | ||
sessionsUsedByPrincipal = new CopyOnWriteArraySet<>(); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,7 +46,11 @@ public class OidcSessionInformation extends SessionInformation { | |
* @param user the OIDC Provider's session and end user | ||
*/ | ||
public OidcSessionInformation(String sessionId, Map<String, String> authorities, OidcUser user) { | ||
super(user, sessionId, new Date()); | ||
this(sessionId, authorities, user, new Date()); | ||
} | ||
|
||
private OidcSessionInformation(String sessionId, Map<String, String> authorities, OidcUser user, Date now) { | ||
super(user, sessionId, new Date(now.getTime()), new Date(now.getTime())); | ||
this.authorities = (authorities != null) ? new LinkedHashMap<>(authorities) : Collections.emptyMap(); | ||
} | ||
Comment on lines
48
to
55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is the only way to solve the problem I wrote about here #17513 (comment) |
||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that
SessionInformation
is created inSessionRegistry
, so we don't need to maintain backward compatibility, right?