-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 quarkus.oidc.proxy config #8120
Conversation
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java
Show resolved
Hide resolved
@DEVisions Many thanks for this PR, minor updates are suggested, cheers |
@sberyozkin Many thanks for the feedback, Sergey! Changes submitted. I hope it's ok now. |
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcRecorder.java
Outdated
Show resolved
Hide resolved
@DEVisions It all looks perfect to me now, as far as I recall the curly braces should be used all the time, so please tweak that and it should be ready to go. |
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
@sberyozkin We should be good now, right? 😊 Thanks |
Please squash your commits into a single one |
Hi @DEVisions It looks nice and ready to go :-), one more thing, @stuartwdouglas recommends avoiding using lambdas in the recorder in general due to them being a bit suboptimal. Can you please give me a favour and update that And squash as George has said. |
Hi @sberyozkin , Sure. You mean like this: private ProxyOptions toProxyOptions(OidcTenantConfig.Proxy proxyConfig) {
JsonObject jsonOptions = new JsonObject();
jsonOptions.put("host", proxyConfig.host.get());
jsonOptions.put("port", proxyConfig.port.getAsInt());
if (proxyConfig.username.isPresent()) {
jsonOptions.put("username", proxyConfig.username.get());
}
if (proxyConfig.password.isPresent()) {
jsonOptions.put("password", proxyConfig.password.get());
}
return new ProxyOptions(jsonOptions);
} And I'll try to do the squashing now... |
Be aware that host and port are optional too |
Perhaps it's better to move the optional checks from the Recorder class to this method. I forgot you were performing the optional test there |
It would be nice to also have a small unit test to ensure that this method works |
@gastaldi George, if both host and port are optional, therefore we "enable" the proxy if at least "host" is being defined in the config? Sure, I'll include a unit test for |
Yes, that makes sense, and make sure to set a default value of |
@DEVisions @gastaldi so if we move the optional checks out of OidcRecorder to this method then setting a host is enough (with a default |
@sberyozkin Actually, the enablement is done in Optional<ProxyOptions> proxyOpt = toProxyOptions(oidcConfig.getProxy());
if (proxyOpt.isPresent()) {
options.setProxyOptions(proxyOpt.get());
} And the rules are now moved into Submitted the updates, including a unit test. |
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
extensions/oidc/runtime/src/main/java/io/quarkus/oidc/runtime/OidcTenantConfig.java
Outdated
Show resolved
Hide resolved
|
@DEVisions, nearly there :-), can you please do |
@sberyozkin Done! Are we there? |
@DEVisions Hope so :-), it is already approved |
@DEVisions thanks for your PR. It will only be available in |
@sberyozkin @gastaldi Thank you both for the support and quick feedback! |
One addition to
oidc
extension: ability to use a proxy for talking with OIDC provider.The following configuration items were added and can be used for this purpose:
quarkus.oidc.proxy.host
quarkus.oidc.proxy.port
quarkus.oidc.proxy.username
quarkus.oidc.proxy.password
(update: ignored for now)quarkus.oidc.proxy.type
This refers to issue 8088.
Waiting for Quarkus team review and feedback.
Thanks.