Merge pull request #28459 from dmcgowan/plugin-repository-pinning
Plugin repository pinning Upstream-commit: c1a1b381f91367afa94a69649d9aa808acecc8ac Component: engine
This commit is contained in:
Generated
Vendored
+6
-1
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user