mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-07 17:48:29 +08:00
pr: https://github.com/milvus-io/milvus/pull/40637 Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
This commit is contained in:
parent
9c41636a95
commit
182b3c17d0
@ -81,6 +81,7 @@ const (
|
||||
const (
|
||||
ContextRequest = "request"
|
||||
ContextUsername = "username"
|
||||
ContextToken = "token"
|
||||
VectorCollectionsPath = "/vector/collections"
|
||||
VectorCollectionsCreatePath = "/vector/collections/create"
|
||||
VectorCollectionsDescribePath = "/vector/collections/describe"
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -32,6 +32,7 @@ const (
|
||||
ContextReturnCode = "code"
|
||||
ContextReturnMessage = "message"
|
||||
ContextRequest = "request"
|
||||
ContextToken = "token"
|
||||
)
|
||||
|
||||
type RestfulInfo struct {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user