Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
R
re6stnet
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
0
Merge Requests
0
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
zhifan huang
re6stnet
Commits
47d1bb85
Commit
47d1bb85
authored
Apr 08, 2015
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
registry: limit access to request and delete token, authorize registry ipv4 address
parent
a2dc2837
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
re6st/registry.py
re6st/registry.py
+4
-2
No files found.
re6st/registry.py
View file @
47d1bb85
...
@@ -40,7 +40,6 @@ def rpc(f):
...
@@ -40,7 +40,6 @@ def rpc(f):
f
.
getcallargs
=
eval
(
"lambda %s: locals()"
%
','
.
join
(
args
[
1
:]))
f
.
getcallargs
=
eval
(
"lambda %s: locals()"
%
','
.
join
(
args
[
1
:]))
return
f
return
f
class
RegistryServer
(
object
):
class
RegistryServer
(
object
):
peers
=
0
,
()
peers
=
0
,
()
...
@@ -236,8 +235,11 @@ class RegistryServer(object):
...
@@ -236,8 +235,11 @@ class RegistryServer(object):
def
handle_request
(
self
,
request
,
method
,
kw
,
def
handle_request
(
self
,
request
,
method
,
kw
,
_localhost
=
(
'127.0.0.1'
,
'::1'
)):
_localhost
=
(
'127.0.0.1'
,
'::1'
)):
if
self
.
config
.
bind4
:
_localhost
+=
(
self
.
config
.
bind4
,)
m
=
getattr
(
self
,
method
)
m
=
getattr
(
self
,
method
)
if
method
in
(
'revoke'
,
'versions'
,
'topology'
):
if
method
in
(
'revoke'
,
'versions'
,
'topology'
,
'requestAddToken'
,
'requestDeleteToken'
):
x_forwarded_for
=
request
.
headers
.
get
(
'X-Forwarded-For'
)
x_forwarded_for
=
request
.
headers
.
get
(
'X-Forwarded-For'
)
if
request
.
client_address
[
0
]
not
in
_localhost
or
\
if
request
.
client_address
[
0
]
not
in
_localhost
or
\
x_forwarded_for
and
x_forwarded_for
not
in
_localhost
:
x_forwarded_for
and
x_forwarded_for
not
in
_localhost
:
...
...
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