Record Class PolicyEvaluated
java.lang.Object
java.lang.Record
com.svenruppert.jsentinel.audit.PolicyEvaluated
- Record Components:
timestamp- UTC creation time, nevernullsubjectId- subject identifier, ornullfor anonymouspolicyName- non-null policy namedecision- coarse label:"Allowed","Denied", or"StepUpRequired"reason- adapter-neutral diagnostic reason, possibly empty
- All Implemented Interfaces:
AuditEvent
public record PolicyEvaluated(Instant timestamp, String subjectId, String policyName, String decision, String reason)
extends Record
implements AuditEvent
A named
Policy was evaluated against a PolicyContext.
Emitted by RequiresPolicyEvaluator (or any code that runs the
registry directly) in addition to the access-level
AccessGranted / AccessDenied events from the adapter
pipelines. PolicyEvaluated carries the policy name plus a
coarse decision label so consumers can build per-policy dashboards
without re-implementing the decision mapping.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondecision()Returns the value of thedecisionrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of thepolicyNamerecord component.reason()Returns the value of thereasonrecord component.Returns the value of thesubjectIdrecord component.Returns the value of thetimestamprecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PolicyEvaluated
public PolicyEvaluated(Instant timestamp, String subjectId, String policyName, String decision, String reason) Creates an instance of aPolicyEvaluatedrecord class.- Parameters:
timestamp- the value for thetimestamprecord componentsubjectId- the value for thesubjectIdrecord componentpolicyName- the value for thepolicyNamerecord componentdecision- the value for thedecisionrecord componentreason- the value for thereasonrecord 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). -
timestamp
Returns the value of thetimestamprecord component.- Specified by:
timestampin interfaceAuditEvent- Returns:
- the value of the
timestamprecord component
-
subjectId
-
policyName
Returns the value of thepolicyNamerecord component.- Returns:
- the value of the
policyNamerecord component
-
decision
-
reason
-