Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Cédric Le Ninivin
erp5
Commits
0b2c77f0
Commit
0b2c77f0
authored
Oct 25, 2016
by
Kazuhiko Shiozaki
Committed by
Vincent Pelletier
Oct 26, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Security: simplify ERP5BearerExtractionPlugin.
parent
19a57e3b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
7 deletions
+2
-7
product/ERP5Security/ERP5BearerExtractionPlugin.py
product/ERP5Security/ERP5BearerExtractionPlugin.py
+2
-7
No files found.
product/ERP5Security/ERP5BearerExtractionPlugin.py
View file @
0b2c77f0
...
@@ -33,7 +33,7 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
...
@@ -33,7 +33,7 @@ from Products.PageTemplates.PageTemplateFile import PageTemplateFile
from
Products.PluggableAuthService.interfaces
import
plugins
from
Products.PluggableAuthService.interfaces
import
plugins
from
Products.PluggableAuthService.utils
import
classImplements
from
Products.PluggableAuthService.utils
import
classImplements
from
Products.PluggableAuthService.plugins.BasePlugin
import
BasePlugin
from
Products.PluggableAuthService.plugins.BasePlugin
import
BasePlugin
from
Products.ERP5
Security.ERP5UserManager
import
SUPER_USER
from
Products.ERP5
Type.UnrestrictedMethod
import
super_user
from
Products.PluggableAuthService.PluggableAuthService
import
DumbHTTPExtractor
from
Products.PluggableAuthService.PluggableAuthService
import
DumbHTTPExtractor
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
from
AccessControl.SecurityManagement
import
getSecurityManager
,
\
setSecurityManager
,
newSecurityManager
setSecurityManager
,
newSecurityManager
...
@@ -96,15 +96,10 @@ class ERP5BearerExtractionPlugin(BasePlugin):
...
@@ -96,15 +96,10 @@ class ERP5BearerExtractionPlugin(BasePlugin):
pass
pass
if
token
is
not
None
:
if
token
is
not
None
:
sm
=
getSecurityManager
()
with
super_user
():
if
sm
.
getUser
().
getId
()
!=
SUPER_USER
:
newSecurityManager
(
self
,
self
.
getUser
(
SUPER_USER
))
try
:
reference
=
self
.
Base_extractBearerTokenInformation
(
token
)
reference
=
self
.
Base_extractBearerTokenInformation
(
token
)
if
reference
is
not
None
:
if
reference
is
not
None
:
creds
[
'external_login'
]
=
reference
creds
[
'external_login'
]
=
reference
finally
:
setSecurityManager
(
sm
)
if
'external_login'
in
creds
:
if
'external_login'
in
creds
:
creds
[
'remote_host'
]
=
request
.
get
(
'REMOTE_HOST'
,
''
)
creds
[
'remote_host'
]
=
request
.
get
(
'REMOTE_HOST'
,
''
)
try
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment