owpengram-server/internal/domain/authorization.go

23 lines
823 B
Go
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

package domain
import "time"
// Authorization 是一条设备授权auth_key 与 user 的绑定 + initConnection 设备信息。
// auth_key 是协议产物、授权是业务产物,故独立于 store.AuthKeyData。
type Authorization struct {
AuthKeyID [8]byte // 协议原生 auth_key_idstore 边界按小端转 int64
UserID int64
Hash int64
Layer int
DeviceModel string
Platform string
SystemVersion string
APIID int
AppVersion string
IP string
// PasswordPending 表示该 auth_key 已通过短信验证码、但账号开启了两步验证且尚未通过
// auth.checkPassword。此状态下业务鉴权须视其为未登录仅允许继续完成两步验证。
PasswordPending bool
CreatedAt time.Time
ActiveAt time.Time
}