Details

    • Type: Sub-task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: Webfrontend
    • Labels:
      None

      Description

      `jobmanager.web.access-control-allow-origin`: Enable custom access control parameter for allow origin header, default is `*`.

        Issue Links

          Activity

          Hide
          greghogan Greg Hogan added a comment -

          Should we allow configuring any HTTP header?

          Show
          greghogan Greg Hogan added a comment - Should we allow configuring any HTTP header?
          Hide
          shijinkui shijinkui added a comment -

          Greg Hogan We need configure some special allow_origin. For example, flink set the yarn url as flink allow origin so that forbidden the other urls.

          Show
          shijinkui shijinkui added a comment - Greg Hogan We need configure some special allow_origin. For example, flink set the yarn url as flink allow origin so that forbidden the other urls.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user shijinkui opened a pull request:

          https://github.com/apache/flink/pull/3769

          FLINK-6367 support custom header settings of allow origin

          `jobmanager.web.access-control-allow-origin`: Enable custom access control parameter for allow origin header, default is `*`.

          • [X] General
          • The pull request references the related JIRA issue ("FLINK-6367 support custom header settings of allow origin")
          • The pull request addresses only one issue
          • Each commit in the PR has a meaningful commit message (including the JIRA id)
          • [X] Documentation
          • Documentation has been added for new functionality
          • Old documentation affected by the pull request has been updated
          • JavaDoc for public methods has been added
          • [X] Tests & Build
          • Functionality added by the pull request is covered by tests
          • `mvn clean verify` has been executed successfully locally or a Travis build has passed

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/hwstreaming/flink allow_origin

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/3769.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #3769


          commit b6815edca3d38fed5da32175c32170fbbef084a0
          Author: shijinkui <shijinkui@huawei.com>
          Date: 2017-04-25T12:09:15Z

          FLINK-6367 support custom header settings of allow origin


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user shijinkui opened a pull request: https://github.com/apache/flink/pull/3769 FLINK-6367 support custom header settings of allow origin `jobmanager.web.access-control-allow-origin`: Enable custom access control parameter for allow origin header, default is `*`. [X] General The pull request references the related JIRA issue (" FLINK-6367 support custom header settings of allow origin") The pull request addresses only one issue Each commit in the PR has a meaningful commit message (including the JIRA id) [X] Documentation Documentation has been added for new functionality Old documentation affected by the pull request has been updated JavaDoc for public methods has been added [X] Tests & Build Functionality added by the pull request is covered by tests `mvn clean verify` has been executed successfully locally or a Travis build has passed You can merge this pull request into a Git repository by running: $ git pull https://github.com/hwstreaming/flink allow_origin Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3769.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3769 commit b6815edca3d38fed5da32175c32170fbbef084a0 Author: shijinkui <shijinkui@huawei.com> Date: 2017-04-25T12:09:15Z FLINK-6367 support custom header settings of allow origin
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113178604

          — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java —
          @@ -701,6 +701,9 @@
          @Deprecated
          public static final String JOB_MANAGER_WEB_BACK_PRESSURE_DELAY = "jobmanager.web.backpressure.delay-between-samples";

          + /** Web response header of Access-Control-Allow-Origin */
          + public static final String JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = "jobmanager.web.access-control-allow-origin";
          — End diff –

          please refactor this into a `ConfigOption`.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113178604 — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java — @@ -701,6 +701,9 @@ @Deprecated public static final String JOB_MANAGER_WEB_BACK_PRESSURE_DELAY = "jobmanager.web.backpressure.delay-between-samples"; + /** Web response header of Access-Control-Allow-Origin */ + public static final String JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = "jobmanager.web.access-control-allow-origin"; — End diff – please refactor this into a `ConfigOption`.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shijinkui commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113226235

          — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java —
          @@ -701,6 +701,9 @@
          @Deprecated
          public static final String JOB_MANAGER_WEB_BACK_PRESSURE_DELAY = "jobmanager.web.backpressure.delay-between-samples";

          + /** Web response header of Access-Control-Allow-Origin */
          + public static final String JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = "jobmanager.web.access-control-allow-origin";
          — End diff –

          Done.

          Show
          githubbot ASF GitHub Bot added a comment - Github user shijinkui commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113226235 — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java — @@ -701,6 +701,9 @@ @Deprecated public static final String JOB_MANAGER_WEB_BACK_PRESSURE_DELAY = "jobmanager.web.backpressure.delay-between-samples"; + /** Web response header of Access-Control-Allow-Origin */ + public static final String JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = "jobmanager.web.access-control-allow-origin"; — End diff – Done.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113241708

          — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java —
          @@ -1333,6 +1333,11 @@
          key("jobmanager.web.address")
          .noDefaultValue();

          + /** Web response header of Access-Control-Allow-Origin's key and default value. */
          — End diff –

          Please replace this with "The config parameter defining the Access-Control-Allow-Origin header for all responses from the web-frontend".

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113241708 — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java — @@ -1333,6 +1333,11 @@ key("jobmanager.web.address") .noDefaultValue(); + /** Web response header of Access-Control-Allow-Origin's key and default value. */ — End diff – Please replace this with "The config parameter defining the Access-Control-Allow-Origin header for all responses from the web-frontend".
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113241783

          — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java —
          @@ -1333,6 +1333,11 @@
          key("jobmanager.web.address")
          .noDefaultValue();

          + /** Web response header of Access-Control-Allow-Origin's key and default value. */
          + public static final ConfigOption<String> JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN =
          + key("jobmanager.web.access-control-allow-origin").defaultValue("*");
          +
          +
          — End diff –

          Remove this empty line.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113241783 — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java — @@ -1333,6 +1333,11 @@ key("jobmanager.web.address") .noDefaultValue(); + /** Web response header of Access-Control-Allow-Origin's key and default value. */ + public static final ConfigOption<String> JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = + key("jobmanager.web.access-control-allow-origin").defaultValue("*"); + + — End diff – Remove this empty line.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113241117

          — Diff: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorConfig.java —
          @@ -78,4 +78,10 @@ public boolean isProgramSubmitEnabled()

          { ConfigConstants.JOB_MANAGER_WEB_SUBMIT_ENABLED_KEY, ConfigConstants.DEFAULT_JOB_MANAGER_WEB_SUBMIT_ENABLED); }

          +
          + public String getAllowOrigin() {
          + return config.getString(
          + ConfigConstants.JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN.key(),
          — End diff –

          You can simplify this by using `Configuration#getString(ConfigOption<String> option)` instead.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113241117 — Diff: flink-runtime-web/src/main/java/org/apache/flink/runtime/webmonitor/WebMonitorConfig.java — @@ -78,4 +78,10 @@ public boolean isProgramSubmitEnabled() { ConfigConstants.JOB_MANAGER_WEB_SUBMIT_ENABLED_KEY, ConfigConstants.DEFAULT_JOB_MANAGER_WEB_SUBMIT_ENABLED); } + + public String getAllowOrigin() { + return config.getString( + ConfigConstants.JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN.key(), — End diff – You can simplify this by using `Configuration#getString(ConfigOption<String> option)` instead.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on a diff in the pull request:

          https://github.com/apache/flink/pull/3769#discussion_r113241231

          — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java —
          @@ -1333,6 +1333,11 @@
          key("jobmanager.web.address")
          .noDefaultValue();

          + /** Web response header of Access-Control-Allow-Origin's key and default value. */
          + public static final ConfigOption<String> JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN =
          + key("jobmanager.web.access-control-allow-origin").defaultValue("*");
          — End diff –

          please move `.defaultValue("*")` into a new line.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on a diff in the pull request: https://github.com/apache/flink/pull/3769#discussion_r113241231 — Diff: flink-core/src/main/java/org/apache/flink/configuration/ConfigConstants.java — @@ -1333,6 +1333,11 @@ key("jobmanager.web.address") .noDefaultValue(); + /** Web response header of Access-Control-Allow-Origin's key and default value. */ + public static final ConfigOption<String> JOB_MANAGER_WEB_ACCESS_CONTROL_ALLOW_ORIGIN = + key("jobmanager.web.access-control-allow-origin").defaultValue("*"); — End diff – please move `.defaultValue("*")` into a new line.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shijinkui commented on the issue:

          https://github.com/apache/flink/pull/3769

          @zentol fix that

          Show
          githubbot ASF GitHub Bot added a comment - Github user shijinkui commented on the issue: https://github.com/apache/flink/pull/3769 @zentol fix that
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on the issue:

          https://github.com/apache/flink/pull/3769

          Looks good, +1.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on the issue: https://github.com/apache/flink/pull/3769 Looks good, +1.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shijinkui closed the pull request at:

          https://github.com/apache/flink/pull/3769

          Show
          githubbot ASF GitHub Bot added a comment - Github user shijinkui closed the pull request at: https://github.com/apache/flink/pull/3769
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user shijinkui reopened a pull request:

          https://github.com/apache/flink/pull/3769

          FLINK-6367 support custom header settings of allow origin

          `jobmanager.web.access-control-allow-origin`: Enable custom access control parameter for allow origin header, default is `*`.

          • [X] General
          • The pull request references the related JIRA issue ("FLINK-6367 support custom header settings of allow origin")
          • The pull request addresses only one issue
          • Each commit in the PR has a meaningful commit message (including the JIRA id)
          • [X] Documentation
          • Documentation has been added for new functionality
          • Old documentation affected by the pull request has been updated
          • JavaDoc for public methods has been added
          • [X] Tests & Build
          • Functionality added by the pull request is covered by tests
          • `mvn clean verify` has been executed successfully locally or a Travis build has passed

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/hwstreaming/flink allow_origin

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/flink/pull/3769.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #3769


          commit b6815edca3d38fed5da32175c32170fbbef084a0
          Author: shijinkui <shijinkui@huawei.com>
          Date: 2017-04-25T12:09:15Z

          FLINK-6367 support custom header settings of allow origin

          commit 62cfc7dd5e0575ca64fda2d9b13c4281550383bf
          Author: Jinkui Shi <shijinkui@huawei.com>
          Date: 2017-04-25T15:18:38Z

          use ConfigOption wrap key and default value

          commit bd295833a038ebce45db921b843863d4221cd25d
          Author: Jinkui Shi <shijinkui@huawei.com>
          Date: 2017-04-25T23:20:42Z

          code line format


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user shijinkui reopened a pull request: https://github.com/apache/flink/pull/3769 FLINK-6367 support custom header settings of allow origin `jobmanager.web.access-control-allow-origin`: Enable custom access control parameter for allow origin header, default is `*`. [X] General The pull request references the related JIRA issue (" FLINK-6367 support custom header settings of allow origin") The pull request addresses only one issue Each commit in the PR has a meaningful commit message (including the JIRA id) [X] Documentation Documentation has been added for new functionality Old documentation affected by the pull request has been updated JavaDoc for public methods has been added [X] Tests & Build Functionality added by the pull request is covered by tests `mvn clean verify` has been executed successfully locally or a Travis build has passed You can merge this pull request into a Git repository by running: $ git pull https://github.com/hwstreaming/flink allow_origin Alternatively you can review and apply these changes as the patch at: https://github.com/apache/flink/pull/3769.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #3769 commit b6815edca3d38fed5da32175c32170fbbef084a0 Author: shijinkui <shijinkui@huawei.com> Date: 2017-04-25T12:09:15Z FLINK-6367 support custom header settings of allow origin commit 62cfc7dd5e0575ca64fda2d9b13c4281550383bf Author: Jinkui Shi <shijinkui@huawei.com> Date: 2017-04-25T15:18:38Z use ConfigOption wrap key and default value commit bd295833a038ebce45db921b843863d4221cd25d Author: Jinkui Shi <shijinkui@huawei.com> Date: 2017-04-25T23:20:42Z code line format
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on the issue:

          https://github.com/apache/flink/pull/3769

          merging.

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on the issue: https://github.com/apache/flink/pull/3769 merging.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user StephanEwen commented on the issue:

          https://github.com/apache/flink/pull/3769

          @zentol Has this been merged? If yes, @shijinkui can you close the pull request manually?

          Show
          githubbot ASF GitHub Bot added a comment - Github user StephanEwen commented on the issue: https://github.com/apache/flink/pull/3769 @zentol Has this been merged? If yes, @shijinkui can you close the pull request manually?
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user shijinkui commented on the issue:

          https://github.com/apache/flink/pull/3769

          hi, @zentol @StephanEwen It didn't merge in. @zentol Please check again.

          Show
          githubbot ASF GitHub Bot added a comment - Github user shijinkui commented on the issue: https://github.com/apache/flink/pull/3769 hi, @zentol @StephanEwen It didn't merge in. @zentol Please check again.
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user zentol commented on the issue:

          https://github.com/apache/flink/pull/3769

          Patience please...

          Show
          githubbot ASF GitHub Bot added a comment - Github user zentol commented on the issue: https://github.com/apache/flink/pull/3769 Patience please...
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/flink/pull/3769

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/flink/pull/3769
          Hide
          Zentol Chesnay Schepler added a comment -

          1.3: 127f1df642ecc332cab742bd040e67613e4bad25

          Show
          Zentol Chesnay Schepler added a comment - 1.3: 127f1df642ecc332cab742bd040e67613e4bad25

            People

            • Assignee:
              shijinkui shijinkui
              Reporter:
              shijinkui shijinkui
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development