MCPcopy Create free account
hub / github.com/containers/image / parseAuthScope

Function parseAuthScope

docker/wwwauthenticate.go:78–87  ·  view source on GitHub ↗

parseAuthScope parses an authentication scope string of the form `$resource:$remote:$actions`

(scopeStr string)

Source from the content-addressed store, hash-verified

76
77// parseAuthScope parses an authentication scope string of the form `$resource:$remote:$actions`
78func parseAuthScope(scopeStr string) (*authScope, error) {
79 if parts := strings.Split(scopeStr, ":"); len(parts) == 3 {
80 return &authScope{
81 resourceType: parts[0],
82 remoteName: parts[1],
83 actions: parts[2],
84 }, nil
85 }
86 return nil, fmt.Errorf("error parsing auth scope: '%s'", scopeStr)
87}
88
89// NOTE: This is not a fully compliant parser per RFC 7235:
90// Most notably it does not support more than one challenge within a single header

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…