Record Class IamCurrentUser
java.lang.Object
java.lang.Record
com.chaosguide.iam.vertex.context.IamCurrentUser
public record IamCurrentUser(String subject, String applicationId, String email, boolean emailVerified, String username, String organizationId, String organizationSlug, String organizationRole, String workspaceId, String sessionId, Set<String> roles, Set<String> permissions, List<String> authenticationMethods, String authenticationContextClass, IamActor actor, Map<String,Object> claims)
extends Record
Request-local authenticated user from verified JWT claims or an online validated
server session, with authoritative Spring Security permissions.
-
Constructor Summary
ConstructorsConstructorDescriptionIamCurrentUser(String subject, String applicationId, String email, boolean emailVerified, String username, String organizationId, String organizationSlug, String organizationRole, String workspaceId, String sessionId, Set<String> roles, Set<String> permissions, List<String> authenticationMethods, String authenticationContextClass, IamActor actor, Map<String, Object> claims) Creates an instance of aIamCurrentUserrecord class. -
Method Summary
Modifier and TypeMethodDescriptionactor()Returns the value of theactorrecord component.Returns the value of theapplicationIdrecord component.Returns the value of theauthenticationContextClassrecord component.Returns the value of theauthenticationMethodsrecord component.claims()Returns the value of theclaimsrecord component.email()Returns the value of theemailrecord component.booleanReturns the value of theemailVerifiedrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanhasMfa()booleanhasPermission(PermissionKey permission) booleanhasPermission(String resource, String action) booleanReturns the value of theorganizationIdrecord component.Returns the value of theorganizationRolerecord component.Returns the value of theorganizationSlugrecord component.Returns the value of thepermissionsrecord component.roles()Returns the value of therolesrecord component.Returns the value of thesessionIdrecord component.subject()Returns the value of thesubjectrecord component.final StringtoString()Returns a string representation of this record class.userId()Alias for applications that call the actor iduserId.username()Returns the value of theusernamerecord component.Returns the value of theworkspaceIdrecord component.
-
Constructor Details
-
IamCurrentUser
public IamCurrentUser(String subject, String applicationId, String email, boolean emailVerified, String username, String organizationId, String organizationSlug, String organizationRole, String workspaceId, String sessionId, Set<String> roles, Set<String> permissions, List<String> authenticationMethods, String authenticationContextClass, IamActor actor, Map<String, Object> claims) Creates an instance of aIamCurrentUserrecord class.- Parameters:
subject- the value for thesubjectrecord componentapplicationId- the value for theapplicationIdrecord componentemail- the value for theemailrecord componentemailVerified- the value for theemailVerifiedrecord componentusername- the value for theusernamerecord componentorganizationId- the value for theorganizationIdrecord componentorganizationSlug- the value for theorganizationSlugrecord componentorganizationRole- the value for theorganizationRolerecord componentworkspaceId- the value for theworkspaceIdrecord componentsessionId- the value for thesessionIdrecord componentroles- the value for therolesrecord componentpermissions- the value for thepermissionsrecord componentauthenticationMethods- the value for theauthenticationMethodsrecord componentauthenticationContextClass- the value for theauthenticationContextClassrecord componentactor- the value for theactorrecord componentclaims- the value for theclaimsrecord component
-
-
Method Details
-
userId
Alias for applications that call the actor iduserId. -
isImpersonating
public boolean isImpersonating() -
hasMfa
public boolean hasMfa() -
hasPermission
-
hasPermission
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
subject
Returns the value of thesubjectrecord component.- Returns:
- the value of the
subjectrecord component
-
applicationId
Returns the value of theapplicationIdrecord component.- Returns:
- the value of the
applicationIdrecord component
-
email
Returns the value of theemailrecord component.- Returns:
- the value of the
emailrecord component
-
emailVerified
public boolean emailVerified()Returns the value of theemailVerifiedrecord component.- Returns:
- the value of the
emailVerifiedrecord component
-
username
Returns the value of theusernamerecord component.- Returns:
- the value of the
usernamerecord component
-
organizationId
Returns the value of theorganizationIdrecord component.- Returns:
- the value of the
organizationIdrecord component
-
organizationSlug
Returns the value of theorganizationSlugrecord component.- Returns:
- the value of the
organizationSlugrecord component
-
organizationRole
Returns the value of theorganizationRolerecord component.- Returns:
- the value of the
organizationRolerecord component
-
workspaceId
Returns the value of theworkspaceIdrecord component.- Returns:
- the value of the
workspaceIdrecord component
-
sessionId
Returns the value of thesessionIdrecord component.- Returns:
- the value of the
sessionIdrecord component
-
roles
-
permissions
-
authenticationMethods
-
authenticationContextClass
Returns the value of theauthenticationContextClassrecord component.- Returns:
- the value of the
authenticationContextClassrecord component
-
actor
Returns the value of theactorrecord component.- Returns:
- the value of the
actorrecord component
-
claims
-