1 Star 0 Fork 0

小鱼儿小董子/dongli-kit

加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
auth.go 553 Bytes
一键复制 编辑 原始数据 按行查看 历史
GStones 提交于 2024-06-14 17:19 +08:00 . feat(comment): add code comment (#177)
package utility
import (
"context"
)
// Tag is the type for the auth tag,
type Tag string
func (t Tag) String() string {
return string(t)
}
const WithOutTag Tag = "auth.disabled"
// WithoutAuth overrides the default auth behavior and allows all methods to be called without an access token.
type WithoutAuth struct {
}
// AuthFuncOverride allows all methods to be unauthenticated.
func (w *WithoutAuth) AuthFuncOverride(ctx context.Context, _ string) (context.Context, error) {
ctx = context.WithValue(ctx, WithOutTag, true)
return ctx, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wanjimao/dongli-kit.git
git@gitee.com:wanjimao/dongli-kit.git
wanjimao
dongli-kit
dongli-kit
v0.0.37

搜索帮助