Python object encapsulation security
I got a question, and my decicion choosing Python as a possible language
for a bigger project depends on the answer - which I cannot give to
myself:
We all know that Python has no real object encapsulation, so there is no
thing like "private" properties of an object. Guido van Rossum says to the
issue that one can access hidden parts of a foreign object without being
"allowed" to, with "we are all adults", "just don't do it". I can live
perfectly well with that, as long as the software I write is in my own
hand, so I am responsible for my own errors, and just can try to avoid
such things.
BUT - and here comes my quest, ion: What if I provide a plugin framework
with some plugins that have some extension points, and many of the plugins
are by OTHER people, maybe ones that I can not trust completely.
How do I prevent exposing internals of my framework from being accessed by
a plugin?
Is there a way to achieve this, or is the only way to use Python having
confidence that noone will abuse my API?
No comments:
Post a Comment