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
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Romain Courteaud
erp5
Commits
8c0f966c
Commit
8c0f966c
authored
Apr 14, 2021
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ERP5Security._setUserNameForAccessLog: Add support for WSGI Z2 log.
parent
622b2b80
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
5 deletions
+12
-5
product/ERP5Security/__init__.py
product/ERP5Security/__init__.py
+12
-5
No files found.
product/ERP5Security/__init__.py
View file @
8c0f966c
...
@@ -63,13 +63,20 @@ def _setUserNameForAccessLog(username, REQUEST):
...
@@ -63,13 +63,20 @@ def _setUserNameForAccessLog(username, REQUEST):
"""
"""
# Set the authorization header in the medusa http request
# Set the authorization header in the medusa http request
# so that the username can be logged to the Z2.log
# so that the username can be logged to the Z2.log
try
:
# Put the full-arm latex glove on now...
# Put the full-arm latex glove on now...
try
:
# Is this WSGI ?
REQUEST
.
_orig_env
[
'wsgi.input'
]
except
KeyError
:
# Not WSGI, maybe Medusa
try
:
medusa_headers
=
REQUEST
.
RESPONSE
.
stdout
.
_request
.
_header_cache
medusa_headers
=
REQUEST
.
RESPONSE
.
stdout
.
_request
.
_header_cache
except
AttributeError
:
except
AttributeError
:
pass
pass
else
:
else
:
medusa_headers
[
'authorization'
]
=
'Basic %s'
%
encodestring
(
'%s:'
%
username
).
rstrip
()
medusa_headers
[
'authorization'
]
=
'Basic %s'
%
encodestring
(
'%s:'
%
username
).
rstrip
()
else
:
REQUEST
.
_orig_env
[
'REMOTE_USER'
]
=
username
def
initialize
(
context
):
def
initialize
(
context
):
...
...
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