You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/09/21 15:22:09 UTC

[GitHub] [flink] HuangZhenQiu opened a new pull request, #20875: (FLINK-29363) allow fully redirection in web dashboard

HuangZhenQiu opened a new pull request, #20875:
URL: https://github.com/apache/flink/pull/20875

   What is the purpose of the change
   
   allow fully redirection in web dashboard when response status code is MovedPermanently, TemporaryRedirect or SeeOther.
   
   Brief change log
   
   change the AppInterceptor to do redirection
   Verifying this change
   
   This change is a trivial rework / code cleanup without any test coverage.
   
   Does this pull request potentially affect one of the following parts:
   
   Dependencies (does it add or upgrade a dependency): (no)
   The public API, i.e., is any changed class annotated with @Public(Evolving): (no)
   The serializers: (no)
   The runtime per-record code paths (performance sensitive): (no)
   Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (no)
   The S3 file system connector: (no)
   
   ## Documentation
   
     - Does this pull request introduce a new feature? (no)
     - If yes, how is the feature documented? (not applicable)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] rmetzger commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
rmetzger commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1326606434

   Thanks for manually testing it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1367197412

   You see it well...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] flinkbot commented on pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
flinkbot commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1253876906

   <!--
   Meta data
   {
     "version" : 1,
     "metaDataEntries" : [ {
       "hash" : "4a8f9f9f850c33780f9f0d306cd8d3842b67658e",
       "status" : "UNKNOWN",
       "url" : "TBD",
       "triggerID" : "4a8f9f9f850c33780f9f0d306cd8d3842b67658e",
       "triggerType" : "PUSH"
     } ]
   }-->
   ## CI report:
   
   * 4a8f9f9f850c33780f9f0d306cd8d3842b67658e UNKNOWN
   
   <details>
   <summary>Bot commands</summary>
     The @flinkbot bot supports the following commands:
   
    - `@flinkbot run azure` re-run the last Azure build
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] HuangZhenQiu commented on a diff in pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
HuangZhenQiu commented on code in PR #20875:
URL: https://github.com/apache/flink/pull/20875#discussion_r976801184


##########
flink-runtime-web/web-dashboard/src/app/app.interceptor.ts:
##########
@@ -39,6 +46,16 @@ export class AppInterceptor implements HttpInterceptor {
 
     return next.handle(req.clone({ withCredentials: true })).pipe(
       catchError(res => {
+        if (
+          res instanceof HttpResponseBase &&
+          (res.status == HttpStatusCode.MovedPermanently ||
+            res.status == HttpStatusCode.TemporaryRedirect ||
+            res.status == HttpStatusCode.SeeOther) &&

Review Comment:
   The code path is mainly to fetching job metadata. Multiple Choices, Use Proxy, Unused are not fit for the scenarios or data type. Bt I am open to add more status code to make it more robust.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] rmetzger commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
rmetzger commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1368794506

   Merging change ...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on a diff in pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on code in PR #20875:
URL: https://github.com/apache/flink/pull/20875#discussion_r976740976


##########
flink-runtime-web/web-dashboard/src/app/app.interceptor.ts:
##########
@@ -39,6 +46,16 @@ export class AppInterceptor implements HttpInterceptor {
 
     return next.handle(req.clone({ withCredentials: true })).pipe(
       catchError(res => {
+        if (
+          res instanceof HttpResponseBase &&
+          (res.status == HttpStatusCode.MovedPermanently ||
+            res.status == HttpStatusCode.TemporaryRedirect ||
+            res.status == HttpStatusCode.SeeOther) &&

Review Comment:
   I've taken a look at the RFC and it lists multiple 3xx codes. Just wondering how did you picked the listed codes?
   <img width="550" alt="Screen Shot 2022-09-21 at 18 19 59" src="https://user-images.githubusercontent.com/18561820/191558022-abe65674-d545-4595-8cf4-6d6a1b06eabb.png">
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on a diff in pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on code in PR #20875:
URL: https://github.com/apache/flink/pull/20875#discussion_r978376452


##########
flink-runtime-web/web-dashboard/src/app/app.interceptor.ts:
##########
@@ -39,6 +46,16 @@ export class AppInterceptor implements HttpInterceptor {
 
     return next.handle(req.clone({ withCredentials: true })).pipe(
       catchError(res => {
+        if (
+          res instanceof HttpResponseBase &&
+          (res.status == HttpStatusCode.MovedPermanently ||
+            res.status == HttpStatusCode.TemporaryRedirect ||
+            res.status == HttpStatusCode.SeeOther) &&

Review Comment:
   I was thinking about to add `302 Found` but that's optional which is denoted w/ the MAY keyword in the documentation:
   <img width="879" alt="Screen Shot 2022-09-23 at 10 10 44" src="https://user-images.githubusercontent.com/18561820/191918050-46b1acd5-9c0e-4dc4-ba8a-0928eb706800.png">
   It's good as-is from my perspective.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] rmetzger closed pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
rmetzger closed pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard
URL: https://github.com/apache/flink/pull/20875


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1328003317

   @rmetzger now it's all green and good to go :)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1261396893

   If I understand it correctly then the proxy would add CORS, right? If we can test it in a real environment then I'm fine w/ the actual code.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on a diff in pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on code in PR #20875:
URL: https://github.com/apache/flink/pull/20875#discussion_r977307723


##########
flink-runtime-web/web-dashboard/src/app/app.interceptor.ts:
##########
@@ -39,6 +46,16 @@ export class AppInterceptor implements HttpInterceptor {
 
     return next.handle(req.clone({ withCredentials: true })).pipe(
       catchError(res => {
+        if (
+          res instanceof HttpResponseBase &&
+          (res.status == HttpStatusCode.MovedPermanently ||
+            res.status == HttpStatusCode.TemporaryRedirect ||
+            res.status == HttpStatusCode.SeeOther) &&

Review Comment:
   Starting an image build and then coming back here w/ an in-depth consideration from my side...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] HuangZhenQiu commented on a diff in pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
HuangZhenQiu commented on code in PR #20875:
URL: https://github.com/apache/flink/pull/20875#discussion_r976801184


##########
flink-runtime-web/web-dashboard/src/app/app.interceptor.ts:
##########
@@ -39,6 +46,16 @@ export class AppInterceptor implements HttpInterceptor {
 
     return next.handle(req.clone({ withCredentials: true })).pipe(
       catchError(res => {
+        if (
+          res instanceof HttpResponseBase &&
+          (res.status == HttpStatusCode.MovedPermanently ||
+            res.status == HttpStatusCode.TemporaryRedirect ||
+            res.status == HttpStatusCode.SeeOther) &&

Review Comment:
   The code path is mainly to fetching job metadata. Multiple Choices, Use Proxy, Unused are not fit for the scenarios or data type. But I am open to add more status code to make it more robust.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1255919386

   I presume a rebase to the latest master is needed since second time the following error arrived:
   ```
   Sep 22 08:19:47 	Suppressed: java.lang.AssertionError: Test failed Error while running command to get file permissions : java.io.IOException: Cannot run program "ls": error=1, Operation not permitted
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] rmetzger commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
rmetzger commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1326607713

   A rebase would be nice just to make sure there haven't been major changes on the UI side since then.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] rmetzger commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
rmetzger commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1259403952

   Yes, this issue with `ls` is a known build failure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] wanglijie95 commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
wanglijie95 commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1367167231

   Hi all, what's the current status of this PR? Looks like it's ready to be merged, but hasn't been merged


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1323702730

   I've tested it manually on live cluster and it works.
   @HuangZhenQiu could you do a rebase to the latest master where tests are more stable?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1254647385

   I've started to build an image to test the feature end-t-end. Let's see how it goes...
   Additionally plz change the heading which is Flink PR compliant: `[FLINK-29363][runtime-web] ...`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: (FLINK-29363) allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1254647570

   @flinkbot run azure


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] gaborgsomogyi commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1259462644

   @rmetzger thanks for the help in advance!
   I think the current change set is not going to work with same-origin policy.
   Let's hear what @HuangZhenQiu thinks about this.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [flink] HuangZhenQiu commented on pull request #20875: [FLINK-29363][runtime-web] allow fully redirection in web dashboard

Posted by GitBox <gi...@apache.org>.
HuangZhenQiu commented on PR #20875:
URL: https://github.com/apache/flink/pull/20875#issuecomment-1259758916

   @gaborgsomogyi @rmetzger 
   
   Let's say proxy server is served in domain A. If the token/cookie times out, requests need to be redirected to domain B. In this case, Users need to configure CSP and CORS as below for security considerations. 
   For the security considerations, users need to set 
   
   Content-Security-Policy: sandbox, allow-form, allow-scripts, allow-same-origin
   Access-Control-Allow-Origin: A, B
   
   CSP guarantee the app runs in an isolated environment and also make sure cookies are attached to request to the allowed domain. Putting B in the Access-Control-Allow-Origin will make the redirection work, otherwise the redirection will be blocked by browser due to the cross origin access.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org