Skip to content

Commit

Permalink
enhance: remain token after authorize (#39453)
Browse files Browse the repository at this point in the history
Signed-off-by: aoiasd <[email protected]>
aoiasd authored Jan 20, 2025
1 parent 140c5a0 commit a41de38
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/proxy/authentication_interceptor.go
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions pkg/util/constant.go
Original file line number Diff line number Diff line change
@@ -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)

0 comments on commit a41de38

Please sign in to comment.