Record Class AuthorizationDecision
java.lang.Object
java.lang.Record
org.j7m.middleware.security.api.AuthorizationDecision
- Record Components:
allowed- whether request is allowedauthenticatedRequired- whether authentication was required and missingpolicyId- policy idreason- safe decision reasonmetadata- public decision metadata
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthorizationDecisionReturns an allow decision.booleanallowed()Returns the value of theallowedrecord component.booleanReturns the value of theauthenticatedRequiredrecord component.static AuthorizationDecisionReturns a deny decision.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.policyId()Returns the value of thepolicyIdrecord component.reason()Returns the value of thereasonrecord component.final StringtoString()Returns a string representation of this record class.static AuthorizationDecisionunauthenticated(String policyId, String reason) Returns an unauthenticated decision.
-
Constructor Details
-
AuthorizationDecision
-
-
Method Details
-
allow
Returns an allow decision.- Parameters:
policyId- policy id- Returns:
- allow decision
-
deny
Returns a deny decision.- Parameters:
policyId- policy idreason- safe denial reason- Returns:
- deny decision
-
unauthenticated
Returns an unauthenticated decision.- Parameters:
policyId- policy idreason- safe denial reason- Returns:
- unauthenticated decision
-
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. -
allowed
-
authenticatedRequired
public boolean authenticatedRequired()Returns the value of theauthenticatedRequiredrecord component.- Returns:
- the value of the
authenticatedRequiredrecord component
-
policyId
-
reason
-
metadata
-