Skip to content

Commit b60e546

Browse files
committed
chore: review comments
1 parent 15a3753 commit b60e546

6 files changed

Lines changed: 9 additions & 9 deletions

File tree

internal/controller/context_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ func TestContextController(t *testing.T) {
125125

126126
router.ServeHTTP(recorder, request)
127127

128-
assert.Equal(t, recorder.Result().StatusCode, http.StatusOK)
128+
assert.Equal(t, http.StatusOK, recorder.Code)
129129
assert.Equal(t, test.expected, recorder.Body.String())
130130
})
131131
}

internal/controller/oidc_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func TestOIDCController(t *testing.T) {
329329
},
330330
},
331331
{
332-
description: "Ensure token endpoint deletes code afer use",
332+
description: "Ensure token endpoint deletes code after use",
333333
middlewares: []gin.HandlerFunc{
334334
simpleCtx,
335335
},

internal/controller/proxy_controller_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ func TestProxyController(t *testing.T) {
282282
},
283283
},
284284
{
285-
description: "Ensure user allow ACL allows correct user (should allow testuer)",
285+
description: "Ensure user allow ACL allows correct user (should allow testuser)",
286286
middlewares: []gin.HandlerFunc{
287287
simpleCtx,
288288
},
@@ -296,7 +296,7 @@ func TestProxyController(t *testing.T) {
296296
},
297297
},
298298
{
299-
description: "Ensure user allow ACL blocks incorrect user (should block testuer)",
299+
description: "Ensure user allow ACL blocks incorrect user (should block totpuser)",
300300
middlewares: []gin.HandlerFunc{
301301
simpleCtxTotp,
302302
},

internal/controller/user_controller_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ func TestUserController(t *testing.T) {
7474
assert.Equal(t, "tinyauth-session", cookie.Name)
7575
assert.True(t, cookie.HttpOnly)
7676
assert.Equal(t, "example.com", cookie.Domain)
77-
assert.Equal(t, cookie.MaxAge, 10)
77+
assert.Equal(t, 10, cookie.MaxAge)
7878
},
7979
},
8080
{
@@ -163,7 +163,7 @@ func TestUserController(t *testing.T) {
163163
assert.Equal(t, "tinyauth-session", cookie.Name)
164164
assert.True(t, cookie.HttpOnly)
165165
assert.Equal(t, "example.com", cookie.Domain)
166-
assert.Equal(t, cookie.MaxAge, 3600) // 1 hour, default for totp pending sessions
166+
assert.Equal(t, 3600, cookie.MaxAge) // 1 hour, default for totp pending sessions
167167
},
168168
},
169169
{
@@ -233,7 +233,7 @@ func TestUserController(t *testing.T) {
233233
assert.Equal(t, "tinyauth-session", totpCookie.Name)
234234
assert.True(t, totpCookie.HttpOnly)
235235
assert.Equal(t, "example.com", totpCookie.Domain)
236-
assert.Equal(t, totpCookie.MaxAge, 10) // should use the regular session expiry time
236+
assert.Equal(t, 10, totpCookie.MaxAge) // should use the regular session expiry time
237237
},
238238
},
239239
{

internal/controller/well_known_controller_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ func TestWellKnownController(t *testing.T) {
6666
ServiceDocumentation: "https://tinyauth.app/docs/guides/oidc",
6767
}
6868

69-
assert.Equal(t, res, expected)
69+
assert.Equal(t, expected, res)
7070
},
7171
},
7272
{

internal/service/auth_service.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,5 +801,5 @@ func (auth *AuthService) lockdownMode() {
801801
func (auth *AuthService) ClearRateLimitsTestingOnly() {
802802
auth.loginMutex.Lock()
803803
auth.loginAttempts = make(map[string]*LoginAttempt)
804-
auth.loginMutex.Unlock()
804+
auth.loginMutex.Unlock()
805805
}

0 commit comments

Comments
 (0)