@@ -6,34 +6,43 @@ The plugin reads by default the file `src-tauri/src-python/main.py` during
66startup and runs it immediately. Python functions are then registered during initialization
77and can get called during application workflow.
88
9- Python code can be registered and called from javascript without the
10- requirement to touch rust code at all.
11- You can still use rust to register all python functions if you have any security concerns,
12- for example when using inputs from other network interfaces.
13- The first call of a function will prevent registering further python functions.
9+
10+ | Platform | Supported |
11+ | -------- | --------- |
12+ | Linux | ✓ |
13+ | Windows | ✓ |
14+ | macOS | ✓ |
15+ | Android | not yet |
16+ | iOS | not yet |
1417
1518
1619You might use this plugin to create simple prototype applications
1720and later re-write functions in rust to improve
1821performance, add a specific rust library or just call some
1922low-level code.
2023
24+ Android and iOS are possible in theory but I still need to figure out how to
25+ cross compile python and PyO3 for iOS and android.
26+
27+ Also, this plugin hasn't been optimized yet for production binaries.
28+ The target platform therefore either needs to have libpython installed
29+ or you manually need to ship the shared libs together with the installer package.
30+
2131## Example app
2232
2333There is a sample Desktop application for Windows/Linux/MacOS using this plugin and vanilla
2434Javascript in [ examples/plain-javascript] ( https://github.com/marcomq/tauri-plugin-python/tree/main/examples/plain-javascript )
2535
2636## Security considerations
27- This plugin can make it possible to run arbitrary python code that is injected
28- via Javascript code. It is therefore highly recommended to ** not make the user
29- interface accessible by a network URL** . Otherwise, an XSS vulnerability could
30- be used to run random code on the server.
31-
32- As countermeasuer, the "runPython" command is disabled by default. This function
33- must not be enabled, once the UI is accessible by network URL.
34- In addition, the "registerFunction" command cannot be called again once the
35- "callFunction" has been called one time. This should prevent re-adding python code,
36- once a user has performed any activity in the UI
37- This is not supposed to be a full protection against remote attacks.
38-
39- The plugin should only be used in standalone Desktop, MacOS, IOS or Android mode.
37+ Generally, this plugin has been created by "security by default" concept and is
38+ expected to be nearly as secure as normal tauri applications.
39+
40+ Keep in mind that this plugin can also make it possible to run arbitrary python code
41+ It is therefore highly recommended to ** not make the user interface accessible by a network URL** .
42+
43+ The "runPython" command is disabled by default via permissions. If enabled, it is possible to
44+ inject python code via javascript.
45+ Also, the function "register" is disabled by default. If enabled, it can
46+ add control from javascript which functions can be called.
47+ Both functions can be enabled during development for rapid prototyping.
48+
0 commit comments