@@ -101,27 +101,27 @@ def validate_parent_access(parent_id):
101
101
return False
102
102
full_repos_name = auth .get ('repository' , '' ).split ('/' )
103
103
if len (full_repos_name ) != 2 :
104
- logger .debug ('validate_token : Invalid repository field' )
104
+ logger .debug ('validate_parent : Invalid repository field' )
105
105
return False
106
106
index_endpoint = cfg .index_endpoint
107
107
if index_endpoint is None :
108
108
index_endpoint = 'https://index.docker.io'
109
109
index_endpoint = index_endpoint .strip ('/' )
110
- url = '{0}/v1/images /{1}/{2}/layer/{3}/access' .format (
110
+ url = '{0}/v1/repositories /{1}/{2}/layer/{3}/access' .format (
111
111
index_endpoint , full_repos_name [0 ], full_repos_name [1 ], parent_id
112
112
)
113
113
headers = {'Authorization' : flask .request .headers .get ('authorization' )}
114
114
resp = requests .get (url , verify = True , headers = headers )
115
115
if resp .status_code != 200 :
116
- logger .debug ('validate_parent_access : index returns status {0}' .format (
116
+ logger .debug ('validate_parent : index returns status {0}' .format (
117
117
resp .status_code
118
118
))
119
119
return False
120
120
try :
121
+ logger .debug ('validate_parent: Content: {0}' .format (resp .text ))
121
122
return json .loads (resp .text ).get ('access' , False )
122
-
123
123
except json .JSONDecodeError :
124
- logger .debug ('validate_parent_access : Wrong response format' )
124
+ logger .debug ('validate_parent : Wrong response format' )
125
125
return False
126
126
127
127
0 commit comments