Skip to content

Commit

Permalink
remove nolint spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
umputun committed Aug 20, 2023
1 parent 1fbd4c7 commit 4bfd6d6
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions middleware/auth_test.go
Expand Up @@ -49,7 +49,7 @@ func TestAuthJWTCookie(t *testing.T) {
defer server.Close()

client := &http.Client{Timeout: 5 * time.Second}
expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint

t.Run("valid token", func(t *testing.T) {
req, err := http.NewRequest("GET", server.URL+"/auth", http.NoBody)
Expand Down Expand Up @@ -150,7 +150,7 @@ func TestAuthJWTRefresh(t *testing.T) {
req, err := http.NewRequest("GET", server.URL+"/auth", http.NoBody)
require.NoError(t, err)

expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint
req.AddCookie(&http.Cookie{Name: "JWT", Value: testJwtExpired, HttpOnly: true, Path: "/", MaxAge: expiration, Secure: false})
req.Header.Add("X-XSRF-TOKEN", "random id")

Expand Down Expand Up @@ -191,7 +191,7 @@ func TestAuthJWTRefreshConcurrentWithCache(t *testing.T) {
req, err := http.NewRequest("GET", server.URL+"/auth", http.NoBody)
require.NoError(t, err)

expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint
req.AddCookie(&http.Cookie{Name: "JWT", Value: testJwtExpired, HttpOnly: true, Path: "/",
MaxAge: expiration, Secure: false})
req.Header.Add("X-XSRF-TOKEN", "random id")
Expand Down Expand Up @@ -224,7 +224,7 @@ func TestAuthJWTRefreshConcurrentWithCache(t *testing.T) {
client := &http.Client{Jar: jar, Timeout: 5 * time.Second}
req, err := http.NewRequest("GET", server.URL+"/auth", http.NoBody)
require.NoError(t, err)
expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint
req.AddCookie(&http.Cookie{Name: "JWT", Value: tkn, HttpOnly: true, Path: "/", MaxAge: expiration, Secure: false})
req.Header.Add("X-XSRF-TOKEN", "random id")
resp, err := client.Do(req)
Expand Down Expand Up @@ -260,7 +260,7 @@ func TestAuthJWTRefreshFailed(t *testing.T) {
req, err := http.NewRequest("GET", server.URL+"/auth", http.NoBody)
require.NoError(t, err)

expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint
req.AddCookie(&http.Cookie{Name: "JWT", Value: testJwtExpired, HttpOnly: true, Path: "/",
MaxAge: expiration, Secure: false})
req.Header.Add("X-XSRF-TOKEN", "random id")
Expand Down Expand Up @@ -463,7 +463,7 @@ func TestRBAC(t *testing.T) {
defer server.Close()

// employee route only, token with employee role
expiration := int(365 * 24 * time.Hour.Seconds()) // nolint
expiration := int(365 * 24 * time.Hour.Seconds()) //nolint
req, err := http.NewRequest("GET", server.URL+"/authForEmployees", http.NoBody)
require.Nil(t, err)
req.AddCookie(&http.Cookie{Name: "JWT", Value: testJwtWithRole, HttpOnly: true, Path: "/",
Expand All @@ -475,8 +475,8 @@ func TestRBAC(t *testing.T) {
require.NoError(t, err)
assert.Equal(t, 201, resp.StatusCode, "valid token user")

// employee route only, token without employee role
expiration = int(365 * 24 * time.Hour.Seconds()) // nolint
// employee route only, token without an employee role
expiration = int(365 * 24 * time.Hour.Seconds()) //nolint
req, err = http.NewRequest("GET", server.URL+"/authForEmployees", http.NoBody)
require.Nil(t, err)
req.AddCookie(&http.Cookie{Name: "JWT", Value: testJwtValid, HttpOnly: true, Path: "/",
Expand Down

0 comments on commit 4bfd6d6

Please sign in to comment.