parent
937367caaf
commit
e1ee36b979
2 changed files with 5 additions and 4 deletions
|
@ -45,7 +45,7 @@ func TestAuthHeaderParse(t *testing.T) {
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
authHeader, err := center.parseAuthHeader(tc.header)
|
authHeader, err := center.parseAuthHeader(tc.header)
|
||||||
require.Equal(t, tc.err, err, tc.header)
|
require.ErrorIs(t, err, tc.err, tc.header)
|
||||||
require.Equal(t, tc.expected, authHeader, tc.header)
|
require.Equal(t, tc.expected, authHeader, tc.header)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -82,8 +82,8 @@ func TestAuthHeaderGetAddress(t *testing.T) {
|
||||||
err: defaulErr,
|
err: defaulErr,
|
||||||
},
|
},
|
||||||
} {
|
} {
|
||||||
_, err := tc.authHeader.getAddress()
|
_, err := getAddress(tc.authHeader.AccessKeyID)
|
||||||
require.Equal(t, tc.err, err, tc.authHeader.AccessKeyID)
|
require.ErrorIs(t, err, tc.err, tc.authHeader.AccessKeyID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ func TestCheckFormatContentSHA256(t *testing.T) {
|
||||||
} {
|
} {
|
||||||
t.Run(tc.name, func(t *testing.T) {
|
t.Run(tc.name, func(t *testing.T) {
|
||||||
err := checkFormatHashContentSHA256(tc.hash)
|
err := checkFormatHashContentSHA256(tc.hash)
|
||||||
require.Equal(t, tc.error, err)
|
require.ErrorIs(t, err, tc.error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,6 +44,7 @@ func (c *centerMock) Authenticate(*http.Request) (*middleware.Box, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
return &middleware.Box{
|
return &middleware.Box{
|
||||||
|
AuthHeaders: &middleware.AuthHeader{},
|
||||||
AccessBox: &accessbox.Box{
|
AccessBox: &accessbox.Box{
|
||||||
Gate: &accessbox.GateData{
|
Gate: &accessbox.GateData{
|
||||||
BearerToken: token,
|
BearerToken: token,
|
||||||
|
|
Loading…
Reference in a new issue