Skip to content

[SCIM] make oidc_group_claim and oidc_group_role_sync_strict user-modifiable#36775

Merged
mtabebe merged 1 commit into
MaterializeInc:mainfrom
mtabebe:ma/sso/oidc-vars-user-modifiable
May 29, 2026
Merged

[SCIM] make oidc_group_claim and oidc_group_role_sync_strict user-modifiable#36775
mtabebe merged 1 commit into
MaterializeInc:mainfrom
mtabebe:ma/sso/oidc-vars-user-modifiable

Conversation

@mtabebe
Copy link
Copy Markdown
Contributor

@mtabebe mtabebe commented May 28, 2026

Allow environment superusers to configure OIDC group-sync settings via ALTER SYSTEM SET without needing mz_system access. This is appropriate since these control how a customer's own OIDC claims map to roles.

Fixes SQL-321

@mtabebe mtabebe force-pushed the ma/sso/oidc-vars-user-modifiable branch from 0e5d97c to 4bf8e83 Compare May 28, 2026 19:10
@mtabebe mtabebe marked this pull request as ready for review May 28, 2026 21:29
@mtabebe mtabebe requested a review from jubrad May 28, 2026 21:29
Copy link
Copy Markdown
Contributor

@def- def- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both oidc_group_claim and oidc_grouP_role_sync_strict are dyncfg-backed, and all dyncfgs register with user_visible: false. The ALTER SYSTEM SET authorization path calls var.visible(), which rejects user_visible: false vars for anyone who isn't mz_system/mz_support. So an environment superuser (a Superuser that is not internal) still can't set or use them. Is that intentional?

Reproducer:

$ postgres-connect name=mz_system url=postgres://mz_system:materialize@${testdrive.materialize-internal-sql-addr}

$ postgres-execute connection=mz_system
CREATE ROLE env_superuser SUPERUSER LOGIN;

$ postgres-connect name=env_superuser url=postgres://env_superuser@${testdrive.materialize-sql-addr}

# Control: a user-modifiable + user-visible var works, proving env_superuser is a
# real superuser (not a "must be a superuser" rejection).
$ postgres-execute connection=env_superuser
ALTER SYSTEM SET cluster TO quickstart;

# Regression: fails on the buggy code with "unrecognized configuration parameter".
$ postgres-execute connection=env_superuser
ALTER SYSTEM SET oidc_group_claim = 'my_groups';
ALTER SYSTEM SET oidc_group_role_sync_strict = on;

> SHOW oidc_group_claim
my_groups

> SHOW oidc_group_role_sync_strict
on

Fails with:

>> ALTER SYSTEM SET oidc_group_claim = 'my_groups';
^^^ +++
oidc-group-sync-vars.td:45:1: error: executing postgres query: db error: ERROR: unrecognized configuration parameter "oidc_group_claim"

@mtabebe mtabebe force-pushed the ma/sso/oidc-vars-user-modifiable branch from 4bf8e83 to 36c0a97 Compare May 29, 2026 13:07
@jubrad
Copy link
Copy Markdown
Member

jubrad commented May 29, 2026

Yeah, I though this would work as well, but this should follow the pattern for vars in src/sql/src/session/vars/definitions.rs right?

…ifiable

Allow environment superusers to configure OIDC group-sync settings via
ALTER SYSTEM SET without needing mz_system access. This is appropriate
since these control how a customer's own OIDC claims map to roles.
@mtabebe mtabebe force-pushed the ma/sso/oidc-vars-user-modifiable branch from 36c0a97 to 87e8a2a Compare May 29, 2026 15:04
@mtabebe mtabebe merged commit f5003f4 into MaterializeInc:main May 29, 2026
113 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants