TokenData

@Serializable
data class TokenData(val accessToken: String, val apiKey: String, val expiresIn: Int, val tokenType: String, val appId: String? = null, val grants: List<String>? = null, val refresh: TokenRefreshInfo? = null)

令牌数据,包含访问令牌信息(签名交换接口返回)。

Parameters

accessToken

访问令牌,用于 Authorization: Bearer 认证头

apiKey

API 密钥,用于 X-Api-Key 认证头

expiresIn

令牌有效期(秒)

tokenType

令牌类型,通常为 "Bearer"

appId

应用 ID(格式 vap_xxxx),与 VDS 文档中的 appId 等价

grants

授权的权限范围列表

refresh

可选的令牌刷新信息

Constructors

Link copied to clipboard
constructor(accessToken: String, apiKey: String, expiresIn: Int, tokenType: String, appId: String? = null, grants: List<String>? = null, refresh: TokenRefreshInfo? = null)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
@SerialName(value = "appId")
val appId: String?
Link copied to clipboard
@SerialName(value = "expiresInSeconds")
val expiresIn: Int
Link copied to clipboard
@SerialName(value = "grants")
val grants: List<String>?
Link copied to clipboard
@SerialName(value = "refresh")
val refresh: TokenRefreshInfo?
Link copied to clipboard

Functions

Link copied to clipboard

将签名交换令牌数据转换为 TokenInfo。