Package ai.mindconnect.common
Record Class AuthenticationInfo
java.lang.Object
java.lang.Record
ai.mindconnect.common.AuthenticationInfo
public record AuthenticationInfo(String userId, Namespace namespace, List<String> roles)
extends Record
Carries the authenticated user's identity and authorization context.
Server-internal domain object — derived at the transport boundary (e.g. by a Spring
Security filter that converts an Authentication into this), then passed
explicitly to ports and services. Never put on the wire and never set by clients;
clients authenticate using standard transport mechanisms (Bearer tokens, OAuth).
-
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationInfo(String userId, Namespace namespace, List<String> roles) Creates an instance of aAuthenticationInforecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thenamespacerecord component.static AuthenticationInfostatic AuthenticationInforoles()Returns the value of therolesrecord component.final StringtoString()Returns a string representation of this record class.userId()Returns the value of theuserIdrecord component.
-
Constructor Details
-
AuthenticationInfo
Creates an instance of aAuthenticationInforecord class.- Parameters:
userId- the value for theuserIdrecord componentnamespace- the value for thenamespacerecord componentroles- the value for therolesrecord component
-
-
Method Details
-
of
-
of
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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). -
userId
Returns the value of theuserIdrecord component.- Returns:
- the value of the
userIdrecord component
-
namespace
Returns the value of thenamespacerecord component.- Returns:
- the value of the
namespacerecord component
-
roles
Returns the value of therolesrecord component.- Returns:
- the value of the
rolesrecord component
-