mirror of
https://github.com/distribution/distribution.git
synced 2025-09-16 23:29:30 +00:00
Change DELETE action from "*" to "delete"
With token authentication, requiring the "*" action for DELETE requests makes it impossible to administratively lock a repository against pushes and pulls but still allow deletion. This change adds a new "delete" action for DELETE requests to make that possible. Signed-off-by: Noah Treuhaft <noah.treuhaft@docker.com>
This commit is contained in:
@@ -901,12 +901,10 @@ func appendAccessRecords(records []auth.Access, method string, repo string) []au
|
||||
Action: "push",
|
||||
})
|
||||
case "DELETE":
|
||||
// DELETE access requires full admin rights, which is represented
|
||||
// as "*". This may not be ideal.
|
||||
records = append(records,
|
||||
auth.Access{
|
||||
Resource: resource,
|
||||
Action: "*",
|
||||
Action: "delete",
|
||||
})
|
||||
}
|
||||
return records
|
||||
|
Reference in New Issue
Block a user