Skip to content

SQL-85 Convert OIDC config into system params#34845

Merged
SangJunBak merged 4 commits intoMaterializeInc:mainfrom
SangJunBak:jun/oidc-config-as-system-params
Feb 20, 2026
Merged

SQL-85 Convert OIDC config into system params#34845
SangJunBak merged 4 commits intoMaterializeInc:mainfrom
SangJunBak:jun/oidc-config-as-system-params

Conversation

@SangJunBak
Copy link
Copy Markdown
Contributor

See commit messages

Start reviewing from Update OIDC tests to use system parameter defaults as config

Motivation

Tips for reviewer

Checklist

  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.

@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch from 4f46b9b to 6013469 Compare January 28, 2026 14:53
@SangJunBak SangJunBak marked this pull request as ready for review January 28, 2026 14:54
@SangJunBak SangJunBak requested a review from a team as a code owner January 28, 2026 14:54
@SangJunBak SangJunBak requested review from ggevay and teskje and removed request for ggevay January 28, 2026 14:54
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch from 6013469 to 4effde6 Compare January 28, 2026 16:56
@SangJunBak SangJunBak requested a review from a team as a code owner January 28, 2026 16:56
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch 3 times, most recently from 72e4912 to c06caf6 Compare February 9, 2026 20:16
@SangJunBak SangJunBak requested a review from ggevay as a code owner February 9, 2026 20:16
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch from c06caf6 to a477778 Compare February 9, 2026 23:17
@SangJunBak SangJunBak removed the request for review from ggevay February 9, 2026 23:18
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch 3 times, most recently from eef5a9e to c589475 Compare February 18, 2026 14:55
@SangJunBak SangJunBak marked this pull request as draft February 18, 2026 15:02
…nfig

- Remove OIDC CLI args
- Initialize oidc authenticator with adapter client to get access to system variables
- Refactor tests to use system parameter default
- Tests the runtime nature of OIDC configuration
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch from c589475 to ed01884 Compare February 18, 2026 15:04
@SangJunBak SangJunBak marked this pull request as ready for review February 18, 2026 15:51
Copy link
Copy Markdown
Contributor

@teskje teskje left a comment

Choose a reason for hiding this comment

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

Looks good, I just have one question/concern about the issuer default and how we behave when no issuer was set.

Comment thread src/authenticator/src/lib.rs Outdated
use mz_frontegg_auth::Authenticator as FronteggAuthenticator;

pub use oidc::{GenericOidcAuthenticator, OidcClaims, OidcConfig, OidcError};
pub use mz_adapter::Client as AdapterClient;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Does this need to be pub? I don't see it used anywhere.

Comment thread src/adapter-types/src/dyncfgs.rs Outdated
/// issued by a dummy application, but from the same identity provider.
pub const OIDC_AUDIENCE: Config<&'static str> = Config::new(
"oidc_audience",
"",
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is it possible to make this an Option, so we remember to handle the case where this wasn't set? Also for OIDC_ISSUER above.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think I chose to make it a &'static str because an Option didn't exist for Config, but I can create one!

Comment thread src/authenticator/src/oidc.rs Outdated
) -> Result<OidcClaims, OidcError> {
// Fetch current OIDC configuration from system variables
let system_vars = self.adapter_client.get_system_vars().await;
let issuer = OIDC_ISSUER.get(system_vars.dyncfgs());
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Here we might get the empty string if this wasn't set before. Probably want to handle that specially to return a proper error?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Can you also add a test for the behavior when trying to authenticate with OIDC without an issuer set?

Copy link
Copy Markdown
Contributor Author

@SangJunBak SangJunBak Feb 19, 2026

Choose a reason for hiding this comment

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

Added a test! Right now it just asserts on "Invalid Password" but I have a future PR that surfaces a more informative error

- Remove pub from AdapterClient
- Add Option<String> as a possible dyncfg type
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch 2 times, most recently from 3c2a49c to fac6923 Compare February 19, 2026 04:05
@SangJunBak SangJunBak requested a review from teskje February 19, 2026 04:25
Copy link
Copy Markdown
Contributor

@teskje teskje left a comment

Choose a reason for hiding this comment

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

LGTM

Comment thread src/authenticator/src/lib.rs Outdated
use mz_frontegg_auth::Authenticator as FronteggAuthenticator;

pub use mz_adapter::Client as AdapterClient;
use mz_adapter::Client as AdapterClient;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nit: Mind putting this up to the non-pub block again?

Comment thread src/authenticator/src/oidc.rs Outdated
Comment on lines +282 to +286
let issuer = if let Some(issuer) = OIDC_ISSUER.get(system_vars.dyncfgs()) {
issuer
} else {
return Err(OidcError::MissingIssuer);
};
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
let issuer = if let Some(issuer) = OIDC_ISSUER.get(system_vars.dyncfgs()) {
issuer
} else {
return Err(OidcError::MissingIssuer);
};
let Some(issuer) = OIDC_ISSUER.get(system_vars.dyncfgs()) else {
return Err(OidcError::MissingIssuer);
};

- Set constants as Option<String> and initializes as None
- Adds test to validate that issuer exists
@SangJunBak SangJunBak force-pushed the jun/oidc-config-as-system-params branch from fac6923 to 54c8ab5 Compare February 19, 2026 22:01
@SangJunBak SangJunBak merged commit f8348f3 into MaterializeInc:main Feb 20, 2026
134 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.

2 participants