lib
Kross::Python::PythonSecurity Class Reference
#include <pythonsecurity.h>
Detailed Description
This class handles the used Zope3 RestrictedPython package to spend a restricted sandbox for scripting code.The RestrictedPython code is avaible as Python files. So, this class takes care of loading them and spending the functions we need to access the functionality from within Kross. That way it's easy to update the module with a newer version if some security issues show up.
What the RestrictedPython code does is to compile the plain python code (py) into compiled python code (pyc) and manipulate those compiled code by replacing unsafe code with own wrapped code. As example a simple "x = y.z" would be transfered to "x = _getattr_(y, 'z')". The _getattr_ is defined in the RestrictedPython module and will take care of applied restrictions.
Definition at line 56 of file pythonsecurity.h.
Public Member Functions | |
PythonSecurity (PythonInterpreter *interpreter) | |
virtual | ~PythonSecurity () |
PyObject * | compile_restricted (const QString &source, const QString &filename, const QString &mode) |
Constructor & Destructor Documentation
|
Constructor.
Definition at line 28 of file pythonsecurity.cpp. |
|
Destructor.
Definition at line 52 of file pythonsecurity.cpp. |
Member Function Documentation
|
Compile python scripting code and return a restricted code object.
Definition at line 109 of file pythonsecurity.cpp. |
The documentation for this class was generated from the following files: