Re: Some questions
Irmen de Jong <[email protected]> Wed, 12 Nov 2014 22:08:23 +0100
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 12-11-2014 19:59, Bzzzz wrote: > I've upgraded to 4.30 and try to use HMAC signature; my client is working > with one block of code, but not with the other one - I followed the > docs but I may not have understood it correctly: Any particular part that you are having troubles with? I try my best to write the docs but can always use help and improvements :) > work: > ----- > ns = Pyro4.naming.locateNS() > ns._pyroHmacKey = conf_cli.HMAC_KEY > uri = ns.lookup( "rpc.server" ) > DB = Pyro4.core.Proxy( uri ) > DB._pyroHmacKey = conf_cli.HMAC_KEY > DB._pyroTimeout = 30.0 > db_hash, _RIGHTS = DB.getRights( cli_db, cli_port, cli_user, cli_passwd, > cli_host ) Looking good. > doesn't: > -------- > DB = Pyro4.core.Proxy( "PYRONAME:rpc.server" ) > (BTW, as NS also have the same hmac key, how is it able to answer > that without throwing an error as there's no key in parms?) Creating a proxy doesn't do anything fancy yet. It gives you a proxy in an unconnected state, and only validated the syntax of the Uri. No network has been touched yet. > DB._pyroHmacKey = conf_cli.HMAC_KEY > Here, when calling the remote object, I've got this error: > cannot connect: hmac key config not symmetric Hmmmmmmmm you may have hit a snag here. There's the _pryoHmacKey property on the proxy. It will probably also be used when Pyro's internals are resolving the PYRONAME uri you're using in the proxy. This means you need to have a name server started with the same hmac as the other servers you are using from that proxy, or it won't be able to connect to the name server. Will investigate soon. Suggestions: - rollback to 4.29 and stick with the previous way of using hmacs, if that worked for you. If the above is indeed a problem I'll try to have it fixed somehow for 4.31 - try starting the 4.30 name server using the same hmac as your rpc.server is using > My other question is: if I log Pyro4 at debug level, I can see > clients' IP addresses; how can I retrieve them into my server? What do you want to achieve? Why not pass some identification token explicitly in the pyro remote calls? There's no official way of getting the information you're asking from within your Pyro server classes. Regards Irmen de Jong ------------------------------------------------------------------------------ Comprehensive Server Monitoring with Site24x7. Monitor 10 servers for $9/Month. Get alerted through email, SMS, voice calls or mobile push notifications. Take corrective actions from your mobile device. http://pubads.g.doubleclick.net/gampad/clk?id=154624111&iu=/4140/ostg.clktrk