Merge pull request #28459 from dmcgowan/plugin-repository-pinning

Plugin repository pinning
Upstream-commit: c1a1b381f91367afa94a69649d9aa808acecc8ac
Component: engine
This commit is contained in:
Victor Vieux
2016-12-08 11:28:52 -08:00
committed by GitHub
10 changed files with 41 additions and 19 deletions
@@ -147,13 +147,18 @@ type Scope interface {
// to a repository.
type RepositoryScope struct {
Repository string
Class string
Actions []string
}
// String returns the string representation of the repository
// using the scope grammar
func (rs RepositoryScope) String() string {
return fmt.Sprintf("repository:%s:%s", rs.Repository, strings.Join(rs.Actions, ","))
repoType := "repository"
if rs.Class != "" {
repoType = fmt.Sprintf("%s(%s)", repoType, rs.Class)
}
return fmt.Sprintf("%s:%s:%s", repoType, rs.Repository, strings.Join(rs.Actions, ","))
}
// RegistryScope represents a token scope for access