add support for customizing redirect_uri for IDP (#12607)

This commit is contained in:
Harshavardhana
2021-06-30 16:08:20 -07:00
committed by GitHub
parent a3f0288262
commit 4781e7580b
4 changed files with 28 additions and 11 deletions

View File

@@ -18,10 +18,10 @@
package cmd
import (
"os"
"strings"
"github.com/gorilla/mux"
"github.com/minio/pkg/env"
)
const (
@@ -46,15 +46,13 @@ const (
func registerMetricsRouter(router *mux.Router) {
// metrics router
metricsRouter := router.NewRoute().PathPrefix(minioReservedBucketPath).Subrouter()
authType := strings.ToLower(os.Getenv(EnvPrometheusAuthType))
authType := strings.ToLower(env.Get(EnvPrometheusAuthType, string(prometheusJWT)))
switch prometheusAuthType(authType) {
case prometheusPublic:
metricsRouter.Handle(prometheusMetricsPathLegacy, metricsHandler())
metricsRouter.Handle(prometheusMetricsV2ClusterPath, metricsServerHandler())
metricsRouter.Handle(prometheusMetricsV2NodePath, metricsNodeHandler())
case prometheusJWT:
fallthrough
default:
metricsRouter.Handle(prometheusMetricsPathLegacy, AuthMiddleware(metricsHandler()))
metricsRouter.Handle(prometheusMetricsV2ClusterPath, AuthMiddleware(metricsServerHandler()))
metricsRouter.Handle(prometheusMetricsV2NodePath, AuthMiddleware(metricsNodeHandler()))