pas.plugins.authomatic 1.2.0__tar.gz → 2.0.0b1__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.
- pas.plugins.authomatic-2.0.0b1/.gitignore +18 -0
- {pas.plugins.authomatic-1.2.0 → pas.plugins.authomatic-2.0.0b1}/PKG-INFO +76 -213
- {pas.plugins.authomatic-1.2.0 → pas.plugins.authomatic-2.0.0b1}/README.md +52 -28
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/__init__.py +17 -6
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/controlpanel.py +1 -2
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/view.py +19 -7
- pas.plugins.authomatic-2.0.0b1/pas/plugins/authomatic/integration/__init__.py +8 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/integration/restapi.py +1 -3
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/interfaces.py +1 -2
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/de/LC_MESSAGES/pas.plugins.authomatic.po +24 -16
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/es/LC_MESSAGES/pas.plugins.authomatic.po +28 -20
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/fr/LC_MESSAGES/pas.plugins.authomatic.po +24 -16
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/it/LC_MESSAGES/pas.plugins.authomatic.po +24 -16
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/pas.plugins.authomatic.pot +24 -16
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/pt_BR/LC_MESSAGES/pas.plugins.authomatic.po +25 -17
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/ro/LC_MESSAGES/pas.plugins.authomatic.po +43 -26
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/update.py +6 -1
- pas.plugins.authomatic-2.0.0b1/pas/plugins/authomatic/logging.py +6 -0
- pas.plugins.authomatic-2.0.0b1/pas/plugins/authomatic/patches/__init__.py +5 -0
- pas.plugins.authomatic-2.0.0b1/pas/plugins/authomatic/patches/authomatic.py +151 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/plugin.py +34 -20
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/services/authomatic.py +18 -10
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/services/login.py +7 -11
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/testing.py +15 -18
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/useridentities.py +1 -1
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/useridfactories.py +0 -3
- pas.plugins.authomatic-2.0.0b1/pyproject.toml +274 -0
- pas.plugins.authomatic-1.2.0/.coveragerc +0 -7
- pas.plugins.authomatic-1.2.0/.editorconfig +0 -36
- pas.plugins.authomatic-1.2.0/CHANGELOG.md +0 -161
- pas.plugins.authomatic-1.2.0/CONTRIBUTORS.md +0 -3
- pas.plugins.authomatic-1.2.0/MANIFEST.in +0 -5
- pas.plugins.authomatic-1.2.0/Makefile +0 -116
- pas.plugins.authomatic-1.2.0/docs/authomatic.svg +0 -18
- pas.plugins.authomatic-1.2.0/docs/plone-control-panel.png +0 -0
- pas.plugins.authomatic-1.2.0/docs/plugin-settings.png +0 -0
- pas.plugins.authomatic-1.2.0/pyproject.toml +0 -44
- pas.plugins.authomatic-1.2.0/requirements.txt +0 -1
- pas.plugins.authomatic-1.2.0/setup.cfg +0 -4
- pas.plugins.authomatic-1.2.0/setup.py +0 -74
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/integration/__init__.py +0 -2
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/__init__.py +0 -0
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/mocks.py +0 -27
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_browser_controlpanel.py +0 -75
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_plugin.py +0 -109
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_services_authomatic.py +0 -53
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_services_login.py +0 -28
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_setup.py +0 -43
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_setuphandler.py +0 -48
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_upgrades.py +0 -39
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_useridentities.py +0 -156
- pas.plugins.authomatic-1.2.0/src/pas/plugins/authomatic/tests/test_useridfactories.py +0 -26
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/PKG-INFO +0 -422
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/SOURCES.txt +0 -80
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/dependency_links.txt +0 -1
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/entry_points.txt +0 -5
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/namespace_packages.txt +0 -2
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/not-zip-safe +0 -1
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/requires.txt +0 -12
- pas.plugins.authomatic-1.2.0/src/pas.plugins.authomatic.egg-info/top_level.txt +0 -1
- {pas.plugins.authomatic-1.2.0 → pas.plugins.authomatic-2.0.0b1}/LICENSE.txt +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/__init__.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/__init__.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/__init__.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/add_plugin.pt +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/authomatic.png +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/authomatic.pt +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/configure.zcml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/resources/authomatic-logo.svg +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/resources/authomatic.css +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/browser/resources/authomatic.less +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/configure.zcml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/integration/zope.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/__init__.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/locales/pas.plugins.authomatic-manual.pot +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/meta.zcml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/default/browserlayer.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/default/controlpanel.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/default/metadata.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/default/registry.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/uninstall/browserlayer.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/uninstall/controlpanel.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles/uninstall/registry.xml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/profiles.zcml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/services/__init__.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/services/configure.zcml +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/setuphandlers.py +0 -0
- {pas.plugins.authomatic-1.2.0/src → pas.plugins.authomatic-2.0.0b1}/pas/plugins/authomatic/utils.py +0 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
!src/pas
|
|
2
|
+
.coverage*
|
|
3
|
+
.pydevproject
|
|
4
|
+
.pytest_cache
|
|
5
|
+
.ruff_cache
|
|
6
|
+
.python-version
|
|
7
|
+
.venv
|
|
8
|
+
*.egg-info
|
|
9
|
+
*.log
|
|
10
|
+
*.mo
|
|
11
|
+
*.pyc
|
|
12
|
+
*.swp
|
|
13
|
+
constraints-mxdev.txt
|
|
14
|
+
constraints.txt
|
|
15
|
+
instance
|
|
16
|
+
requirements-mxdev.txt
|
|
17
|
+
requirements.lock
|
|
18
|
+
requirements.txt
|
|
@@ -1,36 +1,40 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: pas.plugins.authomatic
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.0.0b1
|
|
4
4
|
Summary: Provides OAuth2/OpenID login for Plone using Authomatic.
|
|
5
|
-
Home-page: https://github.com/collective/pas.plugins.authomatic
|
|
6
|
-
Author: Jens Klein, Matthias Dollfuss, and Érico Andrei
|
|
7
|
-
Author-email: dev@bluedynamics.com
|
|
8
|
-
License: GPL
|
|
9
|
-
Project-URL: Repository, https://github.com/collective/pas.plugins.authomatic/
|
|
10
5
|
Project-URL: Changelog, https://github.com/collective/pas.plugins.authomatic/blob/main/CHANGELOG.md
|
|
6
|
+
Project-URL: Homepage, https://github.com/collective/pas.plugins.authomatic
|
|
11
7
|
Project-URL: Issues, https://github.com/collective/pas.plugins.authomatic/issues
|
|
12
|
-
|
|
8
|
+
Project-URL: Repository, https://github.com/collective/pas.plugins.authomatic/
|
|
9
|
+
Author: Matthias Dollfuss
|
|
10
|
+
Author-email: Jens Klein <dev@bluedynamics.com>, Érico Andrei <ericof@plone.org>
|
|
11
|
+
License: GNU General Public License v2 (GPLv2)
|
|
12
|
+
License-File: LICENSE.txt
|
|
13
|
+
Keywords: Authentication,OAuth,PAS,Plone,Python
|
|
13
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
14
15
|
Classifier: Environment :: Web Environment
|
|
15
|
-
Classifier: Framework :: Plone
|
|
16
|
+
Classifier: Framework :: Plone
|
|
16
17
|
Classifier: Framework :: Plone :: 6.0
|
|
18
|
+
Classifier: Framework :: Plone :: 6.1
|
|
17
19
|
Classifier: Framework :: Plone :: Addon
|
|
18
|
-
Classifier: Framework :: Plone
|
|
19
|
-
Classifier: Framework :: Zope :: 5
|
|
20
20
|
Classifier: Framework :: Zope
|
|
21
|
+
Classifier: Framework :: Zope :: 5
|
|
21
22
|
Classifier: License :: OSI Approved :: GNU General Public License v2 (GPLv2)
|
|
23
|
+
Classifier: Programming Language :: Python
|
|
22
24
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
23
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
24
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
25
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
26
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
27
25
|
Classifier: Programming Language :: Python :: 3.11
|
|
28
|
-
Classifier: Programming Language :: Python
|
|
29
|
-
Requires-Python: >=3.
|
|
30
|
-
|
|
26
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
27
|
+
Requires-Python: >=3.11
|
|
28
|
+
Requires-Dist: authomatic>=1.3.0
|
|
29
|
+
Requires-Dist: plone-restapi
|
|
30
|
+
Requires-Dist: products-cmfplone>=6.0
|
|
31
31
|
Provides-Extra: test
|
|
32
|
-
|
|
33
|
-
|
|
32
|
+
Requires-Dist: collective-mockmailhost; extra == 'test'
|
|
33
|
+
Requires-Dist: plone-app-robotframework[debug]; extra == 'test'
|
|
34
|
+
Requires-Dist: plone-app-testing; extra == 'test'
|
|
35
|
+
Requires-Dist: plone-restapi[test]; extra == 'test'
|
|
36
|
+
Requires-Dist: zest-releaser[recommended]; extra == 'test'
|
|
37
|
+
Description-Content-Type: text/markdown
|
|
34
38
|
|
|
35
39
|
<div align="center"><img alt="logo" src="https://raw.githubusercontent.com/collective/pas.plugins.authomatic/main/docs/authomatic.svg" width="70" /></div>
|
|
36
40
|
|
|
@@ -56,8 +60,7 @@ License-File: LICENSE.txt
|
|
|
56
60
|
|
|
57
61
|
</div>
|
|
58
62
|
|
|
59
|
-
Features
|
|
60
|
-
--------
|
|
63
|
+
## Features
|
|
61
64
|
|
|
62
65
|
**pas.plugins.authomatic** provides OAuth2 and OpenID login capability for Plone sites by integrating the awesome [Authomatic](https://authomatic.github.io/authomatic/) package.
|
|
63
66
|
|
|
@@ -72,12 +75,11 @@ through standards like OAuth and OpenID.
|
|
|
72
75
|
*by author Peter Hudec on Authomatic website*
|
|
73
76
|
|
|
74
77
|
|
|
75
|
-
Supported Providers
|
|
76
|
-
-------------------
|
|
78
|
+
### Supported Providers
|
|
77
79
|
|
|
78
80
|
Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
79
81
|
|
|
80
|
-
|
|
82
|
+
#### OAuth 1.0
|
|
81
83
|
|
|
82
84
|
- Bitbucket
|
|
83
85
|
- Flickr
|
|
@@ -91,7 +93,7 @@ Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
|
91
93
|
- Xing
|
|
92
94
|
- Yahoo
|
|
93
95
|
|
|
94
|
-
|
|
96
|
+
#### OAuth 2.0
|
|
95
97
|
|
|
96
98
|
- Amazon
|
|
97
99
|
- Behance
|
|
@@ -112,33 +114,58 @@ Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
|
112
114
|
- Yammer
|
|
113
115
|
- Yandex
|
|
114
116
|
|
|
115
|
-
|
|
117
|
+
#### OpenID
|
|
116
118
|
|
|
117
119
|
- python-openid
|
|
118
120
|
- Google App Engine based OpenID.
|
|
119
121
|
|
|
120
122
|
|
|
121
|
-
Documentation
|
|
122
|
-
-------------
|
|
123
|
+
## Documentation
|
|
123
124
|
|
|
124
125
|
This package supports Plone sites using Volto or the Classic UI.
|
|
125
126
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- This package creates a view called `authomatic-handler` where you can login with different providers.
|
|
129
|
-
- The view can be used as well to add an identity from a provider to an existing account.
|
|
130
|
-
- The provider is choosen in the URL so if you call `/authomatic-handler/PROVIDER` you will use PROVIDER to login.
|
|
131
|
-
|
|
132
|
-
For Volto:
|
|
127
|
+
### Volto Frontend
|
|
133
128
|
|
|
134
129
|
- Endpoint `@login` with GET: Returns list of authentication options
|
|
135
130
|
- Endpoint `@login-authomatic` with GET: Provide information to start the OAuth process.
|
|
136
131
|
- Endpoint `@login-authomatic` with POST: Handles OAuth login and returns a JSON web token (JWT).
|
|
137
132
|
- For Volto sites you must also install [@plone-collective/volto-authomatic](https://github.com/collective/volto-authomatic).
|
|
133
|
+
- Plugin configuration is available in the Control-panel `/controlpanel/authomatic` (linked under users)
|
|
134
|
+
- Example JSON configuration (first level key is the PROVIDER):
|
|
135
|
+
|
|
136
|
+
```json
|
|
137
|
+
{
|
|
138
|
+
"github": {
|
|
139
|
+
"display": {
|
|
140
|
+
"title": "Github",
|
|
141
|
+
"cssclasses": {
|
|
142
|
+
"button": "plone-btn plone-btn-default",
|
|
143
|
+
"icon": "glypicon glyphicon-github"
|
|
144
|
+
},
|
|
145
|
+
"as_form": false
|
|
146
|
+
},
|
|
147
|
+
"propertymap": {
|
|
148
|
+
"email": "email",
|
|
149
|
+
"link": "home_page",
|
|
150
|
+
"location": "location",
|
|
151
|
+
"name": "fullname"
|
|
152
|
+
},
|
|
153
|
+
"class_": "authomatic.providers.oauth2.GitHub",
|
|
154
|
+
"consumer_key": "5c4901d141e736f114a7",
|
|
155
|
+
"consumer_secret": "d4692ca3c0ab6cc1f8b28d3ccb1ea15b61e7ef5c",
|
|
156
|
+
"access_headers": {
|
|
157
|
+
"User-Agent": "Plone Authomatic Plugin"
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
}
|
|
161
|
+
```
|
|
138
162
|
|
|
139
163
|
|
|
140
|
-
|
|
164
|
+
### Classic UI
|
|
141
165
|
|
|
166
|
+
- This package creates a view called `authomatic-handler` where you can login with different providers.
|
|
167
|
+
- The view can be used as well to add an identity from a provider to an existing account.
|
|
168
|
+
- The provider is choosen in the URL so if you call `/authomatic-handler/PROVIDER` you will use PROVIDER to login.
|
|
142
169
|
- Plugin configuration is available in the Controlpanel `@@authomatic-controlpanel` (linked under users)
|
|
143
170
|
- Example JSON configuration (first level key is the PROVIDER):
|
|
144
171
|
|
|
@@ -169,8 +196,7 @@ Configuration is, currently, done via Classic UI:
|
|
|
169
196
|
}
|
|
170
197
|
```
|
|
171
198
|
|
|
172
|
-
Installation
|
|
173
|
-
------------
|
|
199
|
+
## Installation
|
|
174
200
|
|
|
175
201
|
Add **pas.plugins.authomatic** to the Plone installation using `pip`:
|
|
176
202
|
|
|
@@ -190,8 +216,7 @@ or add it as a dependency on your package's `setup.py`
|
|
|
190
216
|
|
|
191
217
|
Start Plone and activate the plugin in the addons control-panel.
|
|
192
218
|
|
|
193
|
-
Configuration
|
|
194
|
-
-------------
|
|
219
|
+
## Configuration
|
|
195
220
|
|
|
196
221
|
Using Classic UI, go to the `Authomatic` controlpanel.
|
|
197
222
|
|
|
@@ -217,8 +242,7 @@ There are some differences in configuration:
|
|
|
217
242
|
It is a mapping from authomatic/provider user properties to plone user properties, like `"fullname": "name",`. Look at each providers documentation which properties are available.
|
|
218
243
|
|
|
219
244
|
|
|
220
|
-
Source Code and Contributions
|
|
221
|
-
-----------------------------
|
|
245
|
+
## Source Code and Contributions
|
|
222
246
|
|
|
223
247
|
If you want to help with the development (improvement, update, bug-fixing, ...) of `pas.plugins.authomatic` this is a great idea!
|
|
224
248
|
|
|
@@ -232,15 +256,14 @@ Creator of **pas.plugins.authomatic** is Jens Klein.
|
|
|
232
256
|
|
|
233
257
|
We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.
|
|
234
258
|
|
|
235
|
-
Development
|
|
236
|
-
-----------
|
|
259
|
+
### Development
|
|
237
260
|
|
|
238
261
|
You need a working `python` environment (system, virtualenv, pyenv, etc) version 3.7 or superior.
|
|
239
262
|
|
|
240
263
|
Then install the dependencies and a development instance using:
|
|
241
264
|
|
|
242
265
|
```bash
|
|
243
|
-
make
|
|
266
|
+
make install
|
|
244
267
|
```
|
|
245
268
|
|
|
246
269
|
To run tests for this package:
|
|
@@ -249,174 +272,14 @@ To run tests for this package:
|
|
|
249
272
|
make test
|
|
250
273
|
```
|
|
251
274
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
License
|
|
255
|
-
-------
|
|
256
|
-
|
|
257
|
-
The project is licensed under the GPLv2.
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
# Changelog
|
|
261
|
-
|
|
262
|
-
## 1.2.0 (2023-09-13)
|
|
263
|
-
|
|
264
|
-
- Add Spanish translation. @macagua
|
|
265
|
-
|
|
266
|
-
- Better handle values from identity data. @cekk
|
|
267
|
-
|
|
268
|
-
- Add `username_userid` User ID factory. @ericof
|
|
269
|
-
|
|
270
|
-
- Annotate transaction in POST calls to authenticate a user. @ericof
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
## 1.1.2 (2023-03-15)
|
|
274
|
-
|
|
275
|
-
- Support Python 3.11 for Plone 6. @ericof
|
|
276
|
-
|
|
277
|
-
- Lint fixes @ericof
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
## 1.1.1 (2022-10-14)
|
|
281
|
-
|
|
282
|
-
- Upgrade plone/code-analysis-action to version 2. @ericof
|
|
283
|
-
|
|
284
|
-
- Fix packaging issue related to CHANGELOG.md not being included in the source package. @ericof
|
|
285
|
-
|
|
286
|
-
- Support Python 3.10 for Plone 6. @ericof
|
|
275
|
+
To lint the codebase:
|
|
287
276
|
|
|
277
|
+
```bash
|
|
278
|
+
make lint
|
|
279
|
+
```
|
|
288
280
|
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
- Add the plone.restapi adapter to show the controlpanel in Volto. @erral
|
|
292
|
-
|
|
293
|
-
- Add possibility to redirect to `next_url` via provided cookie @avoinea
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
## 1.0.0 (2022-07-25)
|
|
297
|
-
|
|
298
|
-
- Use plone/plone-setup GitHub Action. @ericof
|
|
299
|
-
|
|
300
|
-
- Add Brazilian Portuguese translation. @ericof
|
|
301
|
-
|
|
302
|
-
- Use plone/code-analysis-action GitHub Action for code analysis. @ericof
|
|
303
|
-
|
|
304
|
-
- Fix doChangeUser takes 2 positional arguments but 3 were given @avoinea
|
|
305
|
-
|
|
306
|
-
## 1.0b2 (2021-08-18)
|
|
307
|
-
|
|
308
|
-
- Fix tox setup, move CI from TravisCI to GitHub Actions. @jensens
|
|
309
|
-
|
|
310
|
-
- Code Style Black, Isort, zpretty and Pyupgrade applied. @jensens
|
|
311
|
-
|
|
312
|
-
- Add missing no-op methods for IUserManagement to plugin.
|
|
313
|
-
This fixes the tests. @jensens
|
|
314
|
-
|
|
315
|
-
- Drop Python 2 support and so require Plone 5.2. @jensens
|
|
316
|
-
|
|
317
|
-
- Include permissions from CMFCore to avoid ComponentLookupError. @bsuttor
|
|
318
|
-
|
|
319
|
-
- Fixed ModuleNotFoundError: No module named 'App.class_init' on Zope 5. @bsuttor
|
|
320
|
-
|
|
321
|
-
- Add french translation @mpeeters
|
|
322
|
-
|
|
323
|
-
- PAS event notification IPrincipalCreatedEvent. @jensens
|
|
324
|
-
|
|
325
|
-
- Python 3 and Plone 52 compatibility. @cekk
|
|
326
|
-
|
|
327
|
-
- Fix #44: Fullfill strictly exact_match when enumerating users @allusa
|
|
328
|
-
|
|
329
|
-
- Allow users deletion. @cekk
|
|
330
|
-
|
|
331
|
-
- Drop Plone < 5.1.x compatibility. @cekk
|
|
332
|
-
|
|
333
|
-
- Fix #54: Notification of PrincipalCreated event. @ericof
|
|
334
|
-
|
|
335
|
-
- Closes #55: Support plone.restapi. @ericof
|
|
336
|
-
|
|
337
|
-
## 1.0b1 (2017-11-20)
|
|
338
|
-
|
|
339
|
-
- Slighly beautify login modal. @jensens
|
|
340
|
-
|
|
341
|
-
- Fix #33" Page does not exist Control Settings. @jensens
|
|
342
|
-
|
|
343
|
-
- Fix #31: Link is broken to JSON configuration documentation in help text. @jensens
|
|
344
|
-
|
|
345
|
-
- Fix #28: After uninstall plone.external_login_url is still registered and the login broken. @jensens
|
|
346
|
-
|
|
347
|
-
- Support for Plone 5.1 tested (worked, ust control-panel icon needed some tweak).
|
|
348
|
-
Buildout configuration for 5.1 added. @jensens
|
|
349
|
-
|
|
350
|
-
- Install: Hide non-valid profiles at install form. @jensens
|
|
351
|
-
|
|
352
|
-
- Additional checks to ensure to never have an empty/None key stored. @jensens
|
|
353
|
-
|
|
354
|
-
- Fix #27: Update user data after login. @jensens
|
|
355
|
-
|
|
356
|
-
- Fix filter users bug in enumerateUsers plugin where it was always returning
|
|
357
|
-
all the users. @sneridagh
|
|
358
|
-
|
|
359
|
-
- fix typo and wording of login message @tkimnguyen
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
## 1.0a7 (2016-02-15)
|
|
363
|
-
|
|
364
|
-
- Workaround for None users. @sneridagh
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
## 1.0a6 (2016-01-11)
|
|
368
|
-
|
|
369
|
-
- Fix #21: When you logout and then login again, a new user is created. @jensens
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
## 1.0a5 (2015-12-04)
|
|
373
|
-
|
|
374
|
-
- Fix: #18 "Provider Login" option for "Generator for Plone User ID" seems
|
|
375
|
-
broken @jensens
|
|
376
|
-
|
|
377
|
-
- Fix: Title indicates if an identity is added @jensens
|
|
378
|
-
|
|
379
|
-
- Fix: Correct usage of plone.protect @jensens
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
## 1.0a4 (2015-11-20)
|
|
383
|
-
|
|
384
|
-
- Added german translation @jensens
|
|
385
|
-
|
|
386
|
-
- Restored Plone 4 compatibility @keul
|
|
387
|
-
|
|
388
|
-
- Added italian translation @keul
|
|
389
|
-
|
|
390
|
-
- Proper uninstall @keul
|
|
391
|
-
|
|
392
|
-
## 1.0a3 (2015-11-15)
|
|
393
|
-
|
|
394
|
-
- Refactor authomatic-handler to enable adding identities. @jensens
|
|
395
|
-
|
|
396
|
-
- Fix: use secret from settings as secret for Authomatic. @jensens
|
|
397
|
-
|
|
398
|
-
- Renamed view ``authomatic-login`` to ``authomatic-handler``, because this
|
|
399
|
-
view will be used to add an identity too (url must be registered on provider
|
|
400
|
-
side sometimes and we want to do this only once). @jensens
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
## 1.0a2 (2015-11-14)
|
|
404
|
-
|
|
405
|
-
- Minimal validation of JSON. @jensens
|
|
406
|
-
|
|
407
|
-
- Make the whole ``remember`` procedure a ``safeWrite`` if called from login
|
|
408
|
-
view. We can not pass a authenticator token here, because of redirects and
|
|
409
|
-
expected return urls . @jensens
|
|
410
|
-
|
|
411
|
-
- Allow selection of user id generator strategy. @jensens
|
|
412
|
-
|
|
413
|
-
- Allow multiple services for one user. This changes a lot behind the scenes. @jensens
|
|
414
|
-
|
|
415
|
-
- Use authomatic.core.User attributes instead of raw provider data. closes [#9](https://github.com/collective/pas.plugins.authomatic/issues/9) @ericof
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
## 1.0a1 (2015-10-28)
|
|
419
|
-
|
|
420
|
-
- Initial release.
|
|
281
|
+
By default we use the latest Plone version in the 6.x series.
|
|
421
282
|
|
|
283
|
+
## License
|
|
422
284
|
|
|
285
|
+
The project is licensed under the GPLv2.
|
|
@@ -22,8 +22,7 @@
|
|
|
22
22
|
|
|
23
23
|
</div>
|
|
24
24
|
|
|
25
|
-
Features
|
|
26
|
-
--------
|
|
25
|
+
## Features
|
|
27
26
|
|
|
28
27
|
**pas.plugins.authomatic** provides OAuth2 and OpenID login capability for Plone sites by integrating the awesome [Authomatic](https://authomatic.github.io/authomatic/) package.
|
|
29
28
|
|
|
@@ -38,12 +37,11 @@ through standards like OAuth and OpenID.
|
|
|
38
37
|
*by author Peter Hudec on Authomatic website*
|
|
39
38
|
|
|
40
39
|
|
|
41
|
-
Supported Providers
|
|
42
|
-
-------------------
|
|
40
|
+
### Supported Providers
|
|
43
41
|
|
|
44
42
|
Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
45
43
|
|
|
46
|
-
|
|
44
|
+
#### OAuth 1.0
|
|
47
45
|
|
|
48
46
|
- Bitbucket
|
|
49
47
|
- Flickr
|
|
@@ -57,7 +55,7 @@ Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
|
57
55
|
- Xing
|
|
58
56
|
- Yahoo
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
#### OAuth 2.0
|
|
61
59
|
|
|
62
60
|
- Amazon
|
|
63
61
|
- Behance
|
|
@@ -78,33 +76,58 @@ Out of the box, **pas.plugins.authomatic** supports the following providers
|
|
|
78
76
|
- Yammer
|
|
79
77
|
- Yandex
|
|
80
78
|
|
|
81
|
-
|
|
79
|
+
#### OpenID
|
|
82
80
|
|
|
83
81
|
- python-openid
|
|
84
82
|
- Google App Engine based OpenID.
|
|
85
83
|
|
|
86
84
|
|
|
87
|
-
Documentation
|
|
88
|
-
-------------
|
|
85
|
+
## Documentation
|
|
89
86
|
|
|
90
87
|
This package supports Plone sites using Volto or the Classic UI.
|
|
91
88
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
- This package creates a view called `authomatic-handler` where you can login with different providers.
|
|
95
|
-
- The view can be used as well to add an identity from a provider to an existing account.
|
|
96
|
-
- The provider is choosen in the URL so if you call `/authomatic-handler/PROVIDER` you will use PROVIDER to login.
|
|
97
|
-
|
|
98
|
-
For Volto:
|
|
89
|
+
### Volto Frontend
|
|
99
90
|
|
|
100
91
|
- Endpoint `@login` with GET: Returns list of authentication options
|
|
101
92
|
- Endpoint `@login-authomatic` with GET: Provide information to start the OAuth process.
|
|
102
93
|
- Endpoint `@login-authomatic` with POST: Handles OAuth login and returns a JSON web token (JWT).
|
|
103
94
|
- For Volto sites you must also install [@plone-collective/volto-authomatic](https://github.com/collective/volto-authomatic).
|
|
95
|
+
- Plugin configuration is available in the Control-panel `/controlpanel/authomatic` (linked under users)
|
|
96
|
+
- Example JSON configuration (first level key is the PROVIDER):
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"github": {
|
|
101
|
+
"display": {
|
|
102
|
+
"title": "Github",
|
|
103
|
+
"cssclasses": {
|
|
104
|
+
"button": "plone-btn plone-btn-default",
|
|
105
|
+
"icon": "glypicon glyphicon-github"
|
|
106
|
+
},
|
|
107
|
+
"as_form": false
|
|
108
|
+
},
|
|
109
|
+
"propertymap": {
|
|
110
|
+
"email": "email",
|
|
111
|
+
"link": "home_page",
|
|
112
|
+
"location": "location",
|
|
113
|
+
"name": "fullname"
|
|
114
|
+
},
|
|
115
|
+
"class_": "authomatic.providers.oauth2.GitHub",
|
|
116
|
+
"consumer_key": "5c4901d141e736f114a7",
|
|
117
|
+
"consumer_secret": "d4692ca3c0ab6cc1f8b28d3ccb1ea15b61e7ef5c",
|
|
118
|
+
"access_headers": {
|
|
119
|
+
"User-Agent": "Plone Authomatic Plugin"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
}
|
|
123
|
+
```
|
|
104
124
|
|
|
105
125
|
|
|
106
|
-
|
|
126
|
+
### Classic UI
|
|
107
127
|
|
|
128
|
+
- This package creates a view called `authomatic-handler` where you can login with different providers.
|
|
129
|
+
- The view can be used as well to add an identity from a provider to an existing account.
|
|
130
|
+
- The provider is choosen in the URL so if you call `/authomatic-handler/PROVIDER` you will use PROVIDER to login.
|
|
108
131
|
- Plugin configuration is available in the Controlpanel `@@authomatic-controlpanel` (linked under users)
|
|
109
132
|
- Example JSON configuration (first level key is the PROVIDER):
|
|
110
133
|
|
|
@@ -135,8 +158,7 @@ Configuration is, currently, done via Classic UI:
|
|
|
135
158
|
}
|
|
136
159
|
```
|
|
137
160
|
|
|
138
|
-
Installation
|
|
139
|
-
------------
|
|
161
|
+
## Installation
|
|
140
162
|
|
|
141
163
|
Add **pas.plugins.authomatic** to the Plone installation using `pip`:
|
|
142
164
|
|
|
@@ -156,8 +178,7 @@ or add it as a dependency on your package's `setup.py`
|
|
|
156
178
|
|
|
157
179
|
Start Plone and activate the plugin in the addons control-panel.
|
|
158
180
|
|
|
159
|
-
Configuration
|
|
160
|
-
-------------
|
|
181
|
+
## Configuration
|
|
161
182
|
|
|
162
183
|
Using Classic UI, go to the `Authomatic` controlpanel.
|
|
163
184
|
|
|
@@ -183,8 +204,7 @@ There are some differences in configuration:
|
|
|
183
204
|
It is a mapping from authomatic/provider user properties to plone user properties, like `"fullname": "name",`. Look at each providers documentation which properties are available.
|
|
184
205
|
|
|
185
206
|
|
|
186
|
-
Source Code and Contributions
|
|
187
|
-
-----------------------------
|
|
207
|
+
## Source Code and Contributions
|
|
188
208
|
|
|
189
209
|
If you want to help with the development (improvement, update, bug-fixing, ...) of `pas.plugins.authomatic` this is a great idea!
|
|
190
210
|
|
|
@@ -198,15 +218,14 @@ Creator of **pas.plugins.authomatic** is Jens Klein.
|
|
|
198
218
|
|
|
199
219
|
We appreciate any contribution and if a release is needed to be done on PyPI, please just contact one of us.
|
|
200
220
|
|
|
201
|
-
Development
|
|
202
|
-
-----------
|
|
221
|
+
### Development
|
|
203
222
|
|
|
204
223
|
You need a working `python` environment (system, virtualenv, pyenv, etc) version 3.7 or superior.
|
|
205
224
|
|
|
206
225
|
Then install the dependencies and a development instance using:
|
|
207
226
|
|
|
208
227
|
```bash
|
|
209
|
-
make
|
|
228
|
+
make install
|
|
210
229
|
```
|
|
211
230
|
|
|
212
231
|
To run tests for this package:
|
|
@@ -215,9 +234,14 @@ To run tests for this package:
|
|
|
215
234
|
make test
|
|
216
235
|
```
|
|
217
236
|
|
|
237
|
+
To lint the codebase:
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
make lint
|
|
241
|
+
```
|
|
242
|
+
|
|
218
243
|
By default we use the latest Plone version in the 6.x series.
|
|
219
244
|
|
|
220
|
-
License
|
|
221
|
-
-------
|
|
245
|
+
## License
|
|
222
246
|
|
|
223
247
|
The project is licensed under the GPLv2.
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
from pas.plugins.authomatic.patches import apply_patches
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
__version__ = "2.0.0b1"
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
PACKAGE_NAME = "pas.plugins.authomatic"
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
apply_patches()
|
|
7
11
|
|
|
8
12
|
|
|
9
13
|
def initialize(context):
|
|
@@ -15,6 +19,13 @@ def initialize(context):
|
|
|
15
19
|
Here, we call the Archetypes machinery to register our content types
|
|
16
20
|
with Zope and the CMF.
|
|
17
21
|
"""
|
|
22
|
+
from AccessControl.Permissions import add_user_folders
|
|
23
|
+
from pas.plugins.authomatic.plugin import AuthomaticPlugin
|
|
24
|
+
from pas.plugins.authomatic.plugin import manage_addAuthomaticPlugin
|
|
25
|
+
from pas.plugins.authomatic.plugin import manage_addAuthomaticPluginForm
|
|
26
|
+
from pas.plugins.authomatic.plugin import tpl_dir
|
|
27
|
+
from Products.PluggableAuthService import registerMultiPlugin
|
|
28
|
+
|
|
18
29
|
registerMultiPlugin(AuthomaticPlugin.meta_type)
|
|
19
30
|
context.registerClass(
|
|
20
31
|
AuthomaticPlugin,
|
|
@@ -8,7 +8,6 @@ from zope.interface import Interface
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
class AuthomaticSettingsEditForm(controlpanel.RegistryEditForm):
|
|
11
|
-
|
|
12
11
|
schema = IPasPluginsAuthomaticSettings
|
|
13
12
|
label = _("PAS Authomatic Plugin Settings")
|
|
14
13
|
description = ""
|
|
@@ -33,7 +32,7 @@ class AuthomaticSettingsConfigletPanel(RegistryConfigletPanel):
|
|
|
33
32
|
|
|
34
33
|
schema = IPasPluginsAuthomaticSettings
|
|
35
34
|
configlet_id = "authomatic"
|
|
36
|
-
configlet_category_id = "
|
|
35
|
+
configlet_category_id = "plone-users"
|
|
37
36
|
title = _("Authomatic settings")
|
|
38
37
|
group = ""
|
|
39
38
|
schema_prefix = "pas.plugins.authomatic.interfaces.IPasPluginsAuthomaticSettings"
|
|
@@ -26,9 +26,14 @@ def is_root(obj):
|
|
|
26
26
|
|
|
27
27
|
@implementer(IPublishTraverse)
|
|
28
28
|
class AuthomaticView(BrowserView):
|
|
29
|
-
|
|
30
29
|
template = ViewPageTemplateFile("authomatic.pt")
|
|
31
30
|
|
|
31
|
+
zope_request_adapter_factory = ZopeRequestAdapter
|
|
32
|
+
|
|
33
|
+
@property
|
|
34
|
+
def zope_request_adapter(self):
|
|
35
|
+
return self.zope_request_adapter_factory(self)
|
|
36
|
+
|
|
32
37
|
def publishTraverse(self, request, name):
|
|
33
38
|
if name and not hasattr(self, "provider"):
|
|
34
39
|
self.provider = name
|
|
@@ -86,10 +91,15 @@ class AuthomaticView(BrowserView):
|
|
|
86
91
|
self.request,
|
|
87
92
|
)
|
|
88
93
|
|
|
94
|
+
def _handle_error(self, error):
|
|
95
|
+
try:
|
|
96
|
+
return error.message
|
|
97
|
+
except AttributeError:
|
|
98
|
+
return str(error)
|
|
99
|
+
|
|
89
100
|
def __call__(self):
|
|
90
|
-
cfg = authomatic_cfg()
|
|
91
101
|
provider = getattr(self, "provider", "")
|
|
92
|
-
if cfg is None:
|
|
102
|
+
if cfg := authomatic_cfg() is None:
|
|
93
103
|
return _("Authomatic is not configured")
|
|
94
104
|
if not is_root(self.context):
|
|
95
105
|
# callback url is expected on either navigationroot or site root
|
|
@@ -104,20 +114,22 @@ class AuthomaticView(BrowserView):
|
|
|
104
114
|
return _("Provider not supported")
|
|
105
115
|
if not self.is_anon:
|
|
106
116
|
if provider in self._provider_names:
|
|
107
|
-
logger.
|
|
117
|
+
logger.warning(
|
|
118
|
+
f"Provider {provider} is already connected to current user"
|
|
119
|
+
)
|
|
108
120
|
return self._redirect()
|
|
109
121
|
# TODO: some sort of CSRF check might be needed, so that
|
|
110
122
|
# not an account got connected by CSRF. Research needed.
|
|
111
123
|
pass
|
|
112
124
|
secret = authomatic_settings().secret
|
|
113
125
|
auth = Authomatic(cfg, secret=secret)
|
|
114
|
-
result = auth.login(
|
|
126
|
+
result = auth.login(self.zope_request_adapter, self.provider)
|
|
115
127
|
if not result:
|
|
116
128
|
logger.info("return from view")
|
|
117
129
|
# let authomatic do its work
|
|
118
130
|
return
|
|
119
|
-
|
|
120
|
-
return
|
|
131
|
+
elif error := result.error:
|
|
132
|
+
return self._handle_error(error)
|
|
121
133
|
display = cfg[self.provider].get("display", {})
|
|
122
134
|
provider_name = display.get("title", self.provider)
|
|
123
135
|
if not self.is_anon:
|