mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-02-04 12:40:07 +00:00
💥 v2.0 必须更新面板,新增服务监控
This commit is contained in:
@@ -10,23 +10,19 @@ import (
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// AuthHandler ..
|
||||
type AuthHandler struct {
|
||||
ClientID string
|
||||
ClientSecret string
|
||||
}
|
||||
|
||||
// GetRequestMetadata ..
|
||||
func (a *AuthHandler) GetRequestMetadata(ctx context.Context, uri ...string) (map[string]string, error) {
|
||||
return map[string]string{"client_id": a.ClientID, "client_secret": a.ClientSecret}, nil
|
||||
}
|
||||
|
||||
// RequireTransportSecurity ..
|
||||
func (a *AuthHandler) RequireTransportSecurity() bool {
|
||||
return !dao.Conf.Debug
|
||||
}
|
||||
|
||||
// Check ..
|
||||
func (a *AuthHandler) Check(ctx context.Context) (clientID uint64, err error) {
|
||||
md, ok := metadata.FromIncomingContext(ctx)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user