Pluggable Zope authentication / authorization framework
This product defines a fully-pluggable user folder, intended for use in all Zope sites.
The normal way it install this package is via setuptools, either via pip into a virtual environment:
$ cd /path/to/virtualenv $ bin/pip install Products.PluggableAuthService
or by including the package in the configuration for a zc.buildout-based deployment:
$ cd /path/to/buildout $ grep "eggs =" buildout.cfg ... eggs = Products.PluggableAuthService ...
The product can also be installed as a dependency of another distribution.
Please see the files under doc/ in the packaged software for more information, and consult the interfaces files under interfaces/ in the software package for PluggableAuthService and plugin APIs.
The documentation is also online available at https://productspluggableauthservice.readthedocs.io/.
- Tighten down security on several login string transformation methods (#88)
- Fix remaining open redirect sources
- Fix missing access control on ZODB Role Manager enumerateRoles
- Fix open redirect issue in Cookie Auth Helper redirect handling
- Add support for Python 3.9.
- Renamed xml dir to xml_templates. This avoids an import warning on Python 2.7.
- Disable ZMI CSRF check and log it if sessioning is not available instead of breaking ZMI interactions
- Clear caches before sending group user added/removed events (#71)
- Prevent creation of users/groups/roles with empty ID in the ZODB (#70)
- update configuration for version 5 of isort
- no longer rely on ZServer for any WebDAV-related functionality. (#64)
- Replace all filter(None...) expressions which break under Python 3 (#63)
- Fix broken ICredentialsUpdatedEvent event handler call to updateCredentials. (#59)
- Add new events to be able to notify when a principal is added to or removed from a group. Notify these events when principals are added or removed to a group in ZODBGroupManager (#17)
- Fix bug in getRolesForPrincipal for non PAS user.
- Drop unused .utils.allTests method.
- fixed usage of deprecated im_self (#40)
- simplified Travis CI test configuration
- added stricter linting configuration
- added project_urls to the setup so PyPI shows more relevant links
- added project badges to the README, which will show on the GitHub front page
- Fix ZMI Templates and add ZMI icons for Zope 4 (#36)
- Add support for Python 3.7.
- Do not override a previously set response body in HTTPBasicAuthHelper.challenge() allowing to set the response body via an exception view in Zope >= 4.0b6.
- Add new event to be able to notify group creation.
- Refactoring to make it easier to override updateCredentials.
- The dependency on ZServer is now optional. To use the features which require ZServer (WebDav, XML-RPC, FTP) use the setuptools extra zserver when installing the package.
- Do not fail when our base profiles are already registered. This may happen in tests if our initialize code is called twice.
- Add support for Python 3.
- Reformatted code for PEP-8 compliance.
- Require Zope 4.0b5 as minimum Zope version.
- Add new event to be able to notify group deletion.
- Fix usage of os.path.split(). Could result in Errors during import on Windows.
- Allow specifying a policy for transforming / normalizing login names
for all plugins in a PAS:
- Added login_transform string property to PAS.
- Added applyTransform method to PAS, which looks for a method on PAS with the name specified in the login_transform property.
- Added two possible transforms to PAS: lower and upper.
- Changed the methods of PAS to call applyTransform wherever needed.
- Added the existing updateUser method of ZODBUserManager to the IUserEnumerationPlugin interface.
- Added a new updateEveryLoginName method to ZODBUserManager and the IUserEnumerationPlugin interface.
- Added three methods to PAS and IPluggableAuthService: updateLoginName, updateOwnLoginName, updateAllLoginNames. These methods call updateUser or updateEveryLoginName on every IUserEnumerationPlugin. Since these are later additions to the plugin interface, we log a warning when a plugin does not have these methods (for example the mutable_properties plugin of PlonePAS) but will not fail. When no plugin is able to update a user, this will raise an exception: we do not want to quietly let this pass when for example a login name is already taken by another user.
- Changing the login_transform property in the ZMI will call PAS.updateAllLoginNames, unless login_transform is the same or has become an empty string.
- The new login_transform property is empty by default. In that case, the behavior of PAS is the same as previously. The various applyTransform calls will have a (presumably very small) performance impact.
- Launchpad #1079204: Added CSRF protection for the ZODBUserManager, ZODBGroupManager, ZODBRoleManger, and DynamicGroupsPlugin plugins.
- Launchpad #649596: add a protocol for plugins which check whether a non-top-level PAS instance is “competent” to authenticate a given request; if not, the instance defers to higher-level instances. Thanks to Dieter Maurer for the patch.
- Added export / import support for the ChallengeProtocolChooser plugin’s label - protocols mapping.
- In authenticateCredentials do NOT fall back to using the login as userid when there is no match, as that gives a high chance of seeming to log in successfully, but in reality failing. [maurits]
- Explicitly encode/decode data for GS
- Launchpad #795086: fixed creation of PropertiesUpdated event.
- Launchpad #789858: don’t allow conflicting login name in ‘updateUser’.
- Set appropriate cache headers on CookieAuthHelper login redirects to prevent caching by proxy servers.
- Added forward compatibility with DateTime 3.
- In the ZODBRoleManager made it clearer that adding a removing a role does not have much effect if you do not do the same in the root of the site (at the bottom of the Security tab at manage_access). Fixes https://bugs.launchpad.net/zope-pas/+bug/672694
- Return the created user in _doAddUser, to match change in AccessControl 2.13.4.
- Fixed possible binascii.Error in extractCredentials of CookieAuthHelper. This is a corner case that might happen after a browser upgrade.
- Allow for a query string in CookieAuthHelper’s login_path.
- Trap “swallowable” exceptions from IRoles plugins. Thanks to Willi Langenburger for the patch. Fixes https://bugs.launchpad.net/zope-pas/+bug/615474 .
- Fixed possible TypeError in extractCredentials of CookieAuthHelper when the __ac cookie is not ours (but e.g. from plone.session, though even then only in a corner case).
- Fixed chameleon incompatibilities
- Made ZODBRoleManager.assignRoleToPrincipal raise and log a more informative error when detecting a duplicate principal. https://bugs.launchpad.net/zope-pas/+bug/348795
- Updated DynamicGroupsPlugin.enumerateGroups to return an empty sequence for an unknown group ID, rather than raising KeyError. https://bugs.launchpad.net/zope-pas/+bug/585365
- Updated all code to raise new-style exceptions.
- Removed dependency on zope.app.testing.
- Cleaned out a number of old imports, because we now require Zope >= 2.12.
- Updated setDefaultRoles to use the addPermission API if available.
- Allow CookieAuthHelper’s login_path to be set to an absolute url for integration with external authentication mechanisms.
- Fixed xml templates directory path computation to allow reuse of SimpleXMLExportImport class outside Products.PluggableAuthService.
- Modify ZODBGroupManager to update group title and description independently.
- This release requires for Zope2 >= 2.12.
- Simplified buildout to just what is needed to run tests.
- Don’t fail on users defined in multiple user sources on the ZODBGroupManager listing page.
- Fixed deprecation warnings for use of Globals under Zope 2.12.
- Fixed deprecation warnings for the md5 and sha modules under Python >= 2.6.
- Added test for multiple auth header support in the HTTPBasicAuthHelper.
- Changed HTTPBasicAuthHelper to not rely on one obscure feature of the HTTPResponse.
- Launchpad #420319: Fix misconfigured startswith match type filter in Products.PluggableAuthService.plugins.DomainAuthHelper.
- Fixed test setup for tests using page templates relying on the DefaultTraversable adapter.
- Fixed broken markup in templates.
- Launchpad #273680: Avoid expensive / incorrect dive into enumerateUsers when trying to validate w/o either a real ID or login.
- Launchpad #300321: Products.PluggableAuthService.pluginsZODBGroupManager.enumerateGroups failed to find groups with unicode IDs.
- Fixed another deprecation for manage_afterAdd occurring when used together with Five (this time for the ZODBRoleManager class).
- Ensure the _findUser cache is invalidated if the roles or groups for a principal change.
- Launchpad #15569586: docstring fix.
- Factored out filter logic into separate classes; added filters for startswith test and (if the IPy module is present) IP-range tests. See https://bugs.launchpad.net/zope-pas/+bug/173580 .
- Zope 2.12 compatibility - removed Interface.Implements import if zope.interface available.
- Ensure ZODBRoleManagerExportImport doesn’t fail if it tries to add a role that already exists (idempotence is desirable in GS importers)
- Fixed tests so they run with Zope 2.11.
- Split up large permission tests into individual tests.
- Fixed deprecation warning occurring when used together with Five. (manage_afterAdd got undeprecated.)
- Added buildout.
- ZODBUserManager plugin: allow unicode arguments to enumerateUsers. (https://bugs.launchpad.net/zope-pas/+bug/189627)
- plugins/ZODBRoleManager: added logging in case searchPrincipial() returning more than one result (which might happen in case of having duplicate id within difference user sources)
- DomainAuthHelper plugin: fix glitch for plugins which have never configured any “default” policy: authenticateCredentials and getRolesForPrincipal would raise ValueError. (http://www.zope.org/Collectors/PAS/59)
- PluggableAuthService._verifyUser: changed to use exact_match to the enumerator, otherwise a user with login foobar might get returned by _verifyUser for a query for login='foo' because the enumerator happened to return ‘foobar’ first in the results.
- Add a test for manage_zmi_logout and replace a call to isImplementedBy with providedBy. (http://www.zope.org/Collectors/PAS/58)
- Add support for property plugins returning an IPropertySheet to PropertiedUser. Added addPropertysheet to the IPropertiedUser.
- Added a method to the IRoleAssignerPlugin to remove roles from a principal, and an implementation for it on the ZODBRoleManager. (http://www.zope.org/Collectors/PAS/57)
- Added events infrastructure. Enabled new IPrincipalCreatedEvent and ICredentialsUpdatedEvent events.
- Added support for registering plugin types via ZCML.
- Implemented authentication caching in _extractUserIds.
- Ported standard user folder tests from the AccessControl test suite.
- Passwords with “:” characters would break authentication (http://www.zope.org/Collectors/PAS/51)
- Corrected documented software dependencies
- Converted to publishable security sensitive methods to only accept POST requests to prevent XSS attacks. See http://www.zope.org/Products/Zope/Hotfix-2007-03-20/announcement and http://dev.plone.org/plone/ticket/6310
- Fixed issue in the user search filter where unrecognized keyword arguments were ignored resulting in duplicate search entries. (http://dev.plone.org/plone/ticket/6300)
- Made sure the Extensions.upgrade script does not commit full transactions but only sets (optimistic) savepoints. Removed bogus Zope 2.7 compatibility in the process. (http://www.zope.org/Collectors/PAS/55)
- Made the CookieAuthHelper only use the __ac_name field if __ac_password is also present. This fixes a login problem for CMF sites where the login name was remembered between sessions with an __ac_name cookie.
- Made the DomainAuthHelper return the remote address, even it the remote host is not available (http://www.zope.org/Collectors/PAS/49).
- Fixed bug in DelegatingMultiPlugin which attempted to validate the supplied password directly against the user password - updated to use AuthEncoding.pw_validate to handle encoding issues
- Fixed serious security hole in DelegatingMultiPlugin which allowed Authentication if the EmergencyUser login was passed in. Added password validation utilizing AuthEncoding.pw_validate
- Fixed a set of tests that tested values computed from dictionaries and could break since dictionaries are not guaranteed to have any sort order.
- Fixed test breakage induced by use of Z3 pagetemplates in Zope 2.10+.
- BasePlugin: The listInterfaces method only considered the old-style __implements__ machinery when determining interfaces provided by a plugin instance.
- ZODBUserManager: Already encrypted passwords were encrypted again in addUser and updateUserPassword. (http://www.zope.org/Collectors/Zope/1926)
- Made sure the emergency user via HTTP basic auth always wins, no matter how borken the plugin landscape.
- Cleaned up code in CookieAuthHelper which allowed the form to override login/password if a cookie had already been set.
- Removed some BBB code for Zope versions < 2.8, which is not needed since we require Zope > 2.8.5 nowadays.
- Extended the DomainAuthHelper to function as its own extraction plugin, to allow for the case that another extractor is registered, but does not return any credentials. (http://www.zope.org/Collectors/PAS/46)
- Re-worded parts of the README so they don’t point to specific or non-existing files (http://www.zope.org/Collectors/PAS/6 and http://www.zope.org/Collectors/PAS/47)
- Created a “Configured PAS” entry in the ZMI add list, which allows creating a PAS using base and extension GenericSetup profiles registered for IPluggableAuthService. This entry should eventually replace the “stock” PAS entry (assuming that we make GenericSetup a “hard” dependency).
- Added an “empty” GenericSetup profile, which creates a PAS containing only a plugin registry and a setup tool.
- Repaired the “simple” GenericSetup profile to be useful, rather than catastrophic, to apply: it now creates and registers a set of ZODB-based user / group / role plugins, along with a basic auth helper.
- ZODBUserManager: Extend the “notional IZODBUserManager interface” with the left-out updateUser facility and a corresponding manage_updateUser method for ZMI use. Removed any responsibility for updating a user’s login from the updateUserPassword and manage_updateUserPassword methods. This fixes the breakage described in the collector issue below, and makes the ZMI view for updating users work in a sane way. (http://www.zope.org/Collectors/PAS/42)
- CookieAuthHelper: If expireCookie was called and extractCredentials was hit in the same request, the CookieAuthHelper would throw an exception (http://www.zope.org/Collectors/PAS/43)
- Added a DEPENDENCIES.txt. (http://www.zope.org/Collectors/PAS/44)
- No changes from version 1.3-beta
- Modify CookieAuthHelper to prefer __ac form variables to the cookie when extracting credentials. (https://dev.plone.org/plone/ticket/5355)
- Fix manage_zmi_logout which stopped working correctly as soon as the PluggableAuthService product code was installed by correcting the monkeypatch for it in __init__.py. (http://www.zope.org/Collectors/PAS/12)
- Add missing interface for IPropertiedUser and tests (http://www.zope.org/Collectors/PAS/16)
- Removed STX links from README.txt which do nothing but return 404s when clicked from the README on zope.org. (http://www.zope.org/Collectors/PAS/6)
- Fixing up inconsistent searching in the listAvailablePrincipals method of the ZODBRoleManager and ZODBGroupManager plugins. Now both constrain searches by ID. (http://www.zope.org/Collectors/PAS/11)
- Convert from using zLOG to using the Python logging module. (http://www.zope.org/Collectors/PAS/14)
- Added suppport for exporting / importing a PAS and its content via the GenericSetup file export framework.
- Made ZODBRoleManager plugin check grants to the principal’s groups, as well as those made to the principal directly.
- Added two new interfaces, IChallengeProtocolChooser and IRequestTypeSniffer. Those are used to select the ‘authorization protocol’ or ‘challenger protocol’ to be used for challenging according to the incoming request type.
- Repaired warings appearing in Zope 2.8.5 due to a couple typos in security declarations.
- Repaired DeprecationWarnings due to use of Zope2 interface verification.
- Repaired unit test breakage (unittest.TestCase instances have ‘failUnless’/’failIf’, rather than ‘assertTrue’/’assertFalse’).
- Fixed a couple more places where Zope 2-style __implements__ were being used to standardize on using classImplements.
- Fixed fallback implementations of providedBy and implementedBy to always return a tuple.
- Make sure challenge doesn’t break if existing instances of the PluginRegistry don’t yet have IChallengeProtocolChooser as a registered interface. (Would be nice to have some sort of migration for the PluginRegistry between PAS releases)
- Don’t assume that just because zope.interface can be imported that Five is present.
- Repaired a missing ‘nocall:’ in the Interfaces activation form.
- PAS-level id mangling is no more. All (optional) mangling is now done on a per-plugin basis.
- Interfaces used by PAS are now usable in both Zope 2.7 and 2.8 (Five compatible)
- Simplified detection of the product directory using ‘package_home’.
- Set a default value for the ‘login’ attribute of a PAS, to avoid UnboundLocalError.
- Made ‘Extensions’ a package, to allow importing its scripts as modules.
- Declared new ‘IPluggableAuthService’ interface, describing additional PAS-specific API.
- Exposed PAS’ ‘resetCredentials’ and ‘updateCredentials’ as public methods.
- Monkey-patch ZMI’s logout to invoke PAS’ ‘resetCredentials’, if present.
- CookieAuth plugin now encodes and decodes cookies in the same format as CookieCrumbler to provide compatibility between sites running PAS and CC.
- Add a publicly callable “logout” method on the PluggableAuthService instance that will call resetCredentials on all activated ICredentialsRest plugins, thus effecting a logout.
- Enabled the usage of the CookieAuthHelper login screen functionality without actually using the CookieAuthHelper to maintain the credentials store in its own auth cookie by ensuring that only active updateCredentials plugins are informed about a successful login so they can store the credentials.
- Added a _getPAS method to the BasePlugin base class to be used as the canonical way of getting at the PAS instance from within plugins.
- Group and user plugins can now specify their own title for a principal entry (PAS will not compute one if they do).
- PAS and/or plugins can now take advantage of caching using the Zope ZCacheable framework with RAM Cache Managers. See doc/caching.stx for the details.
- Make ‘getUserById’ pass the ‘login’ to ‘_findUser’, so that the returned user object can answer ‘getUserName’ sanely.
- Harden ‘logout’ against missing HTTP_REFERRER.
- Avoid triggering “Emergency user cannot own” when adding a CookieAuthHelper plugin as that user.
- Detect and prevent recursive redirecting in the CookieAuthHelper if the login_form cannot be reached by the Anonymous User.
- Made logging when swallowing exceptions much less noisy (they don’t necessarily require attention).
- Clarified interface of IAuthenticationPlugin, which should return None rather than raising an exception if asked to authenticate an unknown principal; adjusted ZODBUserManager accordingly.
- Don’t log an error in zodb_user_plugin’s authenticateCredentials if we don’t have a record for a particular username, just return None.
- If an IAuthenticationPlugin returns None instead of a tuple from authenticateCredentials, don’t log a tuple-unpack error in PAS itself.
- Implemented support for issuing challenges via IChallengePlugins.
- three challenge styles in particular:
- HTTP Basic Auth
- CookieCrumbler-like redirection
- Inline authentication form
- three challenge styles in particular:
- Made unit tests pass when run with cAccessControl.
- plugins/ZODBRoleManager.py: don’t claim authority for ‘Authenticated’ or ‘Anonymous’ roles, which are managed by PAS.
- plugins/ZODBRoleManager.py: don’t freak out if a previously assigned principal goes away.
- plugins/ZODBGroupManager.py: don’t freek out if a previously assigned principal goes away.
- plugins/ZODBUserManager.py: plugin now uses AuthEncoding for its password encryption so that we can more easily support migrating existing UserFolders. Since PAS has been out for a while, though, we still will authenticate against old credentials
- Repaired arrow images in two-list ZMI views.
- searchPrincipals will work for exact matches when a plugin supports both ‘enumerateUsers’ and ‘enumerateGroups’.
- ‘Authenticated’ Role is now added dynamically by the PluggableAuthService, not by any role manager
- Added WARNING-level logs with tracebacks for all swallowed plugin exceptions, so that you notice that there is something wrong with the plugins.
- All authenticateCredentials() returned a single None when they could not authenticate, although all calls expected a tuple.
- The user id in extract user now calls _verifyUser to get the ID mangled by the enumeration plugin, instead of mangling it with the authentication ID, thereby allowing the authentication and enumeration plugins to be different plugins.
- ZODBRoleManager and ZODBGroupManager needed the “two_lists” view, and associated images, which migrated to the PluginRegsitry product when they split; restored them.
- CookieAuth plugin didn’t successfully set cookies (first, because of a NameError, then, due to a glitch with long lines).
- Missing ZPL in most modules.
- Initial release
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size Products.PluggableAuthService-2.6.3-py2.py3-none-any.whl (225.9 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size Products.PluggableAuthService-2.6.3.tar.gz (161.3 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for Products.PluggableAuthService-2.6.3-py2.py3-none-any.whl
Hashes for Products.PluggableAuthService-2.6.3.tar.gz