google / google/licensecheck

middleware.go

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
513
Forks
99
PR merge metrics
No merged PRs in 30d

Description

// Added import
import "crypto/subtle"

// Before
if !ok || reqUsername != username || reqPassword != password {

// After
usernameMatch := subtle.ConstantTimeCompare([]byte(reqUsername), []byte(username)) == 1
passwordMatch := subtle.ConstantTimeCompare([]byte(reqPassword), []byte(password)) == 1
if !ok || !usernameMatch || !passwordMatch {Termuxu/Androidu (Go 1.26.getPathFromContext()- duplikatgetPathWithFallback()
handleMetrics()/ recordRequestMetrics()— neizvezeni naslijeđeni omotači
Nekorištene metričke varijable na razini paketa
computeResponseSize()— duplikat umetnutog tekstac.Writer.Size()

Image

Contributor guide

Open the contributing guide

Research direction

Start with middleware.go and separate the constant-time credential comparison from the listed cleanup items. Inspect getPathFromContext(), getPathWithFallback(), handleMetrics(), recordRequestMetrics(), package-level metric variables, and computeResponseSize(); done means the requested duplicates, wrappers, and unused variables are resolved without losing the intended middleware behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
security
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.