parseAuthScope parses an authentication scope string of the form `$resource:$remote:$actions`
(scopeStr string)
| 76 | |
| 77 | // parseAuthScope parses an authentication scope string of the form `$resource:$remote:$actions` |
| 78 | func 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 |
no outgoing calls
no test coverage detected
searching dependent graphs…