You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@couchdb.apache.org by GitBox <gi...@apache.org> on 2022/03/15 01:03:12 UTC

[GitHub] [couchdb] uaru opened a new issue #3960: When JWT is incorrect, the returned error should be 400 Bad Request and not 500

uaru opened a new issue #3960:
URL: https://github.com/apache/couchdb/issues/3960


   ## Description
   
   When the server receives the request authorized with JWT with payload
   
   ```
   {
      :sub => username,
      :'_couchdb.roles' => roles,
      :exp => ...,
   }
   
   ```
   and `roles` is a string, the server returns error 500 Internal Server Error with 
   
   ```
   {
     "error": "internal_server_error",
     "reason": "No DB shards could be opened.",
     "ref": ...
   }
   ```
   
   ## Steps to Reproduce
   
   ```
   curl -X GET --location "https://<couchdb_server>:6984/<db>/<document>" \
       -H "Accept: application/json" \
       -H "Content-Type: application/json; charset=utf-8" \
       -H "Authorization: Bearer <JWT Token>"
   
   ```
   
   The server return error 500, with body:
   
   ```
   {
     "error": "internal_server_error",
     "reason": "No DB shards could be opened.",
     "ref": ...
   }
   ```
   
   ## Expected Behaviour
   
   The server should return 400 Bad Request.
   
   ## Your Environment
   
   Server: CouchDB/3.2.1 (Erlang OTP/23) 
   
   Running in Docker on Ubuntu 18.04
   
   


-- 
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: notifications-unsubscribe@couchdb.apache.org

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