Propagate the grant user context to the signed grant to fix image sharing.
This commit is contained in:
parent
246ff556b9
commit
450b112f2c
4 changed files with 19 additions and 6 deletions
|
@ -60,7 +60,8 @@ def generate_headers(scope=GrantType.READ_REPOSITORY):
|
|||
|
||||
if permission.can():
|
||||
# Generate a signed grant which expires here
|
||||
signature = generate_signed_token(grants)
|
||||
user_context = get_authenticated_user() and get_authenticated_user().username
|
||||
signature = generate_signed_token(grants, user_context)
|
||||
response.headers['WWW-Authenticate'] = signature
|
||||
response.headers['X-Docker-Token'] = signature
|
||||
else:
|
||||
|
|
Reference in a new issue