💥 v2.0 必须更新面板,新增服务监控

This commit is contained in:
naiba
2021-01-16 00:45:49 +08:00
parent 0ce8017875
commit a41c792577
38 changed files with 1015 additions and 453 deletions

View File

@@ -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 {