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 2021/09/07 08:16:01 UTC

[GitHub] [knox] zeroflag opened a new pull request #487: KNOX-2651 - NPE when token value is missing

zeroflag opened a new pull request #487:
URL: https://github.com/apache/knox/pull/487


   ## What changes were proposed in this pull request?
   
   There can be a NPE when there is a space between the username and password.
   
   ## How was this patch tested?
   
   ```
   $ curl -vvv -iku Token: xxxx https://localhost:8443/gateway/sandbox/webhdfs/v1/?op=LISTSTATUS
   ```


-- 
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 a change in pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r698725448



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       I think we could log the fact that token type/value is missing. It'd be a great help when debugging 401 issues.




-- 
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 #487: KNOX-2651 - NPE when token value is missing

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


   


-- 
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] zeroflag commented on a change in pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
zeroflag commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r699105799



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       Good point.




-- 
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] zeroflag closed pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
zeroflag closed pull request #487:
URL: https://github.com/apache/knox/pull/487


   


-- 
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] zeroflag commented on pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
zeroflag commented on pull request #487:
URL: https://github.com/apache/knox/pull/487#issuecomment-908223718


   cc: @pzampino @smolnar82 @moresandeep 


-- 
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 a change in pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
smolnar82 commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r698725448



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       I think we could log the fact that token type/value is missing. It'd be a great help when debugging 401 issues.




-- 
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] zeroflag commented on a change in pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
zeroflag commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r699105799



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       Good point.




-- 
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] zeroflag commented on a change in pull request #487: KNOX-2651 - NPE when token value is missing

Posted by GitBox <gi...@apache.org>.
zeroflag commented on a change in pull request #487:
URL: https://github.com/apache/knox/pull/487#discussion_r699105799



##########
File path: gateway-provider-security-jwt/src/main/java/org/apache/knox/gateway/provider/federation/jwt/filter/JWTFederationFilter.java
##########
@@ -126,7 +126,7 @@ public void doFilter(ServletRequest request, ServletResponse response, FilterCha
     }
     final Pair<TokenType, String> wireToken = getWireToken(request);
 
-    if (wireToken != null) {
+    if (wireToken != null && wireToken.getLeft() != null && wireToken.getRight() != null) {

Review comment:
       Good point.




-- 
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