mirror of
https://github.com/crowdsecurity/crowdsec.git
synced 2025-05-11 12:25:53 +02:00
add missing scenarios in first login when authenticating with TLS (#2454)
* refact jwt:Authenticator * include scenarios in first login request for machines with tlsAuth * log.Printf -> log.Infof * errors.Wrap -> fmt.Errorf * don't override validation error * fix test
This commit is contained in:
parent
6e228f3f3f
commit
0ecb6eefee
2 changed files with 150 additions and 116 deletions
|
@ -55,7 +55,7 @@ func TestLogin(t *testing.T) {
|
|||
router.ServeHTTP(w, req)
|
||||
|
||||
assert.Equal(t, 401, w.Code)
|
||||
assert.Equal(t, "{\"code\":401,\"message\":\"input format error\"}", w.Body.String())
|
||||
assert.Equal(t, "{\"code\":401,\"message\":\"validation failure list:\\npassword in body is required\"}", w.Body.String())
|
||||
|
||||
//Validate machine
|
||||
err = ValidateMachine("test", config.API.Server.DbConfig)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue