Record Class SessionPolicyBinding

java.lang.Object
java.lang.Record
io.leandev.appfuse.security.auth.SessionPolicyBinding

public record SessionPolicyBinding(String policy, String reference, Instant validUntil, Set<String> requiredActorAuthorities) extends Record

綁定於 Refresh Session family 的應用政策識別。

框架不解讀 policyreference 的產品語意;它只保證資料隨 family 保存,並在 refresh 時 交給 SessionEligibilityPolicy 重新驗證。validUntil 與 actor 必要權限則屬通用安全不變量, 即使應用未安裝額外 policy hook,框架仍會 fail-closed。

  • Constructor Details

    • SessionPolicyBinding

      public SessionPolicyBinding(String policy, String reference, Instant validUntil, Set<String> requiredActorAuthorities)
      Creates an instance of a SessionPolicyBinding record class.
      Parameters:
      policy - the value for the policy record component
      reference - the value for the reference record component
      validUntil - the value for the validUntil record component
      requiredActorAuthorities - the value for the requiredActorAuthorities record component
    • SessionPolicyBinding

      public SessionPolicyBinding(String policy, String reference, Instant validUntil)
  • Method Details

    • toString

      public final String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      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 with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • policy

      public String policy()
      Returns the value of the policy record component.
      Returns:
      the value of the policy record component
    • reference

      public String reference()
      Returns the value of the reference record component.
      Returns:
      the value of the reference record component
    • validUntil

      public Instant validUntil()
      Returns the value of the validUntil record component.
      Returns:
      the value of the validUntil record component
    • requiredActorAuthorities

      public Set<String> requiredActorAuthorities()
      Returns the value of the requiredActorAuthorities record component.
      Returns:
      the value of the requiredActorAuthorities record component