enhance: remain raw token for audit log (#40637)

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
aoiasd 2025-03-18 18:02:20 +08:00 committed by GitHub
parent c12abf4e2a
commit e5c12421f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 3 additions and 0 deletions

View File

@ -81,6 +81,7 @@ const (
const (
ContextRequest = "request"
ContextUsername = "username"
ContextToken = "token"
VectorCollectionsPath = "/vector/collections"
VectorCollectionsCreatePath = "/vector/collections/create"
VectorCollectionsDescribePath = "/vector/collections/describe"

View File

@ -139,6 +139,7 @@ func authenticate(c *gin.Context) {
user, err := proxy.VerifyAPIKey(rawToken)
if err == nil {
c.Set(httpserver.ContextUsername, user)
c.Set(httpserver.ContextToken, rawToken)
return
}
log.Ctx(context.TODO()).Warn("fail to verify apikey", zap.Error(err))

View File

@ -34,6 +34,7 @@ const (
ContextReturnCode = "code"
ContextReturnMessage = "message"
ContextRequest = "request"
ContextToken = "token"
)
type RestfulInfo struct {