pyams-security 2.3.3__tar.gz → 2.4.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyams_security-2.3.3 → pyams_security-2.4.0}/PKG-INFO +10 -1
- {pyams_security-2.3.3 → pyams_security-2.4.0}/docs/HISTORY.rst +9 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/setup.py +1 -1
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/credential.py +1 -1
- pyams_security-2.4.0/src/pyams_security/doctests/credentials.rst +55 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/manager.rst +3 -3
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/policy.rst +2 -0
- pyams_security-2.4.0/src/pyams_security/locales/fr/LC_MESSAGES/pyams_security.mo +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/locales/fr/LC_MESSAGES/pyams_security.po +5 -4
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/locales/pyams_security.pot +5 -1
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/admin.py +28 -4
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/policy.py +7 -17
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/tests/__init__.py +1 -4
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/PKG-INFO +10 -1
- pyams_security-2.3.3/src/pyams_security/doctests/credentials.rst +0 -21
- pyams_security-2.3.3/src/pyams_security/locales/fr/LC_MESSAGES/pyams_security.mo +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/LICENSE +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/MANIFEST.in +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/docs/README.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/setup.cfg +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/__init__.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/api/__init__.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/README.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/notifications.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/passwords.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/plugins.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/principals.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/profiles.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/rest.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/roles.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/security.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/doctests/users.rst +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/generations/__init__.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/generations/evolve1.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/include.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/index.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/__init__.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/base.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/names.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/notification.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/plugin.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/profile.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/rest.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/interfaces/site.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/notification.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/password.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/permission.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/__init__.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/group.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/password-reset.pt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/register-body.pt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/register-info.pt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/register-message.pt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/userfolder.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/principal.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/profile.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/property.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/rest.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/role.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/schema.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/security.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/site.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/tests/test_utilsdocs.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/tests/test_utilsdocstrings.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/utility.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/vocabulary.py +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/SOURCES.txt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/dependency_links.txt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/entry_points.txt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/namespace_packages.txt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/not-zip-safe +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/requires.txt +0 -0
- {pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams_security
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: PyAMS security management package
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
@@ -54,6 +54,15 @@ store roles assigned to principals.
|
|
|
54
54
|
Changelog
|
|
55
55
|
=========
|
|
56
56
|
|
|
57
|
+
2.4.0
|
|
58
|
+
-----
|
|
59
|
+
- added internal service credentials plug-in
|
|
60
|
+
|
|
61
|
+
2.3.4
|
|
62
|
+
-----
|
|
63
|
+
- disable authentication of pre-authenticated credentials as defined by remote user
|
|
64
|
+
authentication package
|
|
65
|
+
|
|
57
66
|
2.3.3
|
|
58
67
|
-----
|
|
59
68
|
- added exception handler in identity getter
|
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
Changelog
|
|
2
2
|
=========
|
|
3
3
|
|
|
4
|
+
2.4.0
|
|
5
|
+
-----
|
|
6
|
+
- added internal service credentials plug-in
|
|
7
|
+
|
|
8
|
+
2.3.4
|
|
9
|
+
-----
|
|
10
|
+
- disable authentication of pre-authenticated credentials as defined by remote user
|
|
11
|
+
authentication package
|
|
12
|
+
|
|
4
13
|
2.3.3
|
|
5
14
|
-----
|
|
6
15
|
- added exception handler in identity getter
|
|
@@ -23,7 +23,7 @@ DOCS = os.path.join(os.path.dirname(__file__),
|
|
|
23
23
|
README = os.path.join(DOCS, 'README.rst')
|
|
24
24
|
HISTORY = os.path.join(DOCS, 'HISTORY.rst')
|
|
25
25
|
|
|
26
|
-
version = '2.
|
|
26
|
+
version = '2.4.0'
|
|
27
27
|
long_description = open(README).read() + '\n\n' + open(HISTORY).read()
|
|
28
28
|
|
|
29
29
|
tests_require = [
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
============================
|
|
3
|
+
Extracting users credentials
|
|
4
|
+
============================
|
|
5
|
+
|
|
6
|
+
As explained before, PyAMS authentication policy relies on several kinds of plugins, which
|
|
7
|
+
are used to extract credentials from a given request, and then to authenticate these credentials
|
|
8
|
+
(if any) against an internal or external users database (being a local users folder, an LDAP
|
|
9
|
+
directory or an external OAuth authority provider).
|
|
10
|
+
|
|
11
|
+
Credentials extraction is done by plugins which are external to PyAMS_security package; some
|
|
12
|
+
example are PyAMS_auth_http (to extract credentials from an Authorization header),
|
|
13
|
+
PyAMS_auth_jwt (to generate and validate JWT tokens), PyAMS_auth_oauth (to handle authentication
|
|
14
|
+
based on an OAuth provider) or PyAMS_auth_form (to authenticate using a classic login form).
|
|
15
|
+
|
|
16
|
+
All credentials plugins are tested sequentially, until one of them returns accepted credentials;
|
|
17
|
+
if none of them is returning credentials, the request is left as "unauthenticated"; otherwise,
|
|
18
|
+
these credentials are checked against the users database to authenticate the request.
|
|
19
|
+
|
|
20
|
+
Some authentication mechanisms can store credentials information into a cookie or an
|
|
21
|
+
authorization token, so that credentials are not always re-authenticated on every request.
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
Internal service credentials
|
|
25
|
+
----------------------------
|
|
26
|
+
|
|
27
|
+
Some utilities, like tasks scheduler, can create custom requests using a specific "internal
|
|
28
|
+
service" principal. These requests are authenticated using a custom credentials getter:
|
|
29
|
+
|
|
30
|
+
>>> from pyams_utils.request import check_request
|
|
31
|
+
>>> from pyams_security.interfaces.names import ADMIN_USER_ID, INTERNAL_USER_ID
|
|
32
|
+
>>> from pyams_security.plugin.admin import InternalUserCredentialsPlugin
|
|
33
|
+
|
|
34
|
+
>>> plugin = InternalUserCredentialsPlugin()
|
|
35
|
+
|
|
36
|
+
>>> request = check_request(principal_id=INTERNAL_USER_ID)
|
|
37
|
+
>>> credentials = plugin.extract_credentials(request)
|
|
38
|
+
>>> credentials is None
|
|
39
|
+
False
|
|
40
|
+
>>> credentials.prefix
|
|
41
|
+
'internal'
|
|
42
|
+
>>> credentials.id
|
|
43
|
+
'system:internal'
|
|
44
|
+
>>> credentials.attributes.get('pre_authenticated')
|
|
45
|
+
True
|
|
46
|
+
|
|
47
|
+
>>> request = check_request()
|
|
48
|
+
>>> credentials = plugin.extract_credentials(request)
|
|
49
|
+
>>> credentials is None
|
|
50
|
+
True
|
|
51
|
+
|
|
52
|
+
>>> request = check_request(principal_id=ADMIN_USER_ID)
|
|
53
|
+
>>> credentials = plugin.extract_credentials(request)
|
|
54
|
+
>>> credentials is None
|
|
55
|
+
True
|
|
@@ -85,9 +85,9 @@ use them:
|
|
|
85
85
|
|
|
86
86
|
>>> request = new_test_request('user1', 'passwd', registry=config.registry)
|
|
87
87
|
>>> list(sm.credentials_plugins_names)
|
|
88
|
-
[]
|
|
88
|
+
['internal-auth']
|
|
89
89
|
>>> list(sm.credentials_plugins)
|
|
90
|
-
[]
|
|
90
|
+
[<pyams_security.plugin.admin.InternalUserCredentialsPlugin object at 0x...>]
|
|
91
91
|
>>> list(sm.authentication_plugins)
|
|
92
92
|
[<...AdminAuthenticationPlugin object at 0x...>, <...AdminAuthenticationPlugin object at 0x...>, <...UsersFolder object at 0x...>]
|
|
93
93
|
>>> list(sm.directory_plugins)
|
|
@@ -174,7 +174,7 @@ Deleting plugins
|
|
|
174
174
|
>>> del sm['__system__']
|
|
175
175
|
>>> del sm['users']
|
|
176
176
|
>>> list(sm.credentials_plugins)
|
|
177
|
-
[]
|
|
177
|
+
[<pyams_security.plugin.admin.InternalUserCredentialsPlugin object at 0x...>]
|
|
178
178
|
>>> list(sm.authentication_plugins)
|
|
179
179
|
[<...AdminAuthenticationPlugin object at 0x...>]
|
|
180
180
|
>>> list(sm.directory_plugins)
|
|
@@ -154,6 +154,8 @@ Some tasks, like scheduler ones, can be run using a specific internal user ID:
|
|
|
154
154
|
|
|
155
155
|
>>> manager.clear()
|
|
156
156
|
>>> request = check_request(registry=config.registry, principal_id=INTERNAL_USER_ID)
|
|
157
|
+
>>> manager.push({'registry': config.registry, 'request': request})
|
|
158
|
+
|
|
157
159
|
>>> identity = request.identity
|
|
158
160
|
>>> identity is None
|
|
159
161
|
False
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
msgid ""
|
|
6
6
|
msgstr ""
|
|
7
7
|
"Project-Id-Version: PyAMS_security 1.0\n"
|
|
8
|
-
"POT-Creation-Date: 2024-
|
|
8
|
+
"POT-Creation-Date: 2024-07-02 09:14+0200\n"
|
|
9
9
|
"PO-Revision-Date: 2019-12-21 22:19+0100\n"
|
|
10
10
|
"Last-Translator: Thierry Florac <tflorac@ulthar.net>\n"
|
|
11
11
|
"Language-Team: French\n"
|
|
@@ -585,6 +585,10 @@ msgstr "Signature"
|
|
|
585
585
|
msgid "Text displayed in email footer"
|
|
586
586
|
msgstr "Ce texte sera affiché dans le pied des messages de notification"
|
|
587
587
|
|
|
588
|
+
#: src/pyams_security/plugin/admin.py:129
|
|
589
|
+
msgid "Internal request authentication"
|
|
590
|
+
msgstr "Authentification des services internes"
|
|
591
|
+
|
|
588
592
|
#: src/pyams_security/plugin/userfolder.py:216
|
|
589
593
|
#, python-format
|
|
590
594
|
msgid "{prefix}{subject}"
|
|
@@ -773,9 +777,6 @@ msgstr ""
|
|
|
773
777
|
#~ msgid "Enable JWT login?"
|
|
774
778
|
#~ msgstr "Autoriser l'authentification JWT ?"
|
|
775
779
|
|
|
776
|
-
#~ msgid "Enable login via JWT authentication"
|
|
777
|
-
#~ msgstr "Autoriser la connexion via un jeton JWT"
|
|
778
|
-
|
|
779
780
|
#~ msgid "JWT encoding algorithm"
|
|
780
781
|
#~ msgstr "Algorithme d'encodage JWT"
|
|
781
782
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
msgid ""
|
|
7
7
|
msgstr ""
|
|
8
8
|
"Project-Id-Version: PACKAGE 1.0\n"
|
|
9
|
-
"POT-Creation-Date: 2024-
|
|
9
|
+
"POT-Creation-Date: 2024-07-02 09:14+0200\n"
|
|
10
10
|
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
|
11
11
|
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
|
12
12
|
"Language-Team: LANGUAGE <LL@li.org>\n"
|
|
@@ -515,6 +515,10 @@ msgstr ""
|
|
|
515
515
|
msgid "Text displayed in email footer"
|
|
516
516
|
msgstr ""
|
|
517
517
|
|
|
518
|
+
#: ./src/pyams_security/plugin/admin.py:129
|
|
519
|
+
msgid "Internal request authentication"
|
|
520
|
+
msgstr ""
|
|
521
|
+
|
|
518
522
|
#: ./src/pyams_security/plugin/userfolder.py:216
|
|
519
523
|
#, python-format
|
|
520
524
|
msgid "{prefix}{subject}"
|
|
@@ -24,15 +24,18 @@ from zope.interface import implementer
|
|
|
24
24
|
from zope.password.interfaces import IPasswordManager
|
|
25
25
|
from zope.schema.fieldproperty import FieldProperty
|
|
26
26
|
|
|
27
|
-
from pyams_security.
|
|
28
|
-
from pyams_security.interfaces.
|
|
27
|
+
from pyams_security.credential import Credentials
|
|
28
|
+
from pyams_security.interfaces.names import INTERNAL_USER_ID, PRINCIPAL_ID_FORMATTER, UNCHANGED_PASSWORD
|
|
29
|
+
from pyams_security.interfaces.plugin import IAdminAuthenticationPlugin, ICredentialsPlugin, IDirectoryPlugin
|
|
29
30
|
from pyams_security.principal import PrincipalInfo
|
|
30
31
|
from pyams_utils.factory import factory_config
|
|
31
|
-
from pyams_utils.registry import get_utility
|
|
32
|
-
|
|
32
|
+
from pyams_utils.registry import get_utility, utility_config
|
|
33
|
+
from pyams_utils.wsgi import wsgi_environ_cache
|
|
33
34
|
|
|
34
35
|
__docformat__ = 'restructuredtext'
|
|
35
36
|
|
|
37
|
+
from pyams_security import _
|
|
38
|
+
|
|
36
39
|
|
|
37
40
|
@factory_config(IAdminAuthenticationPlugin)
|
|
38
41
|
@implementer(IDirectoryPlugin)
|
|
@@ -112,3 +115,24 @@ class AdminAuthenticationPlugin(Persistent, Contained):
|
|
|
112
115
|
yield PrincipalInfo(id=PRINCIPAL_ID_FORMATTER.format(prefix=self.prefix,
|
|
113
116
|
login=self.login),
|
|
114
117
|
title=self.title)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
INTERNAL_CREDENTIALS_ENVKEY = "pyams_security.credentials.internal"
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
@utility_config(name='internal-auth',
|
|
124
|
+
provides=ICredentialsPlugin)
|
|
125
|
+
class InternalUserCredentialsPlugin:
|
|
126
|
+
"""Internal user credentials plug-in"""
|
|
127
|
+
|
|
128
|
+
prefix = 'internal'
|
|
129
|
+
title = _("Internal request authentication")
|
|
130
|
+
enabled = True
|
|
131
|
+
|
|
132
|
+
@wsgi_environ_cache(INTERNAL_CREDENTIALS_ENVKEY, store_none=False)
|
|
133
|
+
def extract_credentials(self, request, **kwargs): # pylint: disable-unused-argument
|
|
134
|
+
principal_id = getattr(request, 'principal_id', None)
|
|
135
|
+
if principal_id == INTERNAL_USER_ID:
|
|
136
|
+
return Credentials(self.prefix, principal_id,
|
|
137
|
+
pre_authenticated=True)
|
|
138
|
+
return None
|
|
@@ -27,9 +27,7 @@ from zope.interface import implementer
|
|
|
27
27
|
|
|
28
28
|
from pyams_security.interfaces import IPrincipalsGetter, IRolesGetter, ISecurityManager
|
|
29
29
|
from pyams_security.interfaces.base import IPrincipalInfo
|
|
30
|
-
from pyams_security.interfaces.names import INTERNAL_USER_ID
|
|
31
30
|
from pyams_security.interfaces.plugin import ICredentialsPlugin
|
|
32
|
-
from pyams_utils.adapter import get_adapter_weight
|
|
33
31
|
from pyams_utils.dict import DotDict
|
|
34
32
|
from pyams_utils.registry import get_all_utilities_registered_for, query_utility
|
|
35
33
|
from pyams_utils.wsgi import wsgi_environ_cache
|
|
@@ -98,24 +96,16 @@ class PyAMSSecurityPolicy:
|
|
|
98
96
|
identity = self.cookie_helper.identify(request)
|
|
99
97
|
if identity is not None:
|
|
100
98
|
principal_id = identity['userid']
|
|
101
|
-
else:
|
|
102
|
-
try:
|
|
103
|
-
request_principal_id = request.principal.id
|
|
104
|
-
except (RecursionError, AttributeError):
|
|
105
|
-
pass
|
|
106
|
-
else:
|
|
107
|
-
if request_principal_id == INTERNAL_USER_ID:
|
|
108
|
-
principal_id = request_principal_id
|
|
109
|
-
identity = {
|
|
110
|
-
'userid': principal_id
|
|
111
|
-
}
|
|
112
99
|
if not principal_id:
|
|
113
100
|
for plugin in self.credentials_plugins:
|
|
114
101
|
credentials = plugin.extract_credentials(request)
|
|
115
|
-
if
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
102
|
+
if credentials is not None:
|
|
103
|
+
if credentials.attributes.get('pre_authenticated'):
|
|
104
|
+
principal_id = credentials.id
|
|
105
|
+
elif sm is not None:
|
|
106
|
+
principal_id = sm.authenticate(credentials, request)
|
|
107
|
+
if IPrincipalInfo.providedBy(principal_id):
|
|
108
|
+
principal_id = principal_id.id
|
|
119
109
|
if principal_id is not None:
|
|
120
110
|
identity = {
|
|
121
111
|
'userid': principal_id
|
|
@@ -26,14 +26,11 @@ from zope.interface import Interface
|
|
|
26
26
|
|
|
27
27
|
from pyams_i18n.attr import I18nAttributeAdapter
|
|
28
28
|
from pyams_i18n.interfaces import II18n
|
|
29
|
-
from pyams_security.interfaces import IRoleProtectedObject,
|
|
30
|
-
ISecurityManager
|
|
29
|
+
from pyams_security.interfaces import IRoleProtectedObject, ISecurityManager
|
|
31
30
|
from pyams_security.interfaces.notification import INotificationSettings
|
|
32
31
|
from pyams_security.notification import NotificationSettings, security_notification_factory
|
|
33
32
|
from pyams_security.security import RoleProtectedObject
|
|
34
33
|
from pyams_utils.factory import register_factory
|
|
35
|
-
from pyams_utils.registry import set_local_registry
|
|
36
|
-
|
|
37
34
|
|
|
38
35
|
__docformat__ = 'restructuredtext'
|
|
39
36
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pyams-security
|
|
3
|
-
Version: 2.
|
|
3
|
+
Version: 2.4.0
|
|
4
4
|
Summary: PyAMS security management package
|
|
5
5
|
Home-page: https://pyams.readthedocs.io
|
|
6
6
|
Author: Thierry Florac
|
|
@@ -54,6 +54,15 @@ store roles assigned to principals.
|
|
|
54
54
|
Changelog
|
|
55
55
|
=========
|
|
56
56
|
|
|
57
|
+
2.4.0
|
|
58
|
+
-----
|
|
59
|
+
- added internal service credentials plug-in
|
|
60
|
+
|
|
61
|
+
2.3.4
|
|
62
|
+
-----
|
|
63
|
+
- disable authentication of pre-authenticated credentials as defined by remote user
|
|
64
|
+
authentication package
|
|
65
|
+
|
|
57
66
|
2.3.3
|
|
58
67
|
-----
|
|
59
68
|
- added exception handler in identity getter
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
============================
|
|
3
|
-
Extracting users credentials
|
|
4
|
-
============================
|
|
5
|
-
|
|
6
|
-
As explained before, PyAMS authentication policy relies on several kinds of plugins, which
|
|
7
|
-
are used to extract credentials from a given request, and then to authenticate these credentials
|
|
8
|
-
(if any) against an internal or external users database (being a local users folder, an LDAP
|
|
9
|
-
directory or an external OAuth authority provider).
|
|
10
|
-
|
|
11
|
-
Credentials extraction is done by plugins which are external to PyAMS_security package; some
|
|
12
|
-
example are PyAMS_auth_http (to extract credentials from an Authorization header),
|
|
13
|
-
PyAMS_auth_jwt (to generate and validate JWT tokens), PyAMS_auth_oauth (to handle authentication
|
|
14
|
-
based on an OAuth provider) or PyAMS_auth_form (to authenticate using a classic login form).
|
|
15
|
-
|
|
16
|
-
All credentials plugins are tested sequentially, until one of them returns accepted credentials;
|
|
17
|
-
if none of them is returning credentials, the request is left as "unauthenticated"; otherwise,
|
|
18
|
-
these credentials are checked against the users database to authenticate the request.
|
|
19
|
-
|
|
20
|
-
Some authentication mechanisms can store credentials information into a cookie or an
|
|
21
|
-
authorization token, so that credentials are not always reauthenticated on every request.
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/password-reset.pt
RENAMED
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/register-body.pt
RENAMED
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/plugin/templates/register-info.pt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security/tests/test_utilsdocstrings.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
{pyams_security-2.3.3 → pyams_security-2.4.0}/src/pyams_security.egg-info/namespace_packages.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|