In truth, we have yet to develop solutions to some of the problems
you are raising.
With regards to authentication, if you are running on a system like
App Engine, and use it's authentication system (which admittedly, many
do not) you can get authentication information via the users module.
This means authentication is very separate from ProtoRPC.
I've had ideas about how to support arbitrary authentication
systems, for example, by introducing an arbitrary "user" field to the
RequestState object. This would enable some kind of middleware to
perform auth and pass it through.
A not-so-great solution that I can think of, but one that you can
get working quickly, is that it's safe to use thread-local variables
in a middleware handler. It works something like:
# At top level of a module.
shared = threading.local()
def session_middleware(...):
shared.session = load_session()
...
DO REQUEST
...
store_session(shared.session)
In the handler:
@remote.method()
def my_remote_method(self, request):
session = shared.session
...
--
- Rafe Kaplan