Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.buildout
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
6
Merge Requests
6
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.buildout
Commits
9a43b60e
Commit
9a43b60e
authored
Sep 11, 2024
by
Alain Takoudjou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove support for credentials in url
parent
fc3db14c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
10 deletions
+4
-10
src/zc/buildout/download.py
src/zc/buildout/download.py
+4
-10
No files found.
src/zc/buildout/download.py
View file @
9a43b60e
...
@@ -327,8 +327,6 @@ class Download(object):
...
@@ -327,8 +327,6 @@ class Download(object):
header_dict
[
"PRIVATE-TOKEN"
]
=
auth
[
1
]
header_dict
[
"PRIVATE-TOKEN"
]
=
auth
[
1
]
else
:
else
:
query
[
auth
[
0
]]
=
auth
[
2
]
# only private_token is supported ?
query
[
auth
[
0
]]
=
auth
[
2
]
# only private_token is supported ?
elif
p
.
username
==
"PRIVATE-TOKEN"
and
p
.
password
:
header_dict
[
"PRIVATE-TOKEN"
]
=
p
.
password
qrepo
=
quote
(
repo
,
''
)
qrepo
=
quote
(
repo
,
''
)
qfilepath
=
quote
(
filepath
,
''
)
qfilepath
=
quote
(
filepath
,
''
)
...
@@ -350,14 +348,10 @@ class Download(object):
...
@@ -350,14 +348,10 @@ class Download(object):
for
k
,
v
in
headers
.
items
():
for
k
,
v
in
headers
.
items
():
req
.
add_header
(
k
,
v
)
req
.
add_header
(
k
,
v
)
with
closing
(
urlopen
(
req
))
as
src
:
with
closing
(
urlopen
(
req
))
as
src
:
try
:
# If access to gitlab url was denied,
# If Access denied to gitlab url, we have response 200 here
# we have been redirected to BASE_URL/users/sign_in
# and url is to BASE_URL/users/sign_in
if
src
.
url
.
endswith
(
"users/sign_in"
):
if
src
.
url
.
rindex
(
"users/sign_in"
):
raise
GitlabAccessDeniedError
(
"Redirected to Sign in page"
)
raise
GitlabAccessDeniedError
(
"Redirected to Sign in page"
)
except
ValueError
:
# nothing to do
pass
with
open
(
tmp_path
,
'wb'
)
as
dst
:
with
open
(
tmp_path
,
'wb'
)
as
dst
:
shutil
.
copyfileobj
(
src
,
dst
)
shutil
.
copyfileobj
(
src
,
dst
)
return
tmp_path
,
src
.
info
()
return
tmp_path
,
src
.
info
()
...
...
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