Skip to content

Commit

Permalink
[Build Break] Update custom serialization min supported version (open…
Browse files Browse the repository at this point in the history
…search-project#3458)

Update custom serialization min supported version, should be 2.11.0
since the features backport [1] was merged.

- [1] opensearch-project#3444 

Signed-off-by: Peter Nied <[email protected]>
  • Loading branch information
peternied authored Oct 4, 2023
1 parent e4a1b77 commit 93f79f8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ public enum RolesMappingResolution {
public static final String TENANCY_GLOBAL_TENANT_DEFAULT_NAME = "";

public static final String USE_JDK_SERIALIZATION = "plugins.security.use_jdk_serialization";
public static final Version FIRST_CUSTOM_SERIALIZATION_SUPPORTED_OS_VERSION = Version.V_3_0_0;
public static final Version FIRST_CUSTOM_SERIALIZATION_SUPPORTED_OS_VERSION = Version.V_2_11_0;

// On-behalf-of endpoints settings
// CS-SUPPRESS-SINGLE: RegexpSingleline get Extensions Settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,17 @@ public void testUseJDKSerializationHeaderIsSetOnMessageReceived() throws Excepti
TransportChannel transportChannel = mock(TransportChannel.class);
Task task = mock(Task.class);
doNothing().when(transportChannel).sendResponse(ArgumentMatchers.any(Exception.class));
when(transportChannel.getVersion()).thenReturn(Version.V_2_11_0);
when(transportChannel.getVersion()).thenReturn(Version.V_2_10_0);
when(transportChannel.getChannelType()).thenReturn("transport");

Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task));
Assert.assertTrue(threadPool.getThreadContext().getTransient(ConfigConstants.USE_JDK_SERIALIZATION));

threadPool.getThreadContext().stashContext();
when(transportChannel.getVersion()).thenReturn(Version.V_2_11_0);
Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task));
Assert.assertFalse(threadPool.getThreadContext().getTransient(ConfigConstants.USE_JDK_SERIALIZATION));

threadPool.getThreadContext().stashContext();
when(transportChannel.getVersion()).thenReturn(Version.V_3_0_0);
Assert.assertThrows(Exception.class, () -> securitySSLRequestHandler.messageReceived(transportRequest, transportChannel, task));
Expand Down

0 comments on commit 93f79f8

Please sign in to comment.