Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime Martinez <jmartinez@gitlab.com>2020-05-25 06:21:48 +0300
committerJaime Martinez <jmartinez@gitlab.com>2020-06-01 03:39:04 +0300
commitc557de8d5e324da35d55fbb763a00574ff8f47e9 (patch)
treed65ef36d3da273efe8c4fb403e72fe67cee5cfbf /internal/auth
parent35c937be058d70d1e4fd4dd49de329dc32936f73 (diff)
Enable the remaining linters
- ineffassign - misspell - structcheck - typecheck - unconvert - unused - varcheck - whitespace
Diffstat (limited to 'internal/auth')
-rw-r--r--internal/auth/auth.go3
-rw-r--r--internal/auth/auth_test.go1
2 files changed, 1 insertions, 3 deletions
diff --git a/internal/auth/auth.go b/internal/auth/auth.go
index b1198328..6dce1ab8 100644
--- a/internal/auth/auth.go
+++ b/internal/auth/auth.go
@@ -87,7 +87,6 @@ func (a *Auth) getSessionFromStore(r *http.Request) (*sessions.Session, error) {
}
func (a *Auth) checkSession(w http.ResponseWriter, r *http.Request) (*sessions.Session, error) {
-
// Create or get session
session, errsession := a.getSessionFromStore(r)
@@ -148,7 +147,6 @@ func (a *Auth) TryAuthenticate(w http.ResponseWriter, r *http.Request, domains s
}
func (a *Auth) checkAuthenticationResponse(session *sessions.Session, w http.ResponseWriter, r *http.Request) {
-
if !validateState(r, session) {
// State is NOT ok
logRequest(r).Warn("Authentication state did not match expected")
@@ -483,7 +481,6 @@ func (a *Auth) checkAuthentication(w http.ResponseWriter, r *http.Request, proje
// CheckAuthenticationWithoutProject checks if user is authenticated and has a valid token
func (a *Auth) CheckAuthenticationWithoutProject(w http.ResponseWriter, r *http.Request) bool {
-
if a == nil {
// No auth supported
return false
diff --git a/internal/auth/auth_test.go b/internal/auth/auth_test.go
index 87cc988d..f4decb5e 100644
--- a/internal/auth/auth_test.go
+++ b/internal/auth/auth_test.go
@@ -367,6 +367,7 @@ func TestGetTokenIfExistsWhenTokenExists(t *testing.T) {
session.Save(r, result)
token, err := auth.GetTokenIfExists(result, r)
+ require.NoError(t, err)
require.Equal(t, testAccessToken, token)
}