IDForwarding: Update settings name (#77257)

Update settings name
This commit is contained in:
Karl Persson 2023-10-27 10:20:49 +02:00 committed by GitHub
parent 45bcbff115
commit bc9fab6f30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -22,7 +22,7 @@ type IDClaims struct {
jwt.Claims
}
const settingsKey = "forwardIdToken"
const settingsKey = "forwardGrafanaIdToken"
func IsIDForwardingEnabledForDataSource(ds *datasources.DataSource) bool {
return ds.JsonData != nil && ds.JsonData.Get(settingsKey).MustBool()

View File

@ -18,12 +18,12 @@ import (
func TestForwardIDMiddleware(t *testing.T) {
settingWithEnabled, err := json.Marshal(map[string]any{
"forwardIdToken": true,
"forwardGrafanaIdToken": true,
})
require.NoError(t, err)
settingWithDisabled, err := json.Marshal(map[string]any{
"forwardIdToken": false,
"forwardGrafanaIdToken": false,
})
require.NoError(t, err)