Record Class LoginActingContributor.ActingLogin

java.lang.Object
java.lang.Record
io.leandev.appfuse.security.auth.LoginActingContributor.ActingLogin
Record Components:
effectivePrincipal - 以合併後權限建立的 UserDetails(需保留原 subject)
grantors - 授權人 stable subject 清單(寫入 grantors claim)
roles - 合併後的直接角色名(ROLE_ 前綴;ADR-024——角色階層展開是 wire 契約,由消費端 wire 組裝層執行,本結果不預先展開)
authorities - 合併後的權限名(供登入回應輸出)
Enclosing interface:
LoginActingContributor

public static record LoginActingContributor.ActingLogin(org.springframework.security.core.userdetails.UserDetails effectivePrincipal, List<String> grantors, List<String> roles, List<String> authorities) extends Record
代行登入的結果。身份仍是登入者本人(sub 不變),只是多了授權人的權限。
  • Constructor Details

    • ActingLogin

      public ActingLogin(org.springframework.security.core.userdetails.UserDetails effectivePrincipal, List<String> grantors, List<String> roles, List<String> authorities)
      Creates an instance of a ActingLogin record class.
      Parameters:
      effectivePrincipal - the value for the effectivePrincipal record component
      grantors - the value for the grantors record component
      roles - the value for the roles record component
      authorities - the value for the authorities record component
  • 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.
    • effectivePrincipal

      public org.springframework.security.core.userdetails.UserDetails effectivePrincipal()
      Returns the value of the effectivePrincipal record component.
      Returns:
      the value of the effectivePrincipal record component
    • grantors

      public List<String> grantors()
      Returns the value of the grantors record component.
      Returns:
      the value of the grantors record component
    • roles

      public List<String> roles()
      Returns the value of the roles record component.
      Returns:
      the value of the roles record component
    • authorities

      public List<String> authorities()
      Returns the value of the authorities record component.
      Returns:
      the value of the authorities record component