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>pull/39439/merge
parent
f62eca09a0
commit
15d60c60c2
|
@ -106,6 +106,7 @@ func AuthenticationInterceptor(ctx context.Context) (context.Context, error) {
|
||||||
metrics.UserRPCCounter.WithLabelValues(user).Inc()
|
metrics.UserRPCCounter.WithLabelValues(user).Inc()
|
||||||
userToken := fmt.Sprintf("%s%s%s", user, util.CredentialSeperator, util.PasswordHolder)
|
userToken := fmt.Sprintf("%s%s%s", user, util.CredentialSeperator, util.PasswordHolder)
|
||||||
md[strings.ToLower(util.HeaderAuthorize)] = []string{crypto.Base64Encode(userToken)}
|
md[strings.ToLower(util.HeaderAuthorize)] = []string{crypto.Base64Encode(userToken)}
|
||||||
|
md[util.HeaderToken] = []string{rawToken}
|
||||||
ctx = metadata.NewIncomingContext(ctx, md)
|
ctx = metadata.NewIncomingContext(ctx, md)
|
||||||
} else {
|
} else {
|
||||||
// username+password authentication
|
// username+password authentication
|
||||||
|
|
|
@ -46,6 +46,7 @@ const (
|
||||||
FieldIndexPrefix = "field-index"
|
FieldIndexPrefix = "field-index"
|
||||||
|
|
||||||
HeaderAuthorize = "authorization"
|
HeaderAuthorize = "authorization"
|
||||||
|
HeaderToken = "token"
|
||||||
// HeaderSourceID identify requests from Milvus members and client requests
|
// HeaderSourceID identify requests from Milvus members and client requests
|
||||||
HeaderSourceID = "sourceId"
|
HeaderSourceID = "sourceId"
|
||||||
// MemberCredID id for Milvus members (data/index/query node/coord component)
|
// MemberCredID id for Milvus members (data/index/query node/coord component)
|
||||||
|
|
Loading…
Reference in New Issue