Skip to content

Commit 3d16c1d

Browse files
merllJehoszafat Zimnowoda
and
Jehoszafat Zimnowoda
authored
feat: adjustments to Grafana team permissions (#1563)
Co-authored-by: Jehoszafat Zimnowoda <[email protected]>
1 parent d0738e6 commit 3d16c1d

File tree

4 files changed

+9
-2
lines changed

4 files changed

+9
-2
lines changed

Diff for: helmfile.d/helmfile-60.teams.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ releases:
108108
nameOverride: {{ $teamId }}-po-grafana
109109
fullnameOverride: {{ $teamId }}-po-grafana
110110
grafana.ini:
111+
"auth.generic_oauth":
112+
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin' || contains(groups[*], 'team-{{ $teamId }}') && 'Editor'{{ if not ($team | get "managedMonitoring.private" false) }} || 'Viewer'{{- end }}
111113
server:
112114
root_url: https://grafana-{{ $teamId }}.{{ $domain }}
113115
sidecar:

Diff for: helmfile.d/snippets/grafana.gotmpl

+3-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111
auth_url: {{ printf "%s/protocol/openid-connect/auth" .keycloakBase }}
1212
token_url: {{ printf "%s/protocol/openid-connect/token" .keycloakBase }}
1313
api_url: {{ printf "%s/protocol/openid-connect/userinfo" .keycloakBase }}
14-
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin' || 'Editor'
14+
role_attribute_path: contains(groups[*], 'admin') && 'Admin' || contains(groups[*], 'team-admin') && 'Admin'
15+
role_attribute_strict: true
1516
log:
1617
level: error
1718
users:
18-
allow_sign_up: true
19+
allow_sign_up: false
1920
auto_assign_org: true
2021
# fall back to admin for anonymous when no auth is available
2122
auto_assign_org_role: Viewer

Diff for: values-changes.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,7 @@ changes:
125125
- version: 20
126126
networkPoliciesMigration: true
127127
additions:
128+
- 'teamConfig.{team}.managedMonitoring.private': true
128129
- 'apps.loki.storage.gcs.serviceAccount'
129130
deletions:
130131
- 'apps.loki.storage.gcs.project'

Diff for: values-schema.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1246,6 +1246,9 @@ definitions:
12461246
alertmanager:
12471247
type: boolean
12481248
default: false
1249+
private:
1250+
type: boolean
1251+
default: false
12491252
networkPolicy:
12501253
ingressPrivate:
12511254
title: Enable filtering of ingress traffic inside the cluster

0 commit comments

Comments
 (0)