Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
hub
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
thomasDOTwtf
hub
Commits
ffa8d569
Commit
ffa8d569
authored
4 months ago
by
HeJ
Browse files
Options
Downloads
Patches
Plain Diff
backoffice auth debug: include request IPs and, optional, headers
parent
c34eae39
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/backoffice/views/auth.py
+7
-0
7 additions, 0 deletions
src/backoffice/views/auth.py
with
7 additions
and
0 deletions
src/backoffice/views/auth.py
+
7
−
0
View file @
ffa8d569
...
@@ -5,6 +5,7 @@ from django.http import JsonResponse
...
@@ -5,6 +5,7 @@ from django.http import JsonResponse
from
django.urls
import
reverse_lazy
from
django.urls
import
reverse_lazy
from
django.views.generic
import
TemplateView
,
View
from
django.views.generic
import
TemplateView
,
View
from
core.utils
import
str2bool
from
core.views
import
BaseLoginView
,
BasePasswordResetConfirmView
,
BasePasswordResetView
,
BaseRegistrationActivationView
,
BaseRegistrationView
from
core.views
import
BaseLoginView
,
BasePasswordResetConfirmView
,
BasePasswordResetView
,
BaseRegistrationActivationView
,
BaseRegistrationView
from
.mixins
import
ConferenceLoginRequiredMixin
,
ConferenceRequiredMixin
,
PasswordMixin
from
.mixins
import
ConferenceLoginRequiredMixin
,
ConferenceRequiredMixin
,
PasswordMixin
...
@@ -42,6 +43,12 @@ class AuthDebugView(ConferenceLoginRequiredMixin, View):
...
@@ -42,6 +43,12 @@ class AuthDebugView(ConferenceLoginRequiredMixin, View):
result
=
{}
result
=
{}
result
[
'
conference
'
]
=
self
.
conference
.
slug
result
[
'
conference
'
]
=
self
.
conference
.
slug
result
[
'
request
'
]
=
{
'
client_address
'
:
self
.
request
.
META
[
'
REMOTE_ADDR
'
],
'
x_forwarded_for
'
:
self
.
request
.
META
.
get
(
'
HTTP_X_FORWARDED_FOR
'
),
}
if
str2bool
(
self
.
request
.
GET
.
get
(
'
headers
'
,
'
n
'
)):
result
[
'
request
'
][
'
headers
'
]
=
dict
(
self
.
request
.
headers
.
items
())
result
[
'
global
'
]
=
{
result
[
'
global
'
]
=
{
'
userid
'
:
u
.
pk
,
'
userid
'
:
u
.
pk
,
'
username
'
:
u
.
username
,
'
username
'
:
u
.
username
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment