feat: show application ownership and scoped console management

This commit is contained in:
2026-09-27 12:12:46 +08:00
parent ed17713ea1
commit 1f2e7230dc
26 changed files with 757 additions and 47 deletions

View File

@@ -0,0 +1,21 @@
package consoleauth
import (
"context"
core "git.yuntuo.hk/k2safe/orbit/model"
"git.yuntuo.hk/k2safe/orbit/platform/auth"
)
// Scope 是当前查看范围的脱敏元数据。队列分页独立于应用分页。
type Scope struct {
Entry ApplicationEntry `json:"entry"` // Entry 数据库核实的应用、环境和命名空间。
Queues []AccessQueue `json:"queues"` // Queues 本页授权队列,最多 100 项。
Next core.ID `json:"next,omitempty"` // Next 下一页队列排他起点。
CanSwitch bool `json:"can_switch"` // CanSwitch 仅部署指定的管理员可以切换应用。
}
// Scopes 只供登录 Cookie 使用,SDK 不具备范围切换接口。
type Scopes interface {
ResolveScope(context.Context, auth.Token, core.ID) (auth.Token, error)
GetScope(context.Context, auth.Token, core.ID) (Scope, error)
}