Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased 3.x]
### Added
- Set gRPC security interceptor to highest priority ([#5940](https://github.com/opensearch-project/security/pull/5940))

### Changed

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public List<OrderedGrpcInterceptor> getOrderedGrpcInterceptors(ThreadContext thr

@Override
public int order() {
return 0;
return Integer.MIN_VALUE;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,20 @@ public void testNormalConfigurationReturnsInterceptor() {
assertTrue(e.getMessage().contains("GuiceHolder") || e instanceof NullPointerException);
}
}

@Test
public void testInterceptorOrderIsMinValue() {
Settings settings = Settings.builder().put(OpenSearchSecuritySSLPlugin.CLIENT_TYPE, "node").build();

securityGrpcFilter.initNodeSettings(settings);

List<GrpcInterceptorProvider.OrderedGrpcInterceptor> interceptors = securityGrpcFilter.getOrderedGrpcInterceptors(threadContext);

assertEquals("Should return exactly one interceptor", 1, interceptors.size());
assertEquals(
"Security interceptor should have highest priority (Integer.MIN_VALUE)",
Integer.MIN_VALUE,
interceptors.get(0).order()
);
}
}
Loading