repoze.whoplugins.zodb 1.0.1

Creator: railscoder56

Last updated:

0 purchases

repoze.whoplugins.zodb 1.0.1 Image
repoze.whoplugins.zodb 1.0.1 Images

Languages

Categories

Add to Cart

Description:

repoze.whoplugins.zodb 1.0.1

-----------------------repoze.who.plugins.zodb-----------------------A repoze.who plugin to authenticate a userid and attach groupinformation based on information stored in a ZODB database.Using a who config file:.. code-block:: :linenos: [plugin:zodb] use = repoze.who.plugins.zodb:make_plugin zodb_uri = zeo://localhost:8884/ # see repoze.zodbconn users_finder = repoze.who.plugins.zodb:default_users_finder [authenticators] plugins = zodb [mdproviders] plugins = zodbUsing without a who config file:..code-block:: :linenos: from repoze.who.plugins.zodb import ZODBPlugin from repoze.who.plugins.zodb import default_users_finder plugin = ZODBPlugin('zeo://localhost:8884/', default_users_finder) ... then use plugin in a imperatively-configured repoze.who middleware setup..ZODB URI--------See the documentation for ``repoze.zodbconn`` (a dependent package) tounderstand the ``zodb_uri`` parameter.The ZODB URI will be ignored if the connection is provided in the WSGIenvironment by a WSGI component such as ``repoze.zodbconn#connector``.Users Finder------------The "users finder" must be a function that accepts the root object ofa ZODB database and returns an object that implements``repoze.who.plugins.zodb.interfaces.IUsers``. The defaultimplementation (``default_users_finder``) creates and stores theimplementation directly in the root itself under the key "users".Authenticator and Metadata Provider-----------------------------------The authenticator will authenticate the user's credentials against theinformation stored in the ``IUsers`` object.The metadata provider will attach group information to the identity(in the ``groups``) key based on information stored in the ``IUsers``object.Impersonation Plugin--------------------This package provides a repoze.who plugin that allows superusers to login as other users for testing purposes, without knowing the otherusers' passwords. The impersonation plugin operates in tandem with anormal ZODB authentication plugin.Once the impersonation plugin is installed, users with superuserprivileges can use a special convention on the login form. Enter thename of the user to impersonate in the login field, then enter thesuperuser's name and password, separated by a colon, in the passwordfield. For example, if superuser ``alice`` wants to log in as ``bob``without knowing his password, and alice's password is ``123``, thenAlice can enter ``bob`` for the login field and ``alice:123`` for thepassword field. The system will authenticate Alice as ``bob``.Using a who config file:.. code-block:: :linenos: [plugin:zodb] use = repoze.who.plugins.zodb:make_plugin zodb_uri = zeo://localhost:8884/ # see repoze.zodbconn users_finder = repoze.who.plugins.zodb:default_users_finder [plugin:zodb_impersonate] use = repoze.who.plugins.zodb.impersonate:make_plugin plugin_name = zodb super_group = group.Superusers [authenticators] plugins = zodb zodb_impersonate [mdproviders] plugins = zodbThe required ``plugin_name`` parameter specifies a ZODB plugin to useto authenticate superusers and confirm their membership in thesuperuser group. The required ``super_group`` parameter specifies whichgroup users must belong to in order to allow impersonation.Both the ZODB plugin and the impersonation plugin should be configuredas authenticators. The impersonation plugin only attempts to authenticateimpersonation requests; it does not authenticate normal access.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.