mirror of https://github.com/milvus-io/milvus.git
enhance: remain token after authorize (#39453)
Signed-off-by: aoiasd <zhicheng.yue@zilliz.com>master
parent
140c5a0a75
commit
a41de38f21
|
@ -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