fix: remove the unused user use cases, fix the specs that no longer match the code, include api/middleware and api/pkg/claims in mutation testing, log failures that password reset requests currently ignore, and reject user_id claims that don't fit a user id
This commit is contained in:
1 parent
cbb403011a
commit
3282b0580c
22 files changed
+260
-314
No files matched your search
@@ -1,6 +1,7 @@
|
||||
package claims
|
||||
|
||||
import (
|
||||
"math"
|
||||
"net/http"
|
||||
|
||||
"github.com/go-chi/jwtauth/v5"
|
||||
@@ -22,6 +23,10 @@ func UserId(r *http.Request) (uint32, bool) {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
if userIdFloat < 0 || userIdFloat > math.MaxUint32 || userIdFloat != math.Trunc(userIdFloat) {
|
||||
return 0, false
|
||||
}
|
||||
|
||||
return uint32(userIdFloat), true
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user