K8s: use contexthandler in standalone handler chain (#90102)

This commit is contained in:
Charandas
2024-07-08 12:22:10 -07:00
committed by GitHub
parent 3b6a8775bb
commit c210617735
21 changed files with 203 additions and 88 deletions
+8
View File
@@ -2,6 +2,10 @@ package setting
import "time"
const (
extJWTAccessTokenExpectAudience = "grafana"
)
type AuthJWTSettings struct {
// JWT Auth
Enabled bool
@@ -29,6 +33,7 @@ type ExtJWTSettings struct {
Enabled bool
ExpectIssuer string
JWKSUrl string
Audiences []string
}
func (cfg *Cfg) readAuthExtJWTSettings() {
@@ -36,6 +41,9 @@ func (cfg *Cfg) readAuthExtJWTSettings() {
jwtSettings := ExtJWTSettings{}
jwtSettings.Enabled = authExtendedJWT.Key("enabled").MustBool(false)
jwtSettings.JWKSUrl = authExtendedJWT.Key("jwks_url").MustString("")
// for Grafana, this is hard coded, but we leave it as a configurable param for other use-cases
jwtSettings.Audiences = []string{extJWTAccessTokenExpectAudience}
cfg.ExtJWTAuth = jwtSettings
}