You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ranger.apache.org by "vikaskr22 (via GitHub)" <gi...@apache.org> on 2025/05/22 17:58:51 UTC

[PR] RANGER-5214 : Fix for KMS throwing IOException instead of AccessContr… [ranger]

vikaskr22 opened a new pull request, #579:
URL: https://github.com/apache/ranger/pull/579

   …olException
   
   ## What changes were proposed in this pull request?
   
   It's a regression fix , due to this issue  KMS generateEEK API was throwing IOException instead of relevant exception like IllegalArgumentException if keyName is empty or missing in the URL.
    
   Fix contains the proper exception handling and now it is consistent with original behaviour.
   
   
   ## How was this patch tested?
   
   mvn build is successful
   UT got passed.
   Created a new ranger-kms docker image and verified the two related endpoints.
   
   **Without zoneKey name in the URL:**
   ```
   root@ranger-kms:/# curl -ivk  -H "Content-Type: application/json" -H  -X GET 'http://host.docker.internal:9292/kms/v1/key//_eek?eek_op=generate&user.name=keyadmin'
   .................
   > GET /kms/v1/key//_eek?eek_op=generate&user.name=keyadmin HTTP/1.1
   
   < Server: Apache Ranger
   Server: Apache Ranger
   
   < 
   {
     "RemoteException" : {
       "message" : "Parameter 'name' cannot be empty",
       "exception" : "IllegalArgumentException",
       "javaClassName" : "java.lang.IllegalArgumentException"
     }
   * Closing connection 1
   }root@ranger-kms:/# 
   ```
   **With zonekey name, a valid request**
   ```
   root@ranger-kms:/# curl -ivk  -H "Content-Type: application/json" -H  -X GET 'http://host.docker.internal:9292/kms/v1/key/testkey/_eek?eek_op=generate&user.name=keyadmin'
   
   > GET /kms/v1/key/testkey/_eek?eek_op=generate&user.name=keyadmin HTTP/1.1
   > Host: host.docker.internal:9292
   ..........................................
   
   < 
   [ {
     "encryptedKeyVersion" : {
       "material" : "P_DjnLoXbuRk6VEw21thMg",
       "name" : "testkey",
       "versionName" : "EEK"
     },
     "versionName" : "testkey@0",
     "iv" : "r66Mf-saz8DjkPjZxux9ZA"
   * Connection #1 to host host.docker.internal left intact
   } ]root@ranger-kms:/#
   ```


-- 
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@ranger.apache.org

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


Re: [PR] RANGER-5214 : Fix for KMS throwing IOException instead of AccessContr… [ranger]

Posted by "dhavalshah9131 (via GitHub)" <gi...@apache.org>.
dhavalshah9131 merged PR #579:
URL: https://github.com/apache/ranger/pull/579


-- 
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@ranger.apache.org

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