feat: sync multilayer td integration

This commit is contained in:
A 2026-07-15 13:32:06 +08:00
parent 20a310f6ca
commit 766c5db992
491 changed files with 26235 additions and 35340 deletions

View file

@ -10,7 +10,6 @@ import (
type AuthorizationStore interface {
Bind(ctx context.Context, a domain.Authorization) error
ByAuthKey(ctx context.Context, authKeyID [8]byte) (domain.Authorization, bool, error)
UpdateLayer(ctx context.Context, authKeyID [8]byte, layer int) error
// UpdateClientInfo 合并更新已绑定授权的客户端元数据,使设备列表与 auth key 协商事实一致。
UpdateClientInfo(ctx context.Context, authKeyID [8]byte, info domain.AuthKeyClientInfo) error
ListByUser(ctx context.Context, userID int64) ([]domain.Authorization, error)
@ -20,3 +19,12 @@ type AuthorizationStore interface {
// MarkPasswordPassed 清除 auth_key 的 password_pending 标记,使其转为完全授权(两步验证通过后调用)。
MarkPasswordPassed(ctx context.Context, authKeyID [8]byte) error
}
// AuthKeyAuthorityLinker is an optional in-process store-composition boundary.
// Implementations whose auth_keys primary and authorization projection live in
// separate in-memory objects can attach them here so Layer writes update both
// under one state transition. Durable stores normally enforce this inside one
// database transaction and do not implement the hook.
type AuthKeyAuthorityLinker interface {
LinkAuthKeyAuthority(AuthKeyStore)
}