Documentation
¶
Index ¶
- func Action(v string) (string, string)
- func Auth(v bool) (string, bool)
- func Permission(v bool) (string, bool)
- func Required(roles ...string) (string, []string)
- func Resource(v string) (string, string)
- type ApiRegister
- type Checker
- func (c *Checker) Check(r *restful.Request, w *restful.Response, next *restful.FilterChain)
- func (c *Checker) CheckPolicy(r *restful.Request, tk *token.Token, route *endpoint.RouteEntry) error
- func (c *Checker) CheckToken(r *restful.Request) (*token.Token, error)
- func (c *Checker) Init() error
- func (c *Checker) Name() string
- func (c *Checker) Priority() int
- func (c *Checker) ValiateToken(ctx context.Context, in *token.ValiateTokenRequest) (*token.Token, error)
- func (c *Checker) ValidateEndpointPermission(ctx context.Context, in *policy.ValidateEndpointPermissionRequest) (*policy.ValidateEndpointPermissionResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Permission ¶
Types ¶
type ApiRegister ¶
type ApiRegister struct {
ioc.ObjectImpl
}
func GetApiRegister ¶
func GetApiRegister() *ApiRegister
func (*ApiRegister) Init ¶
func (a *ApiRegister) Init() error
func (*ApiRegister) Name ¶
func (c *ApiRegister) Name() string
func (*ApiRegister) Priority ¶
func (i *ApiRegister) Priority() int
func (*ApiRegister) RegistryEndpoint ¶
func (a *ApiRegister) RegistryEndpoint(ctx context.Context, in *endpoint.RegistryEndpointRequest) (*types.Set[*endpoint.Endpoint], error)
注册API接口(RPC --> REST SDK) 自己的 注册API接口 restful client: github.com/go-resty/resty/v2 http://127.0.0.1:8020/api/mcenter/v1/endpoint
type Checker ¶
type Checker struct { ioc.ObjectImpl // contains filtered or unexported fields }
func GetPermissionChecker ¶
func GetPermissionChecker() *Checker
func (*Checker) Check ¶
func (c *Checker) Check(r *restful.Request, w *restful.Response, next *restful.FilterChain)
func (*Checker) CheckPolicy ¶
func (*Checker) ValiateToken ¶
func (*Checker) ValidateEndpointPermission ¶
func (c *Checker) ValidateEndpointPermission(ctx context.Context, in *policy.ValidateEndpointPermissionRequest) (*policy.ValidateEndpointPermissionResponse, error)
查询策略列表 /api/mcenter/v1/permission/check
Click to show internal directories.
Click to hide internal directories.