-
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
Use Vert.x BodyHandler #5978
Use Vert.x BodyHandler #5978
Conversation
@@ -21,6 +22,12 @@ FeatureBuildItem featureBuildItem() { | |||
return new FeatureBuildItem(FeatureBuildItem.KEYCLOAK_AUTHORIZATION); | |||
} | |||
|
|||
@BuildStep | |||
RequireBodyHandlerBuildItem requireBody() { | |||
//TODO: this should only be produced if required, ask Pedro about config for this |
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.
@pedroigor how can we tell if the request needs to be fully buffered or not?
} | ||
} | ||
|
||
return value; |
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.
What's the reason for this change? It looks a bit unrelated and unexpected.
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.
@gsmet Indeed, the reason behind it is that otherwise, we would need a Keycloak release to just fix how we are checking the content type. The code here is basically removing the charset so that the code we are relying on from Keycloak can work as expected.
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.
That was part of @pedroigor original approach, I don't think it is needed so I might modify the PR to just keep the tests and not the rest of the changes.
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.
Yeah, the change is not related with this one but to #5959
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.
OK, then this needs proper documentation with a TODO pointing to a GH issue so that we remove it in the future.
ec08512
to
ceacd10
Compare
Fixes quarkusio#5959 This change allows the body handler to be used for Undertow and RESTEasy standalone. When the request is fully buffered it can be consumed multiple times, which allows keycloak to also process it.
ceacd10
to
2fb8415
Compare
} | ||
} | ||
|
||
return value; |
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.
@gsmet Indeed, the reason behind it is that otherwise, we would need a Keycloak release to just fix how we are checking the content type. The code here is basically removing the charset so that the code we are relying on from Keycloak can work as expected.
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.
@stuartwdouglas you need to remove any change related to tests because the previous change I did to content type (VertxHttpFacade) is not here anymore (but will be sent separately on top of your work). Otherwise, the test will fail. The files that should be reverted are: ProtectedResource
, application.properties
and PolicyEnforcerTest
.
Superseded by #5981 which includes this work. |
Fixes #5959
This change allows the body handler to be used for Undertow
and RESTEasy standalone. When the request is fully buffered
it can be consumed multiple times, which allows keycloak
to also process it.