You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by shijinkui <gi...@git.apache.org> on 2017/04/25 12:13:22 UTC

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

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 <sh...@huawei.com>
Date:   2017-04-25T12:09:15Z

    [FLINK-6367] support custom header settings of allow origin

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by shijinkui <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by zentol <gi...@git.apache.org>.
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".


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by shijinkui <gi...@git.apache.org>.
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 <sh...@huawei.com>
Date:   2017-04-25T12:09:15Z

    [FLINK-6367] support custom header settings of allow origin

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

    use ConfigOption wrap key and default value

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

    code line format

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by zentol <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by shijinkui <gi...@git.apache.org>.
Github user shijinkui commented on the issue:

    https://github.com/apache/flink/pull/3769
  
    @zentol  fix that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

    https://github.com/apache/flink/pull/3769
  
    Looks good, +1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by shijinkui <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by zentol <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by zentol <gi...@git.apache.org>.
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.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by zentol <gi...@git.apache.org>.
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`.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink pull request #3769: [FLINK-6367] support custom header settings of all...

Posted by shijinkui <gi...@git.apache.org>.
Github user shijinkui closed the pull request at:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by zentol <gi...@git.apache.org>.
Github user zentol commented on the issue:

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


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

[GitHub] flink issue #3769: [FLINK-6367] support custom header settings of allow orig...

Posted by StephanEwen <gi...@git.apache.org>.
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?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---