Re: Some questions
Bzzzz <[email protected]> Fri, 12 Dec 2014 03:05:35 +0100
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Organization | Anyone, anywhere BUT in banana demokratik republik of france |
| Message-ID | <[email protected]> |
On Thu, 11 Dec 2014 23:25:27 +0100 Irmen de Jong <[email protected]> wrote: > The problem was in Pyro's locateNS function. When it discovered the > name server via a broadcast lookup, it returned a proxy without > setting the proper hmac key. (It worked fine when it found the NS via > other means). > > Also your call to resolve() is fine -where you provided the hmac_key- > but it uses locateNS() internally and so failed in the same fashion as > your original code. > > > I've committed the fix for this, but you'll have to make a minor > change to your original code as well: make sure that you pass in a > hmac_key to the locateNS() function. Ok, the answer's down there:) > If you do this, you will receive > back a proxy that has the correct hmac key already set (so you don't > have to set its _pyroHmacKey property yourself anymore). Oh, that was also a question: whether to add the hmac key or not in any call, which could be boring when using multiple keys; so this one' solved too. > You do have > to set it on any new proxies you create because Pyro will not remember > the secret key anywhere. Ok, sounds logical. BTW, is there a possibility to have multiple hmac keys in only one instance of a NS? (AFA I can tell from the doc, it is not). > Can you try out the current MASTER version in Github with the above > mentioned little change in your code, and report back if this solves > your issue? I will then make it an official release. OK, this is now working as expected: ns = Pyro4.naming.locateNS( hmac_key=conf_cli.HMAC_KEY ) uri = ns.lookup( conf_cli.NS_REGISTERED_NAME ) DB = Pyro4.core.Proxy( uri ) DB._pyroHmacKey = conf_cli.HMAC_KEY What would be veeery niiice to have, would be an all-in-one, something like: DB = Pyro4.core.Proxy( conf_cli.NS_REGISTERED_NAME, conf_cli.HMAC_KEY ) Thanks for this fix, I'll keep this Pyro4 version installed. Crap, I feel like inspector Columbo: aheeemm, just one more question: is there a C hmac function that could be easily substituted to the Python's one? Jean-Yves ------------------------------------------------------------------------------ Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server from Actuate! Instantly Supercharge Your Business Reports and Dashboards with Interactivity, Sharing, Native Excel Exports, App Integration & more Get technology previously reserved for billion-dollar corporations, FREE http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk