Skip to content

Commit 4b8e05b

Browse files
committed
Merge remote-tracking branch 'upstream/main' into try1-limit-byte-sizes
2 parents c0669ad + 7245632 commit 4b8e05b

File tree

361 files changed

+3402
-2086
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

361 files changed

+3402
-2086
lines changed

distribution/tools/keystore-cli/src/test/java/org/elasticsearch/cli/keystore/KeyStoreWrapperTests.java

Lines changed: 27 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
import static org.hamcrest.Matchers.equalTo;
5959
import static org.hamcrest.Matchers.hasSize;
6060
import static org.hamcrest.Matchers.instanceOf;
61+
import static org.hamcrest.Matchers.is;
6162
import static org.hamcrest.Matchers.notNullValue;
6263

6364
public class KeyStoreWrapperTests extends ESTestCase {
@@ -436,17 +437,8 @@ public void testStringAndFileDistinction() throws Exception {
436437
public void testLegacyV3() throws GeneralSecurityException, IOException {
437438
assumeFalse("Cannot open unprotected keystore on FIPS JVM", inFipsJvm());
438439
final Path configDir = createTempDir();
439-
final Path keystore = configDir.resolve("elasticsearch.keystore");
440-
try (
441-
InputStream is = KeyStoreWrapperTests.class.getResourceAsStream("/format-v3-elasticsearch.keystore");
442-
OutputStream os = Files.newOutputStream(keystore)
443-
) {
444-
final byte[] buffer = new byte[4096];
445-
int readBytes;
446-
while ((readBytes = is.read(buffer)) > 0) {
447-
os.write(buffer, 0, readBytes);
448-
}
449-
}
440+
copyKeyStoreFromResourceToConfigDir(configDir, "/format-v3-elasticsearch.keystore");
441+
450442
final KeyStoreWrapper wrapper = KeyStoreWrapper.load(configDir);
451443
assertNotNull(wrapper);
452444
wrapper.decrypt(new char[0]);
@@ -460,9 +452,31 @@ public void testLegacyV3() throws GeneralSecurityException, IOException {
460452

461453
public void testLegacyV5() throws GeneralSecurityException, IOException {
462454
final Path configDir = createTempDir();
455+
copyKeyStoreFromResourceToConfigDir(configDir, "/format-v5-with-password-elasticsearch.keystore");
456+
457+
final KeyStoreWrapper wrapper = KeyStoreWrapper.load(configDir);
458+
assertNotNull(wrapper);
459+
wrapper.decrypt("keystorepassword".toCharArray());
460+
assertThat(wrapper.getFormatVersion(), equalTo(5));
461+
assertThat(wrapper.getSettingNames(), equalTo(Set.of("keystore.seed")));
462+
}
463+
464+
public void testLegacyV6() throws GeneralSecurityException, IOException {
465+
final Path configDir = createTempDir();
466+
copyKeyStoreFromResourceToConfigDir(configDir, "/format-v6-elasticsearch.keystore");
467+
468+
final KeyStoreWrapper wrapper = KeyStoreWrapper.load(configDir);
469+
assertNotNull(wrapper);
470+
wrapper.decrypt("keystorepassword".toCharArray());
471+
assertThat(wrapper.getFormatVersion(), equalTo(6));
472+
assertThat(wrapper.getSettingNames(), equalTo(Set.of("keystore.seed", "string")));
473+
assertThat(wrapper.getString("string"), equalTo("value"));
474+
}
475+
476+
private void copyKeyStoreFromResourceToConfigDir(Path configDir, String name) throws IOException {
463477
final Path keystore = configDir.resolve("elasticsearch.keystore");
464478
try (
465-
InputStream is = KeyStoreWrapperTests.class.getResourceAsStream("/format-v5-with-password-elasticsearch.keystore");
479+
InputStream is = KeyStoreWrapperTests.class.getResourceAsStream(name); //
466480
OutputStream os = Files.newOutputStream(keystore)
467481
) {
468482
final byte[] buffer = new byte[4096];
@@ -471,11 +485,6 @@ public void testLegacyV5() throws GeneralSecurityException, IOException {
471485
os.write(buffer, 0, readBytes);
472486
}
473487
}
474-
final KeyStoreWrapper wrapper = KeyStoreWrapper.load(configDir);
475-
assertNotNull(wrapper);
476-
wrapper.decrypt("keystorepassword".toCharArray());
477-
assertThat(wrapper.getFormatVersion(), equalTo(5));
478-
assertThat(wrapper.getSettingNames(), equalTo(Set.of("keystore.seed")));
479488
}
480489

481490
public void testSerializationNewlyCreated() throws Exception {
@@ -487,6 +496,7 @@ public void testSerializationNewlyCreated() throws Exception {
487496
wrapper.writeTo(out);
488497
final KeyStoreWrapper fromStream = new KeyStoreWrapper(out.bytes().streamInput());
489498

499+
assertThat(fromStream.getFormatVersion(), is(KeyStoreWrapper.CURRENT_VERSION));
490500
assertThat(fromStream.getSettingNames(), hasSize(2));
491501
assertThat(fromStream.getSettingNames(), containsInAnyOrder("string_setting", "keystore.seed"));
492502

Binary file not shown.

docs/changelog/118669.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 118669
2+
summary: "[Connector API] Support soft-deletes of connectors"
3+
area: Extract&Transform
4+
type: feature
5+
issues: []

docs/changelog/119389.yaml

Lines changed: 0 additions & 5 deletions
This file was deleted.

docs/changelog/119449.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119449
2+
summary: Add missing traces ilm policy for OTel traces data streams
3+
area: Data streams
4+
type: bug
5+
issues: []

docs/changelog/119748.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119748
2+
summary: Issue S3 web identity token refresh call with sufficient permissions
3+
area: Snapshot/Restore
4+
type: bug
5+
issues:
6+
- 119747

docs/changelog/119749.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119749
2+
summary: Strengthen encryption for elasticsearch-keystore tool to AES 256
3+
area: Infra/CLI
4+
type: enhancement
5+
issues: []

docs/changelog/119750.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119750
2+
summary: "ESQL: `connect_transport_exception` should be thrown instead of `verification_exception`\
3+
\ when ENRICH-ing if remote is disconnected"
4+
area: Search
5+
type: bug
6+
issues: []

docs/changelog/119793.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
pr: 119793
2+
summary: Resolve/cluster should mark remotes as not connected when a security exception
3+
is thrown
4+
area: CCS
5+
type: bug
6+
issues: []

docs/changelog/119797.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pr: 119797
2+
summary: "[Inference API] Fix bug checking for e5 or reranker default IDs"
3+
area: Machine Learning
4+
type: bug
5+
issues: []

0 commit comments

Comments
 (0)