mirror of
https://github.com/genuinetools/reg.git
synced 2024-05-20 03:58:32 -04:00
run gofmt
Signed-off-by: Jess Frazelle <acidburn@microsoft.com>
This commit is contained in:
parent
3ad96f60b4
commit
eaf071b3ef
|
@ -32,7 +32,7 @@ func parseChallenge(challengeHeader string) (*authService, error) {
|
|||
if d := len(match); d != 1 {
|
||||
return nil, fmt.Errorf("malformed auth challenge header: '%s', %d", challengeHeader, d)
|
||||
}
|
||||
parts := strings.SplitN(strings.TrimSpace(match[0][1]), ",",3)
|
||||
parts := strings.SplitN(strings.TrimSpace(match[0][1]), ",", 3)
|
||||
|
||||
var realm, service string
|
||||
var scope []string
|
||||
|
|
|
@ -21,7 +21,11 @@ func (asm authServiceMock) equalTo(v *authService) bool {
|
|||
if asm.service != v.Service {
|
||||
return false
|
||||
}
|
||||
for i, v := range v.Scope { if v != asm.scope[i] { return false } }
|
||||
for i, v := range v.Scope {
|
||||
if v != asm.scope[i] {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
if asm.realm != v.Realm.String() {
|
||||
return false
|
||||
|
@ -57,9 +61,9 @@ func TestParseChallengePush(t *testing.T) {
|
|||
{
|
||||
header: `Bearer realm="https://foo.com/v2/token",service="foo.com",scope="repository:pdr/tls:pull,push"`,
|
||||
value: authServiceMock{
|
||||
realm: "https://foo.com/v2/token",
|
||||
service: "foo.com",
|
||||
scope: []string{"repository:pdr/tls:pull,push"},
|
||||
realm: "https://foo.com/v2/token",
|
||||
service: "foo.com",
|
||||
scope: []string{"repository:pdr/tls:pull,push"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue