Open kyrias opened 9 years ago
I haven't tested it, but as it is based on the xmlrpclib transport classes, it should support basic auth as is, using the http://user:pass@host:port/path
URL format. (again: not tested).
Else, it would be necessary to work on the Transport and SafeTransport classes to override the creation of the HTTP(S) connection.
I meant something like giving SimpleJSONRPCServer
a list of dicts containing combinations of usernames and passwords, so you could have different passwords for different users. I’ll see about looking into it later though.
In this case, you have to handle the basic authentication in the request handler. You can take a look at this blog post to see how it could be implemented (jsonrpclib inherits from xmlrpclib classes, so it should be easy to port). Maybe this could become a Mixin in jsonrpclib...
(Also, just tested regular basic auth URL syntax, and the header isn’t sent properly, so I will have to look into seeing about that first)
I haven’t had time to go through the library yet, but how hard would you estimate that it would be to add HTTP basic auth support?