mirror of
https://github.com/gin-gonic/gin.git
synced 2026-11-23 11:33:37 +08:00
Merge c45d55938b09c84a6870e21eecb2b6b72e418a11 into 0f09c3a9b4626d9fe9979cf4d0521d6ae32ab646
This commit is contained in:
commit
fafdb1ce09
6
auth.go
6
auth.go
@ -9,10 +9,16 @@ import (
|
||||
"encoding/base64"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
||||
"github.com/gin-gonic/gin/internal/bytesconv"
|
||||
)
|
||||
|
||||
// basicAuthFailureDelay is a small artificial delay applied on failed
|
||||
// authentication attempts to throttle brute-force and credential-stuffing
|
||||
// attacks against BasicAuth protected routes.
|
||||
const basicAuthFailureDelay = 500 * time.Millisecond
|
||||
|
||||
// AuthUserKey is the cookie name for user credential in basic auth.
|
||||
const AuthUserKey = "user"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user