Fix basic security tests

This commit is contained in:
TwiN 2021-12-31 00:20:54 -05:00
parent be9087bee3
commit 54779e1db8

View File

@ -11,7 +11,7 @@ func mockHandler(writer http.ResponseWriter, _ *http.Request) {
} }
func TestHandlerWhenNotAuthenticated(t *testing.T) { func TestHandlerWhenNotAuthenticated(t *testing.T) {
handler := Handler(mockHandler, &Config{&BasicConfig{ handler := Handler(mockHandler, &Config{Basic: &BasicConfig{
Username: "john.doe", Username: "john.doe",
PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22", PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22",
}}) }})
@ -26,7 +26,7 @@ func TestHandlerWhenNotAuthenticated(t *testing.T) {
} }
func TestHandlerWhenAuthenticated(t *testing.T) { func TestHandlerWhenAuthenticated(t *testing.T) {
handler := Handler(mockHandler, &Config{&BasicConfig{ handler := Handler(mockHandler, &Config{Basic: &BasicConfig{
Username: "john.doe", Username: "john.doe",
PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22", PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22",
}}) }})
@ -42,7 +42,7 @@ func TestHandlerWhenAuthenticated(t *testing.T) {
} }
func TestHandlerWhenAuthenticatedWithBadCredentials(t *testing.T) { func TestHandlerWhenAuthenticatedWithBadCredentials(t *testing.T) {
handler := Handler(mockHandler, &Config{&BasicConfig{ handler := Handler(mockHandler, &Config{Basic: &BasicConfig{
Username: "john.doe", Username: "john.doe",
PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22", PasswordSha512Hash: "6b97ed68d14eb3f1aa959ce5d49c7dc612e1eb1dafd73b1e705847483fd6a6c809f2ceb4e8df6ff9984c6298ff0285cace6614bf8daa9f0070101b6c89899e22",
}}) }})