[Kimchi-devel] [PATCH v2][Wok 0/8]

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Mon Jun 6 19:13:28 UTC 2016


V2:
Addresses Aline's review points and other problems found:
- Added test cases for pluginsmanager;
- Fixes Sample plugin and use it in test cases;
- Start Wok server only after command line option checking;
- Keep API /plugins due to problems with authentication and
  Wok initialization (see below);
- Keep API /pluginsmanager with authentication;

Authorization problem:
Tried to keep the API as pluginsmanager only, with authentication,
but got problem in UI login, due to the way Wok initializes (it 
requests the plugins, them tries to load the screen, once failing
it call the login screen)
With authentication, if user is not logged, plugins request fails
and the login is not showed.
So, I kept /plugins API without authentication to show only enabled
plugins and let Wok initializes flawlessly.
Then created the /pluginsmanager, which requires authentication and
allows to enable/disable plugins.
Created this issue to improve Wok:
https://github.com/kimchi-project/wok/issues/131
Idealy, /pluginsmanager GET should be unauthenticated (to list
plugins) but POST actions should require authentication, for
security


V1:
This is initial basic version of Plugins Manager.
Features:
- Improve plugins load and initialization;
- New API to enable/disable a given plugin;
- Update plugin configuration file;
- Fix UI in order make Wok work as usual;

ToDos (improvements):
- Update (enable/disable) plugin in cherrypy (live);
- Support to plugins dependencies;
- Add command-line options to enable-disable given plugins

Rodrigo Trujillo (8):
  Creates pluginmanager.py module
  Changes server behavior to use pluginsmanager
  Implements control/model of new plugin API
  Change plugins API documentation by pluginsmanager API
  Load Wok Server after options checkings
  Fix Sample plugin
  Fix test utils imports and add auth tests
  Add Plugins Manager test cases

 docs/API/plugins.md                                |  13 --
 docs/API/pluginsmanager.md                         |  61 ++++++
 src/wok/auth.py                                    |  15 +-
 src/wok/control/plugins.py                         |  31 ++-
 src/wok/i18n.py                                    |   3 +
 src/wok/model/plugins.py                           |  38 +++-
 src/wok/plugins/sample/__init__.py                 |  54 ++++-
 src/wok/plugins/sample/control/__init__.py         |  26 +++
 src/wok/plugins/sample/sample.conf.in              |  22 --
 src/wok/plugins/sample/ui/config/tab-ext.xml       |   9 +-
 .../plugins/sample/ui/pages/sample-tab1.html.tmpl  |   3 +
 .../plugins/sample/ui/pages/sample-tab2.html.tmpl  |   3 +
 src/wok/pluginsmanager.py                          | 238 +++++++++++++++++++++
 src/wok/root.py                                    |   8 +-
 src/wok/server.py                                  |  57 +----
 src/wok/utils.py                                   |  52 -----
 src/wokd.in                                        |   6 +-
 tests/test_plugin.py                               | 104 ++++++++-
 tests/test_server.py                               |  10 +-
 tests/utils.py                                     |   7 +-
 20 files changed, 582 insertions(+), 178 deletions(-)
 delete mode 100644 docs/API/plugins.md
 create mode 100644 docs/API/pluginsmanager.md
 create mode 100644 src/wok/plugins/sample/control/__init__.py
 create mode 100644 src/wok/pluginsmanager.py

-- 
2.1.0




More information about the Kimchi-devel mailing list