package
Version:
v0.0.0-...-f4276bb
Opens a new window with list of versions in this module.
Published: Sep 23, 2023
License: MIT
Opens a new window with license information.
Imports: 7
Opens a new window with list of imports.
Imported by: 1
Opens a new window with list of known importers.
Documentation
¶
func NewAuthFilter(service string) restful.FilterFunction
中间件构造函数
func (a *Auth) Filter(
req *restful.Request,
w *restful.Response,
next *restful.FilterChain)
业务功能
- 需要rpc客户端, 采用全局变量来进行设计
- rpc.ValidateToken 来进行鉴权
2.1 token: cookie(web)/header(Authtication)/query(websocket)参数
2.2 校验 成功 pass, 失败: 中断流程 返回认证错误(401)
Source Files
¶
Click to show internal directories.
Click to hide internal directories.