SCIM: Add access control for non provisioned users (#103596)

* Add hook to validate access for users based on provisioning logic

* Wire the hook

* Add tests

* declare new variables for errors

* rework the authorization flow for provisioned users

* Add scim feature to testinfra opts

* Grant access if the identity doesn't have associated a user

* skip external uid check for subsequent calls

* Update tests
This commit is contained in:
linoman
2025-04-08 22:50:39 +02:00
committed by GitHub
parent b631d904ae
commit eeb4c045d3
4 changed files with 375 additions and 27 deletions
+7
View File
@@ -494,6 +494,12 @@ func CreateGrafDir(t *testing.T, opts GrafanaOpts) (string, string) {
_, err = pathsSect.NewKey("permitted_provisioning_paths", opts.PermittedProvisioningPaths)
require.NoError(t, err)
}
if opts.EnableSCIM {
scimSection, err := getOrCreateSection("auth.scim")
require.NoError(t, err)
_, err = scimSection.NewKey("user_sync_enabled", "true")
require.NoError(t, err)
}
dbSection, err := getOrCreateSection("database")
require.NoError(t, err)
@@ -558,6 +564,7 @@ type GrafanaOpts struct {
GrafanaComSSOAPIToken string
LicensePath string
EnableRecordingRules bool
EnableSCIM bool
// When "unified-grpc" is selected it will also start the grpc server
APIServerStorageType options.StorageType