Enum Class LinkRedemption
- All Implemented Interfaces:
Serializable, Comparable<LinkRedemption>, Constable
簽章連結的贖回政策
決定一張 SignedLinkToken 在有效期內可被消費幾次,以及消費時是否需要
查詢 SignedLinkStore。
- Since:
- 1.0
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionstatic LinkRedemptionReturns the enum constant of this class with the specified name.static LinkRedemption[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
SINGLE_USE
單次使用:簽章 + 未過期 + jti 原子消費。
第一次
consume成功後即失效(jti 自 store 移除),再次消費丟出VerificationException。適用於免密碼登入、 session 換發 code 等「用過即廢」的連結。消費時會查詢並更新 store。 -
REUSABLE
可重複使用(僅時間保護):簽章 + 未過期即有效。
在 TTL 視窗內可被多次消費,純 stateless JWT,不查詢 store。適用於事件 通知深連結等「使用者可能先點開瞭解、稍後再點處理」的情境;「同一動作不可 重複執行」應由目標資源自身的狀態把關,不是連結的責任。
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-