Secrets: Add route for secrets UI (#111161)

Add secrets route
This commit is contained in:
Tobias Skarhed 2025-09-16 13:00:37 +02:00 committed by GitHub
parent 1f1f2ae18f
commit bf31c67159
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 0 deletions

View File

@ -38,6 +38,7 @@ import (
"github.com/grafana/grafana/pkg/api/routing" "github.com/grafana/grafana/pkg/api/routing"
"github.com/grafana/grafana/pkg/middleware" "github.com/grafana/grafana/pkg/middleware"
"github.com/grafana/grafana/pkg/middleware/requestmeta" "github.com/grafana/grafana/pkg/middleware/requestmeta"
"github.com/grafana/grafana/pkg/registry/apis/secret"
ac "github.com/grafana/grafana/pkg/services/accesscontrol" ac "github.com/grafana/grafana/pkg/services/accesscontrol"
"github.com/grafana/grafana/pkg/services/accesscontrol/ssoutils" "github.com/grafana/grafana/pkg/services/accesscontrol/ssoutils"
"github.com/grafana/grafana/pkg/services/auth" "github.com/grafana/grafana/pkg/services/auth"
@ -129,6 +130,14 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/admin/featuretoggles", authorize(ac.EvalPermission(ac.ActionFeatureManagementRead)), hs.Index) r.Get("/admin/featuretoggles", authorize(ac.EvalPermission(ac.ActionFeatureManagementRead)), hs.Index)
} }
// secrets management page
if hs.Features.IsEnabledGlobally(featuremgmt.FlagSecretsManagementAppPlatform) && hs.Features.IsEnabledGlobally(featuremgmt.FlagSecretsManagementAppPlatformUI) {
r.Get("/admin/secrets", authorize(ac.EvalAny(
ac.EvalPermission(secret.ActionSecretSecureValuesCreate),
ac.EvalPermission(secret.ActionSecretSecureValuesRead),
)), hs.Index)
}
r.Get("/styleguide", reqSignedIn, hs.Index) r.Get("/styleguide", reqSignedIn, hs.Index)
r.Get("/live", reqGrafanaAdmin, hs.Index) r.Get("/live", reqGrafanaAdmin, hs.Index)