mirror of https://github.com/milvus-io/milvus.git
enhance: [2.5] remain token after authorize (#39455)
relate: https://github.com/milvus-io/milvus/issues/39285 Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>2.5
parent
f62eca09a0
commit
15d60c60c2
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue