mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2026-03-30 10:27:55 +00:00
chore: review comments
This commit is contained in:
@@ -125,7 +125,7 @@ func TestContextController(t *testing.T) {
|
||||
|
||||
router.ServeHTTP(recorder, request)
|
||||
|
||||
assert.Equal(t, recorder.Result().StatusCode, http.StatusOK)
|
||||
assert.Equal(t, http.StatusOK, recorder.Code)
|
||||
assert.Equal(t, test.expected, recorder.Body.String())
|
||||
})
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ func TestOIDCController(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Ensure token endpoint deletes code afer use",
|
||||
description: "Ensure token endpoint deletes code after use",
|
||||
middlewares: []gin.HandlerFunc{
|
||||
simpleCtx,
|
||||
},
|
||||
|
||||
@@ -282,7 +282,7 @@ func TestProxyController(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Ensure user allow ACL allows correct user (should allow testuer)",
|
||||
description: "Ensure user allow ACL allows correct user (should allow testuser)",
|
||||
middlewares: []gin.HandlerFunc{
|
||||
simpleCtx,
|
||||
},
|
||||
@@ -296,7 +296,7 @@ func TestProxyController(t *testing.T) {
|
||||
},
|
||||
},
|
||||
{
|
||||
description: "Ensure user allow ACL blocks incorrect user (should block testuer)",
|
||||
description: "Ensure user allow ACL blocks incorrect user (should block totpuser)",
|
||||
middlewares: []gin.HandlerFunc{
|
||||
simpleCtxTotp,
|
||||
},
|
||||
|
||||
@@ -74,7 +74,7 @@ func TestUserController(t *testing.T) {
|
||||
assert.Equal(t, "tinyauth-session", cookie.Name)
|
||||
assert.True(t, cookie.HttpOnly)
|
||||
assert.Equal(t, "example.com", cookie.Domain)
|
||||
assert.Equal(t, cookie.MaxAge, 10)
|
||||
assert.Equal(t, 10, cookie.MaxAge)
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -163,7 +163,7 @@ func TestUserController(t *testing.T) {
|
||||
assert.Equal(t, "tinyauth-session", cookie.Name)
|
||||
assert.True(t, cookie.HttpOnly)
|
||||
assert.Equal(t, "example.com", cookie.Domain)
|
||||
assert.Equal(t, cookie.MaxAge, 3600) // 1 hour, default for totp pending sessions
|
||||
assert.Equal(t, 3600, cookie.MaxAge) // 1 hour, default for totp pending sessions
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -233,7 +233,7 @@ func TestUserController(t *testing.T) {
|
||||
assert.Equal(t, "tinyauth-session", totpCookie.Name)
|
||||
assert.True(t, totpCookie.HttpOnly)
|
||||
assert.Equal(t, "example.com", totpCookie.Domain)
|
||||
assert.Equal(t, totpCookie.MaxAge, 10) // should use the regular session expiry time
|
||||
assert.Equal(t, 10, totpCookie.MaxAge) // should use the regular session expiry time
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -66,7 +66,7 @@ func TestWellKnownController(t *testing.T) {
|
||||
ServiceDocumentation: "https://tinyauth.app/docs/guides/oidc",
|
||||
}
|
||||
|
||||
assert.Equal(t, res, expected)
|
||||
assert.Equal(t, expected, res)
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -801,5 +801,5 @@ func (auth *AuthService) lockdownMode() {
|
||||
func (auth *AuthService) ClearRateLimitsTestingOnly() {
|
||||
auth.loginMutex.Lock()
|
||||
auth.loginAttempts = make(map[string]*LoginAttempt)
|
||||
auth.loginMutex.Unlock()
|
||||
auth.loginMutex.Unlock()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user