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

Allow customization of netty channel handles before and during decompression #10261

Merged
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
0925b7e
Make the decompressor extensible and allow for a plugin to define a s…
cwperks Sep 27, 2023
a8d9b73
Add to CHANGELOG
cwperks Sep 27, 2023
5188697
Use getMethods
cwperks Sep 28, 2023
cd9e72f
Create new instance of each inbound handler
cwperks Sep 28, 2023
bf2d707
Update name
cwperks Sep 28, 2023
bfc3ceb
Update name
cwperks Sep 28, 2023
2584e94
Update test
cwperks Sep 28, 2023
e02a8a3
Add netty request tests
cwperks Sep 28, 2023
0a0214d
Merge branch 'main' into improve-compressed-requests
cwperks Sep 28, 2023
104c512
Add test for createRestRequest
cwperks Sep 28, 2023
aec43e9
Very basic header validator
peternied Sep 28, 2023
46f3e4a
Revert "Very basic header validator"
cwperks Sep 29, 2023
16ecd7f
Remove createDecompressor extension point in favor of attributeKey th…
cwperks Sep 29, 2023
e6209c7
Minor update
cwperks Sep 29, 2023
54a0a96
Match previous name
cwperks Sep 29, 2023
f4eb416
Add license header
cwperks Sep 29, 2023
226299a
Back out DelegatingRestHandler changes to simplify this PR and follow…
cwperks Sep 29, 2023
4689e30
Small update to test
cwperks Sep 29, 2023
c227e6e
remove printStackTrace
cwperks Sep 29, 2023
a83c64f
Merge branch 'main' into improve-compressed-requests
cwperks Oct 3, 2023
aec3ad3
Remove channel attributes that are request specific
cwperks Oct 4, 2023
01dfa89
Move new AttributeKeys to security plugin
cwperks Oct 4, 2023
a1d6968
Merge branch 'main' into improve-compressed-requests
cwperks Oct 4, 2023
3085f64
Add charset
cwperks Oct 4, 2023
7ca4c7e
Add javadoc on new extension points
cwperks Oct 5, 2023
4c49159
Merge branch 'main' into improve-compressed-requests
cwperks Oct 5, 2023
23feffd
Merge branch 'improve-compressed-requests' of https://github.com/cwpe…
cwperks Oct 5, 2023
02b92ab
Single request class
cwperks Oct 5, 2023
5af481b
Revert access modifier changes
cwperks Oct 5, 2023
91fc5bc
Spotless
cwperks Oct 5, 2023
ddaca29
Remove createRestRequest changes in favor of new security rest channe…
cwperks Oct 5, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add charset
Signed-off-by: Craig Perkins <cwperx@amazon.com>
  • Loading branch information
cwperks committed Oct 4, 2023
commit 3085f645a1a49fc141392a82c5cbba5c676b33b1
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import org.opensearch.transport.Netty4ModulePlugin;
import org.opensearch.transport.SharedGroupFactory;

import java.nio.charset.StandardCharsets;
import java.util.Collections;
import java.util.Map;
import java.util.function.Supplier;
Expand Down Expand Up @@ -108,7 +109,7 @@ public class ExampleBlockingNetty4HeaderVerifier extends SimpleChannelInboundHan
public void channelRead0(ChannelHandlerContext ctx, DefaultHttpRequest msg) throws Exception {
ReferenceCountUtil.retain(msg);
if (isBlocked(msg)) {
ByteBuf buf = Unpooled.copiedBuffer("Hit header_verifier".getBytes());
ByteBuf buf = Unpooled.copiedBuffer("Hit header_verifier".getBytes(StandardCharsets.UTF_8));
final FullHttpResponse response = new DefaultFullHttpResponse(msg.protocolVersion(), HttpResponseStatus.UNAUTHORIZED, buf);
ctx.writeAndFlush(response).addListener(ChannelFutureListener.CLOSE);
ReferenceCountUtil.release(msg);
Expand Down