You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2019/11/15 15:47:00 UTC

[jira] [Work logged] (KNOX-1654) Ability to exclude global rewrite rules

     [ https://issues.apache.org/jira/browse/KNOX-1654?focusedWorklogId=344370&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-344370 ]

ASF GitHub Bot logged work on KNOX-1654:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 15/Nov/19 15:46
            Start Date: 15/Nov/19 15:46
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on pull request #196: KNOX-1654 - Ability to exclude services to apply global rewrite rules
URL: https://github.com/apache/knox/pull/196
 
 
   ## What changes were proposed in this pull request?
   
   We need to allow end-users to declare certain service(s) which are not affected by global rules even if they would match by them.
   
   ## How was this patch tested?
   
   Added new uni tests; updated existing ones and ran them:
   ```
   [INFO] ------------------------------------------------------------------------
   [INFO] BUILD SUCCESS
   [INFO] ------------------------------------------------------------------------
   [INFO] Total time: 18:23 min (Wall Clock)
   [INFO] Finished at: 2019-11-15T16:19:43+01:00
   [INFO] Final Memory: 408M/1814M
   [INFO] ------------------------------------------------------------------------
   ```
   
   In addition to unit testing the following E2E test steps were executed:
   1. started a local web server with `netcat` with the following content:
   ```
   <!doctype html>
   <html>
   <body>
   <h1>A webpage served by netcat</h1>
   <a href="http://localhost:1234/testLink">test link</a>
   </body>
   </html>
   ```
   2. Added two new service definitions:
   SERVICE 1 without any outboud rule:
   <img width="938" alt="Screen Shot 2019-11-15 at 4 36 19 PM" src="https://user-images.githubusercontent.com/34065904/68955435-4cb3eb00-07c6-11ea-840c-7ca23d4bd450.png">
   SERVICE2 with an outbound rule which matches the above link in the test HTML:
   <img width="947" alt="Screen Shot 2019-11-15 at 4 36 30 PM" src="https://user-images.githubusercontent.com/34065904/68955449-53426280-07c6-11ea-860a-938eac4e3584.png">
   3. Added these services in `sandbox` topology
   <img width="945" alt="Screen Shot 2019-11-15 at 4 39 37 PM" src="https://user-images.githubusercontent.com/34065904/68955533-8edd2c80-07c6-11ea-8eb4-44273de1069a.png">
   
   4. Made SERVICE2 global in `gateway-site.xml` and re-started the gateway:
   ```
       <property>
           <name>gateway.global.rules.services</name>
           <value>SERVICE2</value>
       </property>
   ```
   5. Tested both services using `curl`:
   ```
   $ curl -ku guest:guest-password 'https://localhost:8443/gateway/sandbox/service2/test'
   <!doctype html>
   <html>
   <body>
   <h1>A webpage served by netcat</h1>
   <a href="/gateway/sandbox/SERVICE2/">test link</a>
   </body>
   </html>
   ```
   ```
   $ curl -ku guest:guest-password 'https://localhost:8443/gateway/sandbox/service1/test'
   <!doctype html>
   <html>
   <body>
   <h1>A webpage served by netcat</h1>
   <a href="/gateway/sandbox/SERVICE2/">test link</a>
   </body>
   </html>
   ```
   As expected, the global rule `SERVICE2/service2/outbound/links` defined in `SERVICE2` has been applied here too.
   
   6. Marked `SERVICE1`  as a service to exclude global rules in `gateway-site.xml` and re-started the gateway:
   ```
       <property>
           <name>gateway.global.rules.excluded.services</name>
           <value>SERVICE1</value>
       </property>
   ```
   
   7. Re-tested the services:
   ```
   $ curl -ku guest:guest-password 'https://localhost:8443/gateway/sandbox/service2/test:
   <!doctype html>
   <html>
   <body>
   <h1>A webpage served by netcat</h1>
   <a href="/gateway/sandbox/SERVICE2/">test link</a>
   </body>
   </html>
   ```
   ```
   $ curl -ku guest:guest-password 'https://localhost:8443/gateway/sandbox/service1/test'
   <!doctype html>
   <html>
   <body>
   <h1>A webpage served by netcat</h1>
   <a href="http://localhost:1234/testLink">test link</a>
   </body>
   </html>
   ```
 
----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 344370)
    Remaining Estimate: 0h
            Time Spent: 10m

> Ability to exclude global rewrite rules 
> ----------------------------------------
>
>                 Key: KNOX-1654
>                 URL: https://issues.apache.org/jira/browse/KNOX-1654
>             Project: Apache Knox
>          Issue Type: Bug
>          Components: Server
>            Reporter: Sandeep More
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 1.4.0
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> Currently we have some services whose rewrite rules are global, the configuration is in gateway-site.xml. We need to be able to add a list of services that can be excluded so that global rules do not affect them.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)