octoprint.user => octoprint.access.user
This commit is contained in:
1 parent
4df57cd8fe
commit
008cde6ef6
11 files changed
+21
-21
No files matched your search
+1
-1
@@ -555,7 +555,7 @@ You can find out more about the change, how to know if a plugin is even affected
|
||||
* Make timeout after which to unload the webcam stream after navigating away from it configurable (as suggested in [#1937](https://github.com/foosel/OctoPrint/issues/1937))
|
||||
* Add `ToolChange` event and tool change GCODE scripts
|
||||
* Support parsing GCODE subcodes.
|
||||
* Add `octoprint.users.factory` hook, allowing plugins to extend/swap out the user manager OctoPrint uses.
|
||||
* Add `octoprint.access.users.factory` hook, allowing plugins to extend/swap out the user manager OctoPrint uses.
|
||||
* Corewizard: Disable view model and client code if it's not actually required.
|
||||
* Corewizard: Disable injection of JS files into UI when it's not actually required.
|
||||
* GCODE analysis: Moved into its own subprocess. That should improve performance on multi core systems.
|
||||
|
||||
@@ -29,7 +29,7 @@ Use the following settings to enable access control:
|
||||
# The user manager implementation to use for accessing user information. Currently only a filebased
|
||||
# user manager is implemented which stores configured accounts in a YAML file (Default: users.yaml
|
||||
# in the default configuration folder, see below)
|
||||
userManager: octoprint.users.FilebasedUserManager
|
||||
userManager: octoprint.access.users.FilebasedUserManager
|
||||
|
||||
# The YAML user file to use. If left out defaults to users.yaml in the default configuration folder.
|
||||
userFile: /path/to/users.yaml
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
.. _sec-modules-users:
|
||||
|
||||
octoprint.users
|
||||
octoprint.access.users
|
||||
---------------
|
||||
|
||||
.. automodule:: octoprint.users
|
||||
.. automodule:: octoprint.access.users
|
||||
:members:
|
||||
|
||||
|
||||
@@ -241,7 +241,7 @@ octoprint.accesscontrol.keyvalidator
|
||||
|
||||
``apikey`` will be the API key as read from the request headers.
|
||||
|
||||
Hook handlers are expected to return a :class:`~octoprint.users.User` instance here that will then be considered that
|
||||
Hook handlers are expected to return a :class:`~octoprint.access.users.User` instance here that will then be considered that
|
||||
user making the request. By returning ``None`` or nothing at all, hook handlers signal that they do not handle the
|
||||
provided key.
|
||||
|
||||
@@ -259,7 +259,7 @@ octoprint.accesscontrol.keyvalidator
|
||||
|
||||
:param str apikey: The API key to validate
|
||||
:return: The user in whose name the request will be processed further
|
||||
:rtype: :class:`~octoprint.users.User`
|
||||
:rtype: :class:`~octoprint.access.users.User`
|
||||
|
||||
.. _sec-plugins-hook-cli-commands:
|
||||
|
||||
@@ -1063,7 +1063,7 @@ octoprint.printer.factory
|
||||
* ``file_manager``: The :class:`~octoprint.filemanager.FileManager`
|
||||
* ``app_session_manager``: The :class:`~octoprint.server.util.flask.AppSessionManager`
|
||||
* ``plugin_lifecycle_manager``: The :class:`~octoprint.server.LifecycleManager`
|
||||
* ``user_manager``: The :class:`~octoprint.users.UserManager`
|
||||
* ``user_manager``: The :class:`~octoprint.access.users.UserManager`
|
||||
* ``preemptive_cache``: The :class:`~octoprint.server.util.flask.PreemptiveCache`
|
||||
|
||||
If the factory returns anything but ``None``, it will be assigned to the global ``printer`` instance.
|
||||
@@ -1549,12 +1549,12 @@ octoprint.ui.web.templatetypes
|
||||
|
||||
.. _sec-plugins-hook-users-factory:
|
||||
|
||||
octoprint.users.factory
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
octoprint.access.users.factory
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
.. py:function:: user_manager_factory_hook(components, settings, *args, **kwargs)
|
||||
|
||||
Return a :class:`~octoprint.users.UserManager` instance to use as global user manager object. This will
|
||||
Return a :class:`~octoprint.access.users.UserManager` instance to use as global user manager object. This will
|
||||
be called only once during initial server startup.
|
||||
|
||||
The provided ``components`` is a dictionary containing the already initialized system components:
|
||||
@@ -1573,7 +1573,7 @@ octoprint.users.factory
|
||||
|
||||
If none of the registered factories return a user manager instance, the class referenced by the ``config.yaml``
|
||||
entry ``accessControl.userManager`` will be initialized if possible, otherwise a stock
|
||||
:class:`~octoprint.users.FilebasedUserManager` will be instantiated, linked to the default user storage
|
||||
:class:`~octoprint.access.users.FilebasedUserManager` will be instantiated, linked to the default user storage
|
||||
file ``~/.octoprint/users.yaml``.
|
||||
|
||||
:param dict components: System components to use for user manager instance initialization
|
||||
|
||||
@@ -44,7 +44,7 @@ An overview of these properties follows.
|
||||
``self._app_session_manager``
|
||||
OctoPrint's application session manager, an instance of :class:`octoprint.server.util.flask.AppSessionManager`.
|
||||
``self._user_manager``
|
||||
OctoPrint's user manager, an instance of :class:`octoprint.users.UserManager`.
|
||||
OctoPrint's user manager, an instance of :class:`octoprint.access.users.UserManager`.
|
||||
``self._connectivity_checker``
|
||||
OctoPrint's connectivity checker, an instance of :class:`octoprint.util.ConnectivityChecker`.
|
||||
|
||||
|
||||
@@ -66,7 +66,7 @@ class OctoPrintPlugin(Plugin):
|
||||
|
||||
.. attribute:: _app_session_manager
|
||||
|
||||
The :class:`~octoprint.users.SessionManager` instance. Injected by the plugin core system upon initialization of
|
||||
The :class:`~octoprint.access.users.SessionManager` instance. Injected by the plugin core system upon initialization of
|
||||
the implementation.
|
||||
|
||||
.. attribute:: _plugin_lifecycle_manager
|
||||
@@ -76,7 +76,7 @@ class OctoPrintPlugin(Plugin):
|
||||
|
||||
.. attribute:: _user_manager
|
||||
|
||||
The :class:`~octoprint.users.UserManager` instance. Injected by the plugin core system upon initialization
|
||||
The :class:`~octoprint.access.users.UserManager` instance. Injected by the plugin core system upon initialization
|
||||
of the implementation.
|
||||
|
||||
.. attribute:: _connectivity_checker
|
||||
|
||||
@@ -91,8 +91,8 @@ class AclSubwizard(object):
|
||||
# disable access control
|
||||
self._settings.global_set_boolean(["accessControl", "enabled"], False)
|
||||
|
||||
octoprint.server.loginManager.anonymous_user = octoprint.users.DummyUser
|
||||
octoprint.server.principals.identity_loaders.appendleft(octoprint.users.dummy_identity_loader)
|
||||
octoprint.server.loginManager.anonymous_user = octoprint.access.users.DummyUser
|
||||
octoprint.server.principals.identity_loaders.appendleft(octoprint.access.users.dummy_identity_loader)
|
||||
|
||||
self._user_manager.disable()
|
||||
self._settings.save()
|
||||
|
||||
@@ -398,7 +398,7 @@ class Server(object):
|
||||
components.update(dict(group_manager=groupManager))
|
||||
|
||||
# create user manager instance
|
||||
user_manager_factories = pluginManager.get_hooks("octoprint.users.factory") # legacy, set first so that new wins
|
||||
user_manager_factories = pluginManager.get_hooks("octoprint.access.users.factory") # legacy, set first so that new wins
|
||||
user_manager_factories.update(pluginManager.get_hooks("octoprint.access.users.factory"))
|
||||
for name, factory in user_manager_factories.items():
|
||||
try:
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
"""
|
||||
Unit tests for octoprint.users.UserManager
|
||||
Unit tests for octoprint.access.users.UserManager
|
||||
"""
|
||||
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
from __future__ import absolute_import, division, print_function
|
||||
|
||||
"""
|
||||
Unit tests for octoprint.users
|
||||
Unit tests for octoprint.access.users
|
||||
"""
|
||||
|
||||
__license__ = 'GNU Affero General Public License http://www.gnu.org/licenses/agpl.html'
|
||||
|
||||
@@ -15,7 +15,7 @@ import octoprint.util
|
||||
class MiscTestCase(unittest.TestCase):
|
||||
|
||||
def test_get_class(self):
|
||||
octoprint.util.get_class("octoprint.users.FilebasedUserManager")
|
||||
octoprint.util.get_class("octoprint.access.users.FilebasedUserManager")
|
||||
|
||||
def test_get_class_wrongmodule(self):
|
||||
try:
|
||||
@@ -27,7 +27,7 @@ class MiscTestCase(unittest.TestCase):
|
||||
|
||||
def test_get_class_wrongclass(self):
|
||||
try:
|
||||
octoprint.util.get_class("octoprint.users.FilebasedUserManagerBzzztWrong")
|
||||
octoprint.util.get_class("octoprint.access.users.FilebasedUserManagerBzzztWrong")
|
||||
self.fail("This should have thrown an ImportError")
|
||||
except ImportError:
|
||||
# success
|
||||
|
||||
Reference in new issue
Block a user