You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by GitBox <gi...@apache.org> on 2022/08/26 09:41:40 UTC

[GitHub] [knox] smolnar82 opened a new pull request, #627: KNOX-2792 - new REST API endpoint to set Authorization/Bearer header in the response using an environment variable

smolnar82 opened a new pull request, #627:
URL: https://github.com/apache/knox/pull/627

   ## What changes were proposed in this pull request?
   
   A new REST API endpoint is added in `KNOX-AUTH-SERVICE` with ``auth/api/v1/bearer` path.
   
   ## How was this patch tested?
   
   Implemented new uni test cases to cover this new functionality and executed manual testing:
   
   1. Default environment variable name:
   ```
   $ export BEARER_AUTH_TOKEN=MY_AUTH_BEARER_TOKEN
   $ bin/gateway.sh start
   $ curl -iku admin:admin-password -X GET https://localhost:8443/gateway/sandbox/auth/api/v1/bearer
   HTTP/1.1 200 OK
   Date: Fri, 26 Aug 2022 09:11:00 GMT
   Set-Cookie: KNOXSESSIONID=node01u0cyzk36nibi18g2binv7e1290.node0; Path=/gateway/sandbox; Secure; HttpOnly
   Expires: Thu, 01 Jan 1970 00:00:00 GMT
   Set-Cookie: rememberMe=deleteMe; Path=/gateway/sandbox; Max-Age=0; Expires=Thu, 25-Aug-2022 09:11:00 GMT; SameSite=lax
   Authorization: Bearer MY_AUTH_BEARER_TOKEN
   Content-Length: 0
   ```
   
   2. Custom environment variable name:
   ```
   $ bin/gateway.sh stop
   $ export CUSTOM_AUTH_TOKEN_ENV=MY_CUSTOM_AUTH_BEARER_TOKEN
   $ bin/gateway.sh start
   updated sandbox.xml to
   
       <service>
            <role>KNOX-AUTH-SERVICE</role>
            <param>
                <name>auth.bearer.token.env</name>
                <value>CUSTOM_AUTH_TOKEN_ENV</value>
            </param>
       </service>
   
   $ curl -iku admin:admin-password -X GET https://localhost:8443/gateway/sandbox/auth/api/v1/bearer
   HTTP/1.1 200 OK
   Date: Fri, 26 Aug 2022 09:14:01 GMT
   Set-Cookie: KNOXSESSIONID=node0169z65o0ns1lphe6xi9b4cse80.node0; Path=/gateway/sandbox; Secure; HttpOnly
   Expires: Thu, 01 Jan 1970 00:00:00 GMT
   Set-Cookie: rememberMe=deleteMe; Path=/gateway/sandbox; Max-Age=0; Expires=Thu, 25-Aug-2022 09:14:01 GMT; SameSite=lax
   Authorization: Bearer MY_CUSTOM_AUTH_BEARER_TOKEN
   Content-Length: 0
   
   ```
   


-- 
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: dev-unsubscribe@knox.apache.org

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


[GitHub] [knox] smolnar82 commented on pull request #627: KNOX-2792 - new REST API endpoint to set Authorization/Bearer header in the response using an environment variable

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on PR #627:
URL: https://github.com/apache/knox/pull/627#issuecomment-1228287274

   Cc. @MrtnBalazs 


-- 
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: dev-unsubscribe@knox.apache.org

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


[GitHub] [knox] smolnar82 merged pull request #627: KNOX-2792 - new REST API endpoint to set Authorization/Bearer header in the response using an environment variable

Posted by GitBox <gi...@apache.org>.
smolnar82 merged PR #627:
URL: https://github.com/apache/knox/pull/627


-- 
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: dev-unsubscribe@knox.apache.org

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