Pylons/pyramid_rpc — Issue #18: Need to distinguish Forbidden from RequestInvalid in jsonrpc
Author: jwashin
Created: 2011-11-14 11:10:17+00:00
State: open

I want to have my pyjamas (json-rpc) client display a login dialog as a response to Forbidden.

Currently (git head), Forbidden is returned as JsonRpcRequestInvalid.

Invalid Request is defined in the JSON-RPC 2.0 spec http://jsonrpc.org/spec.html :
The JSON sent is not a valid Request object.

Forbidden needs to be distinguished from Invalid Request.

I believe that, since the JSON-RPC spec requires a json-rpc response, the proper response would be a jsonrpc_error_response with an error code of 401, with message "Unauthorized".

- Jim Washington