enhance: remain token after authorize (#39453)

Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>
master
aoiasd 2025-01-20 20:27:23 +08:00 committed by GitHub
parent 140c5a0a75
commit a41de38f21
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 0 deletions

View File

@ -106,6 +106,7 @@ func AuthenticationInterceptor(ctx context.Context) (context.Context, error) {
metrics.UserRPCCounter.WithLabelValues(user).Inc()
userToken := fmt.Sprintf("%s%s%s", user, util.CredentialSeperator, util.PasswordHolder)
md[strings.ToLower(util.HeaderAuthorize)] = []string{crypto.Base64Encode(userToken)}
md[util.HeaderToken] = []string{rawToken}
ctx = metadata.NewIncomingContext(ctx, md)
} else {
// username+password authentication

View File

@ -46,6 +46,7 @@ const (
FieldIndexPrefix = "field-index"
HeaderAuthorize = "authorization"
HeaderToken = "token"
// HeaderSourceID identify requests from Milvus members and client requests
HeaderSourceID = "sourceId"
// MemberCredID id for Milvus members (data/index/query node/coord component)