File tree Expand file tree Collapse file tree 1 file changed +0
-25
lines changed
Expand file tree Collapse file tree 1 file changed +0
-25
lines changed Original file line number Diff line number Diff line change @@ -31,31 +31,6 @@ def _get_auth_token(self) -> str:
3131 return self ._auth_token
3232
3333 self ._auth_token = self .password
34-
35- sess = requests .Session ()
36- sess .headers .update ({
37- 'Authorization' : f'Bearer { self ._auth_token } ' ,
38- 'Content-Type' : 'application/json'
39- })
40-
41- test_url = f'{ self .DOCKER_HUB_API } /repositories/{ self .username } /'
42- resp = sess .get (test_url , params = {'page_size' : 1 })
43-
44- if resp .status_code == 200 :
45- return self ._auth_token
46-
47- auth_data = {
48- 'username' : self .username ,
49- 'password' : self .password
50- }
51-
52- resp = requests .post (f'{ self .DOCKER_HUB_API } /users/login/' , json = auth_data )
53- if resp .status_code != 200 :
54- sys .stderr .write (f'Docker Hub login failed: { resp .status_code } \n ' )
55- sys .stderr .write (f'{ resp .text } \n ' )
56- sys .exit (1 )
57-
58- self ._auth_token = resp .json ()['token' ]
5934 return self ._auth_token
6035
6136 def list_versions (self ) -> List [ImageVersion ]:
You can’t perform that action at this time.
0 commit comments