Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 8AC14200B7E for ; Tue, 6 Sep 2016 18:37:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8988E160ACB; Tue, 6 Sep 2016 16:37:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D0BA6160AA9 for ; Tue, 6 Sep 2016 18:37:24 +0200 (CEST) Received: (qmail 96109 invoked by uid 500); 6 Sep 2016 16:37:24 -0000 Mailing-List: contact dev-help@knox.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@knox.apache.org Delivered-To: mailing list dev@knox.apache.org Received: (qmail 96094 invoked by uid 99); 6 Sep 2016 16:37:24 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2016 16:37:24 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id A2250180600 for ; Tue, 6 Sep 2016 16:37:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -5.446 X-Spam-Level: X-Spam-Status: No, score=-5.446 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx2-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id CBWnLBiex-4q for ; Tue, 6 Sep 2016 16:37:22 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx2-lw-eu.apache.org (ASF Mail Server at mx2-lw-eu.apache.org) with SMTP id B88A260D72 for ; Tue, 6 Sep 2016 16:37:21 +0000 (UTC) Received: (qmail 95896 invoked by uid 99); 6 Sep 2016 16:37:20 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 06 Sep 2016 16:37:20 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id AA8D32C1B7D for ; Tue, 6 Sep 2016 16:37:20 +0000 (UTC) Date: Tue, 6 Sep 2016 16:37:20 +0000 (UTC) From: "Jeffrey E Rodriguez (JIRA)" To: dev@knox.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (KNOX-751) Need rewrite function to capture href information from single page host to rewrite output of a node hosts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 06 Sep 2016 16:37:25 -0000 Jeffrey E Rodriguez created KNOX-751: ----------------------------------------- Summary: Need rewrite function to capture href information fro= m single page host to rewrite output of a node hosts Key: KNOX-751 URL: https://issues.apache.org/jira/browse/KNOX-751 Project: Apache Knox Issue Type: Bug Components: Server Affects Versions: 0.7.0, 0.8.0, 0.9.0, 0.9.1 Environment: All environment support Knox Reporter: Jeffrey E Rodriguez Assignee: Jeffrey E Rodriguez Fix For: 0.10.0 User Interface page rewriting through Knox presents many challenges. One of= the challenges is that a Web page may have more than one link to other hos= ts of a given type (e.g. Yarn may have a link to more than one host) which= may be different from the originating one. The main issue here is that Kno= x maps a single host to a rewrite and service. If the page has multiple hos= ts of a single type the rewrite rules may not be enough without some extra = information. For example, Yarn UI may have links to Node URLs (more than on= e node) and even through the Yarn page may be rewritten to include the sche= ma, and hostname as a query parameters so the dispatcher is able to fetch t= he correct host like: https://localhost:8443/gateway/nodeui/node?scheme=3Dhttp?host=3Dsandbox1?po= rt=3D8042 https://localhost:8443/gateway/nodeui/node?scheme=3Dhttp?host=3Dsandbox2?po= rt=3D8042 https://localhost:8443/gateway/nodeui/node?scheme=3Dhttp?host=3Dsandbox3?po= rt=3D8042 the response pages from each node need to have the right scheme, host, and = port attached to their query parameters. We need a function that given a = request to one of the links above can save the information needed to rewrit= e their request output with the query parameters needed for every response = links. e.g.=20 if we click link http://localhost:8443/gateway/nodeui/node?scheme=3Dhttp?ho= st=3Dsandbox2?port=3D8042 this can be rewritten as:=20 =E2=80=9C/node/node=E2=80=9D to=20 https://localhost:8443/gateway/nodeui/node/node?scheme=3Dhttp?host=3Dsandbo= x2?port=3D8042 These functions are needed: $hrefUrl.ur $hrefUrl.host $hrefUrl.scheme $hrefUrl.port $hrefUrl.path $hrefUrl.query The rewrite would then be something like this: This way then we are not only able to request the page as we do today but t= he output response would be rewritten to have the information needed to be = accessed. There is a KNOX-618 ( patch) but after evaluation we think that relying on = the =E2=80=9CHost=E2=80=9D header still doesn=E2=80=99t provide all the inf= ormation needed such as the scheme. We have access to the request object so= it may be easier to get the information directly from the href request tha= n expecting a header. The =E2=80=9CHost=E2=80=9D header see https://www.w3.= org/Protocols/rfc2616/rfc2616-sec14.html section 14.23, only defines host a= nd port. There is no reliable way to get the scheme from the response heade= rs. Thus we can't really make use of the patch since we would still need th= e function to provide us the scheme function. Also there is still more info= rmation we may want such the path and query but those as not as critical to= our effort to map all links from Yarn UI at this point. -- This message was sent by Atlassian JIRA (v6.3.4#6332)