Re: metadata and decorators are coming your way
Irmen de Jong <[email protected]> Wed, 09 Jul 2014 20:32:32 +0200
| Newsgroups | gmane.comp.python.pyro |
|---|---|
| Message-ID | <[email protected]> |
On 9-7-2014 15:54, Éric Piel wrote: > Hi Irmen, > That's an exciting news! That's one of the main reason I had a fork of > Pyro4 :-) Transparent remote attribute access would be great. Great, would be nice if you don't have to depend on a fork anymore! > Definitely, by default it should not be needed to add @exposed attribute > to any method/attribute to have it shared. But it feels strange that if > you just add one @expose, suddenly all the other things are hidden. > Maybe a @noremote decorator to hide a specific method would be easier to > use? Mhmhmmm nah, I really prefer going the way that would be "secure by default" eventually. That means that unless you tell Pyro otherwise, stuff is not exposed to remote calls. I'm not entirely sure on how to do it but a possibility is to do the following: - for now, leave the current mode unchanged: everything exposed. - add @export decorator and new config item to switch to new mode (REQUIRE_EXPOSE?) - in the backwards compatible mode @export won't do anything, because everything is already exposed anyway - in new mode you'll have to add @expose to the methods otherwise they're unexposed. What do you think of this scheme? > Also, I'd love to see the proxy raise an AttributeError when an > attribute/method doesn't exist (instead of returning a RemoteMethod). > That'd would allow to have things like hasattr() work on a proxy too. It > could be implemented by querying the metadata whenever access to an > attribute yet unknown is done (so only the first access and the > AttributeError exceptions would be a slow path). This is more or less what I have in mind yes. > My 2 cents ;-) > Best, > Éric Thanks for the input! Cheers Irmen PS I notice you're affiliated with the TU Delft? Can I ask what you are using Pyro for? ------------------------------------------------------------------------------ Open source business process management suite built on Java and Eclipse Turn processes into business applications with Bonita BPM Community Edition Quickly connect people, data, and systems into organized workflows Winner of BOSSIE, CODIE, OW2 and Gartner awards http://p.sf.net/sfu/Bonitasoft