forked from TrueCloudLab/distribution
Merge pull request #2095 from dmcgowan/enforce-class-backward-compatibility
Enforce image is treated as empty class
This commit is contained in:
commit
844b92879f
1 changed files with 3 additions and 1 deletions
|
@ -155,7 +155,9 @@ type RepositoryScope struct {
|
||||||
// using the scope grammar
|
// using the scope grammar
|
||||||
func (rs RepositoryScope) String() string {
|
func (rs RepositoryScope) String() string {
|
||||||
repoType := "repository"
|
repoType := "repository"
|
||||||
if rs.Class != "" {
|
// Keep existing format for image class to maintain backwards compatibility
|
||||||
|
// with authorization servers which do not support the expanded grammar.
|
||||||
|
if rs.Class != "" && rs.Class != "image" {
|
||||||
repoType = fmt.Sprintf("%s(%s)", repoType, rs.Class)
|
repoType = fmt.Sprintf("%s(%s)", repoType, rs.Class)
|
||||||
}
|
}
|
||||||
return fmt.Sprintf("%s:%s:%s", repoType, rs.Repository, strings.Join(rs.Actions, ","))
|
return fmt.Sprintf("%s:%s:%s", repoType, rs.Repository, strings.Join(rs.Actions, ","))
|
||||||
|
|
Loading…
Reference in a new issue