auth: complete account authorization flows

(cherry picked from commit 04f4527df32ad5c35720cccc41d27fe51549612f)
This commit is contained in:
A 2026-06-08 21:42:32 +08:00
parent af41d18478
commit 6dc42942c8
21 changed files with 1780 additions and 50 deletions

View file

@ -1,10 +1,13 @@
package domain
import "time"
// Authorization 是一条设备授权:auth_key 与 user 的绑定 + initConnection 设备信息。
// auth_key 是协议产物、授权是业务产物,故独立于 store.AuthKeyData。
type Authorization struct {
AuthKeyID [8]byte // 协议原生 auth_key_id;store 边界按小端转 int64
UserID int64
Hash int64
Layer int
DeviceModel string
Platform string
@ -12,4 +15,6 @@ type Authorization struct {
APIID int
AppVersion string
IP string
CreatedAt time.Time
ActiveAt time.Time
}