Record Class SignedLinkToken
java.lang.Object
java.lang.Record
io.leandev.appfuse.security.link.SignedLinkToken
- Record Components:
subject- 身分識別(不透明字串,如 email / username)purpose- 連結用途(消費端自定義,如passwordless-login/event-action)target- 導向目標(相對路徑,可為 null / 空字串表示預設首頁)attributes- 泛用屬性袋(consume 後原樣取回;不可為 null,缺省為空 Map)jti- JWT ID(SINGLE_USE的單次性鍵)issuedAt- 簽發時間expiresAt- 過期時間redemption- 贖回政策
public record SignedLinkToken(String subject, String purpose, String target, Map<String,Object> attributes, String jti, Instant issuedAt, Instant expiresAt, LinkRedemption redemption)
extends Record
已解析的簽章連結 token
SignedLinkService.consume(String) 驗章成功後回傳的不可變結果,承載連結攜帶的語意:
身分(subject)、用途(purpose)、導向目標(target)與泛用屬性袋(attributes)。
本型別租戶中性:不認得 Account / tenant / email。需要攜帶租戶等應用層脈絡時,
由消費端在 SignedLinkSpec 的 attributes 放入,consume 後原樣取回。
- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theattributesrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.final inthashCode()Returns a hash code value for this object.issuedAt()Returns the value of theissuedAtrecord component.jti()Returns the value of thejtirecord component.purpose()Returns the value of thepurposerecord component.Returns the value of theredemptionrecord component.subject()Returns the value of thesubjectrecord component.target()Returns the value of thetargetrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SignedLinkToken
public SignedLinkToken(String subject, String purpose, String target, Map<String, Object> attributes, String jti, Instant issuedAt, Instant expiresAt, LinkRedemption redemption) Creates an instance of aSignedLinkTokenrecord class.- Parameters:
subject- the value for thesubjectrecord componentpurpose- the value for thepurposerecord componenttarget- the value for thetargetrecord componentattributes- the value for theattributesrecord componentjti- the value for thejtirecord componentissuedAt- the value for theissuedAtrecord componentexpiresAt- the value for theexpiresAtrecord componentredemption- the value for theredemptionrecord 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). -
subject
-
purpose
-
target
-
attributes
Returns the value of theattributesrecord component.- Returns:
- the value of the
attributesrecord component
-
jti
-
issuedAt
-
expiresAt
-
redemption
Returns the value of theredemptionrecord component.- Returns:
- the value of the
redemptionrecord component
-