-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Include Secure Setting Names and Keystore Modified Time in Reload API Response #138052
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
base: main
Are you sure you want to change the base?
Changes from all commits
85e3247
ff852ed
dfe89fa
7449fad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| pr: 138052 | ||
| summary: Include Secure Setting Names and Keystore Modified Time in Reload API Response | ||
| area: Security | ||
| type: enhancement | ||
| issues: [] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -44,6 +44,7 @@ | |
| import static org.hamcrest.Matchers.containsString; | ||
| import static org.hamcrest.Matchers.equalTo; | ||
| import static org.hamcrest.Matchers.instanceOf; | ||
| import static org.hamcrest.Matchers.is; | ||
| import static org.hamcrest.Matchers.notNullValue; | ||
| import static org.hamcrest.Matchers.nullValue; | ||
|
|
||
|
|
@@ -412,6 +413,10 @@ public void onResponse(NodesReloadSecureSettingsResponse nodesReloadResponse) { | |
| assertThat(nodesMap.size(), equalTo(cluster().size())); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think it matters but this test is disabled when running in fips mode. Since we're reading properties on the keystore we might want to make sure it works in fips mode too?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The current approach seems adequate. I see that |
||
| for (final NodesReloadSecureSettingsResponse.NodeResponse nodeResponse : nodesReloadResponse.getNodes()) { | ||
| assertThat(nodeResponse.reloadException(), nullValue()); | ||
| assertThat(nodeResponse.keystorePath(), notNullValue()); | ||
| assertThat(nodeResponse.keystoreDigest(), notNullValue()); | ||
| assertThat(nodeResponse.keystoreLastModifiedTime(), notNullValue()); | ||
| assertThat(nodeResponse.secureSettingNames(), is(new String[] { "keystore.seed" })); | ||
| } | ||
| } catch (final AssertionError e) { | ||
| reloadSettingsError.set(e); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1196,6 +1196,17 @@ public <T extends Exception> T readException() throws IOException { | |
| return ElasticsearchException.readException(this); | ||
| } | ||
|
|
||
| /** | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice addition! |
||
| * Reads an optional {@link Exception}. | ||
| */ | ||
| @Nullable | ||
| public <T extends Exception> T readOptionalException() throws IOException { | ||
| if (readBoolean()) { | ||
| return ElasticsearchException.readException(this); | ||
| } | ||
| return null; | ||
| } | ||
|
|
||
| /** | ||
| * Get the registry of named writeables if this stream has one, | ||
| * {@code null} otherwise. | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 9220000 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1 @@ | ||
| search_project_routing,9219000 | ||
| keystore_details_in_reload_secure_settings_response,9220000 |
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.
This could reference #112268