Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
J
jitsi-cert-auth
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Hartig
jitsi-cert-auth
Commits
e90baf34
Commit
e90baf34
authored
6 months ago
by
Jan Hartig
Browse files
Options
Downloads
Patches
Plain Diff
Fix errors for IPv6 addresses
parent
2c5adf30
No related branches found
No related tags found
1 merge request
!27
Implement ip based access
Pipeline
#48932
passed
6 months ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
server.py
+5
-1
5 additions, 1 deletion
server.py
with
5 additions
and
1 deletion
server.py
+
5
−
1
View file @
e90baf34
...
@@ -103,7 +103,11 @@ def check_auth(request: Request) -> dict | None:
...
@@ -103,7 +103,11 @@ def check_auth(request: Request) -> dict | None:
s_dn
=
request
.
headers
.
get
(
"
SSL-Client-S-DN
"
)
s_dn
=
request
.
headers
.
get
(
"
SSL-Client-S-DN
"
)
if
not
s_dn
:
if
not
s_dn
:
client_ip
=
ipaddress
.
IPv4Address
(
request
.
headers
.
get
(
"
CLient-IP
"
))
try
:
client_ip
=
ipaddress
.
IPv4Address
(
request
.
headers
.
get
(
"
CLient-IP
"
))
except
ipaddress
.
AddressValueError
:
# client_ip = ipaddress.IPv6Address(request.headers.get("CLient-IP"))
raise
Unauthorized
(
"
Unauthorized
"
)
allowed
=
False
allowed
=
False
for
network
in
ALLOWED_IPS
:
for
network
in
ALLOWED_IPS
:
...
...
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