Package io.camunda.security.auth
Record Class SecurityContext
java.lang.Object
java.lang.Record
io.camunda.security.auth.SecurityContext
public record SecurityContext(CamundaAuthentication authentication, Authorization<?> authorization)
extends Record
Represents the security context for the current operation, containing both authentication and
authorization information. It encapsulates the user's identity, group and tenant affiliations,
along with the permissions that need to be checked for the current operation.
Note: For now, we only support a single authorization check. This will be later extended to more than one authorization (for composite permissions checks).
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionSecurityContext(CamundaAuthentication authentication, Authorization<?> authorization) Creates an instance of aSecurityContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theauthenticationrecord component.Returns the value of theauthorizationrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static SecurityContextof(Function<SecurityContext.Builder, SecurityContext.Builder> builderFunction) final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SecurityContext
Creates an instance of aSecurityContextrecord class.- Parameters:
authentication- the value for theauthenticationrecord componentauthorization- the value for theauthorizationrecord component
-
-
Method Details
-
of
public static SecurityContext of(Function<SecurityContext.Builder, SecurityContext.Builder> builderFunction) -
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). -
authentication
Returns the value of theauthenticationrecord component.- Returns:
- the value of the
authenticationrecord component
-
authorization
Returns the value of theauthorizationrecord component.- Returns:
- the value of the
authorizationrecord component
-