JSON-RPC support

49 views
Skip to first unread message

Jim Washington

unread,
Aug 7, 2011, 8:29:51 AM8/7/11
to pylons...@googlegroups.com
Hello,

Can I expect JSON-RPC support to land in the near future?

I am working with John Boik on a tutorial extending the SQLAlchemy + URL
Dispatch Pyramid tutorial. We are adding a Pyjamas + PureMVC client that
will do some ajaxy stuff. Nothing too complex, presumably.

Since the easiest ajaxy stuff in Pyjamas needs JSON-RPC, and JSON-RPC is
not yet part of Pyramid, the current iteration of the tutorial uses a
solution I put together employing lovely.jsonrpc.

In the interest of simplicity for the tutorial, we would prefer to use a
native-to-Pyramid JSON-RPC implementation. My code using lovely.jsonrpc
works fine for the moment, so there is no real hurry.

Let me know if I can help.

- Jim Washington


Chris McDonough

unread,
Aug 7, 2011, 11:03:54 AM8/7/11
to pylons...@googlegroups.com

There is already nascent support for JSON-RPC in the trunk of the
pyramid_rpc package (https://github.com/Pylons/pyramid_rpc ; clone the
package and see docs/jsonrpc.rst).

- C


Jim Washington

unread,
Aug 8, 2011, 9:17:42 AM8/8/11
to pylons...@googlegroups.com
On Sun, 2011-08-07 at 11:03 -0400, Chris McDonough wrote:
> There is already nascent support for JSON-RPC in the trunk of the
> pyramid_rpc package (https://github.com/Pylons/pyramid_rpc ; clone the
> package and see docs/jsonrpc.rst).
>

Hi, Chris

"Nascent" is an interesting euphemism. I'd ask for help, but I think I
really want to figure out how it is supposed to work. :)

- Jim Washington


Michael Merickel

unread,
Aug 8, 2011, 3:08:40 PM8/8/11
to pylons...@googlegroups.com
I'm one of the developers of the JSON-RPC code in pyramid_rpc. It hasn't been released yet but I think we'll be doing that in the near future (I hope).

If you have any questions about the implementation please ask. It currently supports a fairly large amount of the 2.0 spec.

--

Michael

Jim Washington

unread,
Aug 10, 2011, 8:24:27 AM8/10/11
to pylons...@googlegroups.com

It's pretty good so far! How are permissions going to be handled? ATM, I
see that the @rpc_view() decorator attaches the particular view to every
route with view=jsonrpc_endpoint. Routes currently can have permission
requirements, but not individual views. So if I have a public route
(needed for e.g., login) all views become public if the client knows the
incantation.

- Jim Washington

Michael Merickel

unread,
Sep 5, 2011, 4:33:50 PM9/5/11
to pylons...@googlegroups.com
Just as a followup, I thought I'd mention that we released pyramid_rpc 0.3 last week which revamped the API completely. When using add_jsonrpc_endpoint you can specify a factory which will be used for security. That factory can then set the ``__acl__`` based on the ``request.rpc_method`` property, and your jsonrpc_method setup can specify a permission which is then validated via the ``__acl__``.

--

Michael

Andrzej Mleczko

unread,
Sep 8, 2011, 5:08:50 AM9/8/11
to pylons...@googlegroups.com
Great,
this was the last thing I was missing. Thanks!

Andrew

Reply all
Reply to author
Forward
0 new messages