Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
DTCurrie committed Oct 15, 2024
1 parent f0f022b commit 4b55c7e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions web/auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,9 @@ const (
// ViamTokenCookie is the cookie name for an authenticated access token
//nolint:gosec
ViamTokenCookie string = "viam.auth.token"
// ViamRefreshCookie is the cookie name for an authenticated refresh token
//nolint:gosec
// ViamRefreshCookie is the cookie name for an authenticated refresh token.
ViamRefreshCookie string = "viam.auth.refresh"
// ViamExpiryCookie is the cookie name for an authenticated token's expiry
//nolint:gosec
// ViamExpiryCookie is the cookie name for an authenticated token's expiry.
ViamExpiryCookie string = "viam.auth.expiry"
)

Expand Down Expand Up @@ -439,7 +437,7 @@ func getBearerToken(req *http.Request) string {
return ""
}

// getAuthCookieValues reads the authentication cookie values as a /token response
// getAuthCookieValues reads the authentication cookie values as a /token response.
func getAuthCookieValues(r *http.Request) *tokenResponse {
token, err := r.Cookie(ViamTokenCookie)
if err != nil || token.Value == "" {
Expand All @@ -465,7 +463,7 @@ func getAuthCookieValues(r *http.Request) *tokenResponse {
}

// clearAuthCookies removes auth cookies from /callback
// - to be used after reading the cookies so they can only be used once
// - to be used after reading the cookies so they can only be used once.
func clearAuthCookies(w http.ResponseWriter) {
http.SetCookie(w, &http.Cookie{
Name: ViamTokenCookie,
Expand Down
2 changes: 1 addition & 1 deletion web/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func createRequest(t *testing.T) *http.Request {
return r
}

func setCookie(r *http.Request, key string, value string) {
func setCookie(r *http.Request, key, value string) {
r.AddCookie(&http.Cookie{
Name: key,
Value: value,
Expand Down

0 comments on commit 4b55c7e

Please sign in to comment.