parent
18097a1bd6
commit
3439f814b6
2 changed files with 14 additions and 3 deletions
|
@ -127,9 +127,11 @@ def get_auth_headers(repository=None, scopes=None):
|
|||
realm_auth_path,
|
||||
app.config['SERVER_HOSTNAME'])
|
||||
if repository:
|
||||
authenticate += ',scope=repository:{0}'.format(repository)
|
||||
scopes_string = "repository:{0}".format(repository)
|
||||
if scopes:
|
||||
authenticate += ':' + ','.join(scopes)
|
||||
scopes_string += ':' + ','.join(scopes)
|
||||
|
||||
authenticate += ',scope="{0}"'.format(scopes_string)
|
||||
|
||||
headers['WWW-Authenticate'] = authenticate
|
||||
headers['Docker-Distribution-API-Version'] = 'registry/2.0'
|
||||
|
|
Reference in a new issue