This is an automated email from the ASF dual-hosted git repository. chesnay pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/flink.git
The following commit(s) were added to refs/heads/master by this push: new cfc2ec84125 [FLINK-30116][rest] Do not expose environment variables cfc2ec84125 is described below commit cfc2ec841257eba37f49f6ed96ea8937a98bf535 Author: ConradJam <jam.gz...@gmail.com> AuthorDate: Mon Dec 12 18:06:22 2022 +0800 [FLINK-30116][rest] Do not expose environment variables --- .../shortcodes/generated/rest_v1_dispatcher.html | 2 +- docs/static/generated/rest_v1_dispatcher.yml | 2 +- .../runtime/rest/messages/EnvironmentInfo.java | 38 ---------------------- .../job/JobManagerJobEnvironmentHeaders.java | 2 +- 4 files changed, 3 insertions(+), 41 deletions(-) diff --git a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html index fd3a2380cb2..b59b1b626c0 100644 --- a/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html +++ b/docs/layouts/shortcodes/generated/rest_v1_dispatcher.html @@ -2684,7 +2684,7 @@ Using 'curl' you can upload a jar via 'curl -X POST -H "Expect:" -F "jarfile=@pa <td class="text-left">Response code: <code>200 OK</code></td> </tr> <tr> - <td colspan="2">Returns the jobmanager's environment variables of a specific job.</td> + <td colspan="2">Returns the jobmanager's environment of a specific job.</td> </tr> <tr> <td colspan="2">Path parameters</td> diff --git a/docs/static/generated/rest_v1_dispatcher.yml b/docs/static/generated/rest_v1_dispatcher.yml index 9d050c8c995..e368e7c6bf5 100644 --- a/docs/static/generated/rest_v1_dispatcher.yml +++ b/docs/static/generated/rest_v1_dispatcher.yml @@ -710,7 +710,7 @@ paths: $ref: '#/components/schemas/ConfigurationInfoEntry' /jobs/{jobid}/jobmanager/environment: get: - description: Returns the jobmanager's environment variables of a specific job. + description: Returns the jobmanager's environment of a specific job. operationId: getJobManagerJobEnvironment parameters: - name: jobid diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/EnvironmentInfo.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/EnvironmentInfo.java index a9af7f86a54..097ef4d0b43 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/EnvironmentInfo.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/EnvironmentInfo.java @@ -70,44 +70,6 @@ public class EnvironmentInfo implements ResponseBody { JVMInfo.create(), Arrays.asList(System.getProperty("java.class.path").split(":"))); } - /** A single key-value pair entry in the {@link EnvironmentInfo} response. */ - private static class EnvironmentVariableItem { - private static final String FIELD_NAME_KEY = "key"; - - private static final String FIELD_NAME_VALUE = "value"; - - @JsonProperty(FIELD_NAME_KEY) - private final String key; - - @JsonProperty(FIELD_NAME_VALUE) - private final String value; - - @JsonCreator - public EnvironmentVariableItem( - @JsonProperty(FIELD_NAME_KEY) String key, - @JsonProperty(FIELD_NAME_VALUE) String value) { - this.key = key; - this.value = value; - } - - @Override - public boolean equals(Object o) { - if (this == o) { - return true; - } - if (o == null || getClass() != o.getClass()) { - return false; - } - EnvironmentVariableItem that = (EnvironmentVariableItem) o; - return key.equals(that.key) && value.equals(that.value); - } - - @Override - public int hashCode() { - return Objects.hash(key, value); - } - } - /** JVM information. */ private static class JVMInfo { private static final String FIELD_NAME_VERSION = "version"; diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobManagerJobEnvironmentHeaders.java b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobManagerJobEnvironmentHeaders.java index 256c1f6149c..a5e3e4846ed 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobManagerJobEnvironmentHeaders.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/rest/messages/job/JobManagerJobEnvironmentHeaders.java @@ -75,6 +75,6 @@ public class JobManagerJobEnvironmentHeaders @Override public String getDescription() { - return "Returns the jobmanager's environment variables of a specific job."; + return "Returns the jobmanager's environment of a specific job."; } }