-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Strip the scheme value from the OIDC proxy host #26608
Strip the scheme value from the OIDC proxy host #26608
Conversation
...on/runtime/src/main/java/io/quarkus/keycloak/pep/runtime/KeycloakPolicyEnforcerRecorder.java
Outdated
Show resolved
Hide resolved
...on/runtime/src/main/java/io/quarkus/keycloak/pep/runtime/KeycloakPolicyEnforcerRecorder.java
Outdated
Show resolved
Hide resolved
17961ee
to
266c17a
Compare
adapterConfig.setProxyUrl(oidcConfig.proxy.host.get() + ":" | ||
+ oidcConfig.proxy.port); | ||
String host = oidcConfig.proxy.host.get(); | ||
if (!host.startsWith("http")) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know I'm being a bit pedantic here but I would rather have the test do:
if (!host.startsWith("http://") && !host.startsWith("https://")) {
Because we could imagine someone having a host that is httpfoobar.com
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @gsmet No problems at all, it is worth avoiding any issues like this one, thanks for spotting it
266c17a
to
78d60b4
Compare
Fixes #26577.
As described in #26577, Vertx (Mutiny) Web Client will fail if the proxy host is configured as
http://localhost
- I have confirmed it,UnknownHostException
is reported - withquarkus.oidc
using MutinyWebClient
. Whilequarkus-keycloak-authorization
extendingquarkus-oidc
and sharing the same proxy configuration will fail unless the host is set ashttp://localhost
.So I've done a minor update which 1) strips the
scheme
from a proxyhost
value if thescheme
is set as inhttp://localhost
inOidcCommonUtils
which is used for creatingquarkus-oidc
and alsoquarkus-oidc-client
and 2) addshttp://
to the host value if it is not already there when configuringkeycloak-authorization
.At this moment of time it likely does not really make sense to introduce a
scheme
proxy option as it is not directly taken into account withWebClient
.