Record Class AuthAccount
java.lang.Object
java.lang.Record
com.cloudforge.core.manager.auth.AuthAccount
public record AuthAccount(String id, String username, String email, String displayName, String role, String authSource, Boolean enabled, String status, String linkedAccountId, String temporaryPassword, Instant firstSeenAt, Instant lastSeenAt, Instant lastLoginAt, Integer activeSessionCount)
extends Record
A CloudForge Manager user-directory account, as seen through
AuthBackend — a typed
stand-in for what used to be an ad-hoc Map<String,Object> built by hand in two different
shapes (one for local rows, one for Cognito pool users). Several fields are only meaningful for
one backend and null for the other, rather than every implementation needing to invent a
value for a concept it doesn't have:
enabled/status— Cognito-only (account enable state / Cognito'sUserStatus, e.g."CONFIRMED"); alwaysnullfor local accounts.firstSeenAt/lastSeenAt/lastLoginAt— local-only; alwaysnullfor Cognito accounts (Manager keeps no local row for the timestamps themselves).activeSessionCountis populated for both backends — a Cognito-authenticated login still gets a real Manager-tracked session (seeCognitoAuthBackend's own javadoc), so it'snullonly when a backend genuinely can't determine it, not by backend type.linkedAccountId— the counterpart account'sid()in the *other* backend, when this account was created by (or has since been linked during) a migration;nullotherwise. SeeAuthBackendMigrationServicefor how this avoids creating duplicate accounts on a later re-migration.temporaryPassword— only ever populated on theAuthAccountanAuthBackend#createAccountcall returns, never on one fromlistAccounts(); a generated credential is shown exactly once.
-
Constructor Summary
ConstructorsConstructorDescriptionAuthAccount(String id, String username, String email, String displayName, String role, String authSource, Boolean enabled, String status, String linkedAccountId, String temporaryPassword, Instant firstSeenAt, Instant lastSeenAt, Instant lastLoginAt, Integer activeSessionCount) Creates an instance of aAuthAccountrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theactiveSessionCountrecord component.Returns the value of theauthSourcerecord component.Returns the value of thedisplayNamerecord component.email()Returns the value of theemailrecord component.enabled()Returns the value of theenabledrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of thefirstSeenAtrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of thelastLoginAtrecord component.Returns the value of thelastSeenAtrecord component.Returns the value of thelinkedAccountIdrecord component.role()Returns the value of therolerecord component.status()Returns the value of thestatusrecord component.Returns the value of thetemporaryPasswordrecord component.final StringtoString()Returns a string representation of this record class.username()Returns the value of theusernamerecord component.
-
Constructor Details
-
AuthAccount
public AuthAccount(String id, String username, String email, String displayName, String role, String authSource, Boolean enabled, String status, String linkedAccountId, String temporaryPassword, Instant firstSeenAt, Instant lastSeenAt, Instant lastLoginAt, Integer activeSessionCount) Creates an instance of aAuthAccountrecord class.- Parameters:
id- the value for theidrecord componentusername- the value for theusernamerecord componentemail- the value for theemailrecord componentdisplayName- the value for thedisplayNamerecord componentrole- the value for therolerecord componentauthSource- the value for theauthSourcerecord componentenabled- the value for theenabledrecord componentstatus- the value for thestatusrecord componentlinkedAccountId- the value for thelinkedAccountIdrecord componenttemporaryPassword- the value for thetemporaryPasswordrecord componentfirstSeenAt- the value for thefirstSeenAtrecord componentlastSeenAt- the value for thelastSeenAtrecord componentlastLoginAt- the value for thelastLoginAtrecord componentactiveSessionCount- the value for theactiveSessionCountrecord component
-
-
Method Details
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
displayName
Returns the value of thedisplayNamerecord component.- Returns:
- the value of the
displayNamerecord component
-
role
Returns the value of therolerecord component.- Returns:
- the value of the
rolerecord component
-
authSource
Returns the value of theauthSourcerecord component.- Returns:
- the value of the
authSourcerecord component
-
enabled
Returns the value of theenabledrecord component.- Returns:
- the value of the
enabledrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
linkedAccountId
Returns the value of thelinkedAccountIdrecord component.- Returns:
- the value of the
linkedAccountIdrecord component
-
temporaryPassword
Returns the value of thetemporaryPasswordrecord component.- Returns:
- the value of the
temporaryPasswordrecord component
-
firstSeenAt
Returns the value of thefirstSeenAtrecord component.- Returns:
- the value of the
firstSeenAtrecord component
-
lastSeenAt
Returns the value of thelastSeenAtrecord component.- Returns:
- the value of the
lastSeenAtrecord component
-
lastLoginAt
Returns the value of thelastLoginAtrecord component.- Returns:
- the value of the
lastLoginAtrecord component
-
activeSessionCount
Returns the value of theactiveSessionCountrecord component.- Returns:
- the value of the
activeSessionCountrecord component
-