mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-05 21:20:06 +00:00
feat: 去除 webTerminal 的 websocket 依赖
This commit is contained in:
@@ -10,19 +10,19 @@ import (
|
||||
"github.com/naiba/nezha/service/singleton"
|
||||
)
|
||||
|
||||
type AuthHandler struct {
|
||||
type authHandler struct {
|
||||
ClientSecret string
|
||||
}
|
||||
|
||||
func (a *AuthHandler) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
|
||||
func (a *authHandler) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
|
||||
return map[string]string{"client_secret": a.ClientSecret}, nil
|
||||
}
|
||||
|
||||
func (a *AuthHandler) RequireTransportSecurity() bool {
|
||||
func (a *authHandler) RequireTransportSecurity() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (a *AuthHandler) Check(ctx context.Context) (uint64, error) {
|
||||
func (a *authHandler) Check(ctx context.Context) (uint64, error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
return 0, status.Errorf(codes.Unauthenticated, "获取 metaData 失败")
|
||||
|
||||
Reference in New Issue
Block a user