-
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
quarkus-rest-client-reactive-jackson removing credentials from URIs and URLs #30289
Comments
/cc @Sgitario(rest-client), @cescoffier(rest-client), @geoand(jackson,rest-client), @gsmet(jackson) |
Does the same happen with Quarkus |
Hey @geoand, I have just tried and it also happens with |
Thanks for checking. We will have a look soon |
Would you mind uploading a sample so we can use it for testing? |
@geoand here's the minimum code to reproduce the bug => https://github.com/Cs4r/quarkus-rest-client-bug If you run the test named Request:
Please observe that POSTed URL lacks username and password, as it should be Response
|
Thank you |
Probably a good idea to check we don't convert that to basic authentication headers. i know some layers are doing that automatically. |
@gsmet according to the logs it seems it doesn't transform the |
I'll try and have a look tomorrow |
#30344 takes care of the issue |
Support URIs userInfo data in REST Client Reactive
Fixes: quarkusio#30289 (cherry picked from commit 27752d2)
Describe the bug
The
quarkus-rest-client-reactive-jackson
is not properly handling URIs that contain a username and password. When making a request to such a URI, the username and password are being removed from the URI, resulting in the request failing due to authentication issues.PD: It's also happening when using URLs:
RestClientBuilder.newBuilder().baseUrl(urlToInvoke)...build();
Expected behavior
The POST request should be made to the URI "https://USER:[email protected]:23090/topics/topic-name" and include the username and password in the URI.
Actual behavior
The request is made to the URI "https://public-develop-company-dev.cloud.com:23090/topics/topic-name" hence the username and password are removed from the URI
How to Reproduce?
RestClientBuilder.newBuilder().baseUri(uriToInvoke)...build();
) to create a new client and set the base URI to a URI that includes a username and password, such as "https://USER:[email protected]:23090/topics/topic-name".Quarkus version or git rev
2.12.0.CR1 and 2.15.2.Final
Additional information
As seen in the provided log below, got using the following application properties:
the quarkus-rest-client-reactive-jackson library is sending the request with an incorrect URI:
Request:
POST https://public-develop-company-dev.cloud.com:23090/topics/topic-name Headers[Accept=application/json Content-Type=application/vnd.kafka.json.v2+json User-Agent=Resteasy Reactive Client content-length=407], Body: {"records":[{"value":{ "body": "theBody" }}]}
As you can see, it is not including the credentials "USER:PASSWORD" in the URI. Instead, the credentials are being removed, resulting in the request failing due to authentication issues.
Also, it can be noticed that the request contains headers such as
Accept=application/json, Content-Type=application/vnd.kafka.json.v2+json, User-Agent=Resteasy Reactive Client and content-length=407
which can also provide some information about the request.It is important to note that this bug can cause issues when trying to connect to a service that requires authentication and can prevent the application from communicating with this service.
The text was updated successfully, but these errors were encountered: