Files
orbit/internal/consoleauth/scope.go

23 lines
895 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 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)
}