Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pkg/docker/gunicorn_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

gunicorn.SERVER_SOFTWARE = "Python"

# Include the authenticated user identity in the access log.
# %({x-remote-user}o)s reads the X-Remote-User response header set by pgAdmin
# for authenticated requests; unauthenticated requests log '-'.
access_log_format = '%(h)s %(l)s %({x-remote-user}o)s %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s"'

if JSON_LOGGER:
logconfig_dict = {
"version": 1,
Expand Down
3 changes: 3 additions & 0 deletions web/pgadmin/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,9 @@ def before_request():

@app.after_request
def after_request(response):
if current_user.is_authenticated:
response.headers['X-Remote-User'] = current_user.username

if 'key' in request.args:
domain = dict()
if config.COOKIE_DEFAULT_DOMAIN and \
Expand Down