Skip to content

Commit e8c0cd7

Browse files
committed
Fix deepsource issues
1 parent 69843bc commit e8c0cd7

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

auth/memory.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ func (a *MemoryAuthenticator) ValidateAndReject(w http.ResponseWriter, r *http.R
6969
w.Header().Set("content-type", "application/json")
7070
log.Println("An error occurred while validating authorization for an HTTP request!", err)
7171
http.Error(w, "{\"error\": \"Internal Server Error!\"}", http.StatusInternalServerError)
72+
return ""
7273
} else if username == "" {
7374
w.Header().Set("content-type", "application/json")
7475
http.Error(w, "{\"error\": \"You are not authenticated to access this resource!\"}",
7576
http.StatusUnauthorized)
77+
return ""
7678
}
7779
return username
7880
}

auth/redis.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,12 @@ func (a *RedisAuthenticator) ValidateAndReject(w http.ResponseWriter, r *http.Re
8585
w.Header().Set("content-type", "application/json")
8686
log.Println("An error occurred while validating authorization for an HTTP request!", err)
8787
http.Error(w, "{\"error\": \"Internal Server Error!\"}", http.StatusInternalServerError)
88+
return ""
8889
} else if username == "" {
8990
w.Header().Set("content-type", "application/json")
9091
http.Error(w, "{\"error\": \"You are not authenticated to access this resource!\"}",
9192
http.StatusUnauthorized)
93+
return ""
9294
}
9395
return username
9496
}

auth/users.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ func createUserStore(usersJsonPath string) (*xsync.MapOf[string, string], contex
4545
users := xsync.NewMapOf[string, string]()
4646
fileUpdates, cancel, err := system.ReadAndWatchFile(usersJsonPath)
4747
if err != nil {
48+
// skipcq RVV-A0003
4849
// panic here, as this is critical for authenticator and we don't want to continue without it
4950
log.Panicln("An error occurred while reading " + usersJsonPath + "! " + err.Error())
5051
}

0 commit comments

Comments
 (0)