Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add OIDC Client config builder #44697

Merged

Conversation

michalvavrik
Copy link
Member

@michalvavrik michalvavrik commented Nov 25, 2024

  • part of the Migrate OIDC-based extensions from config classes to @ConfigMapping #39185
  • introduce new OIDC Client config builder and deprecate former config class
  • is backwards compatible - users can keep using old OidcClientConfig as now the class implements the configmapping group interface, so users can still do oidcClients.newClient(formerConfigClass) while we migrated to the config mapping; that should reduce copying between config mapping interfaces and config classes
  • improves generated docs as number of config properties is reduced (we show both named and unnamed client in one row, which is what was already done for the OIDC extension here Improve the way OIDC tenants are grouped and their properties are generated #44374)
  • because we cannot modify interfaces impl. returned by SmallRye Config, I added config builder that makes sure that id is set if user didn't specify it explicitly. In past, we set this config class property inside of the recorder, but now it needs to be set bit sooner; situation shouldn't change for users though

@quarkus-bot quarkus-bot bot added area/docstyle issues related for manual docstyle review area/documentation area/keycloak labels Nov 25, 2024

This comment has been minimized.

Copy link

github-actions bot commented Nov 25, 2024

🙈 The PR is closed and the preview is expired.

This comment has been minimized.

@michalvavrik michalvavrik force-pushed the feature/add-oidc-client-config-builder branch from a2a407d to 8023081 Compare November 25, 2024 22:22

This comment has been minimized.

This comment has been minimized.

@michalvavrik
Copy link
Member Author

michalvavrik commented Nov 26, 2024

I mentioned I made mistake in one test so it didn't test what I wanted. I'll push in a minute. UPDATE: done

@michalvavrik michalvavrik force-pushed the feature/add-oidc-client-config-builder branch from 8023081 to d66c643 Compare November 26, 2024 09:22

This comment has been minimized.

@sberyozkin
Copy link
Member

Hi @michalvavrik, thanks, as far as the builder is concerned, did you follow the same pattern you did for the OIDC dynamic client config, where the whole OIDC client can be built with a single sequence, with sub-config-mappings having their own builders, which can be used independently and then plugged into into the main sequence or used inside that sequence with .end() ?

@sberyozkin
Copy link
Member

Hi @michalvavrik, thanks, as far as the builder is concerned, did you follow the same pattern you did for the OIDC dynamic client config, where the whole OIDC client can be built with a single sequence, with sub-config-mappings having their own builders, which can be used independently and then plugged into into the main sequence or used inside that sequence with .end() ?

Looks like it is the case, sound good

@michalvavrik
Copy link
Member Author

Hi @michalvavrik, thanks, as far as the builder is concerned, did you follow the same pattern you did for the OIDC dynamic client config, where the whole OIDC client can be built with a single sequence, with sub-config-mappings having their own builders, which can be used independently and then plugged into into the main sequence or used inside that sequence with .end() ?

Looks like it is the case, sound good

Yes, I believe so. And I added many shortcuts, but these things are quite opinionated, please let me know if you want another methods added to the builder. Thanks

@sberyozkin
Copy link
Member

@michalvavrik As far as shortcuts are concerned, we can add them more if we notice users have to type some sub-optimal code, the important thing is that they have options how to structure the complete build sequence, without having a single flat builder to set everything

@michalvavrik
Copy link
Member Author

@michalvavrik As far as shortcuts are concerned, we can add them more if we notice users have to type some sub-optimal code, the important thing is that they have options how to structure the complete build sequence, without having a single flat builder to set everything

I am just working on it. Will push it soon.

@michalvavrik michalvavrik force-pushed the feature/add-oidc-client-config-builder branch from d66c643 to 5a51c3a Compare November 27, 2024 13:32
Copy link

quarkus-bot bot commented Nov 27, 2024

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit 5a51c3a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

Copy link

quarkus-bot bot commented Nov 27, 2024

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit 5a51c3a.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@michalvavrik
Copy link
Member Author

btw I have checked https://quarkus-pr-main-44697-preview.surge.sh/version/main/guides/all-config with "quarkus.oidc-client." and it looks fine (javadoc there).

Copy link
Member

@sberyozkin sberyozkin left a comment

Choose a reason for hiding this comment

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

Thanks @michalvavrik, all is ready for the last one :-), thanks very much

@sberyozkin sberyozkin merged commit d4cbdb2 into quarkusio:main Nov 28, 2024
26 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.18 - main milestone Nov 28, 2024
@michalvavrik michalvavrik deleted the feature/add-oidc-client-config-builder branch November 28, 2024 18:06
@michalvavrik
Copy link
Member Author

Thanks @michalvavrik, all is ready for the last one :-), thanks very much

that's already WIP, looking forward to finishing it in a day or two. until then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants