This is an automated email from the ASF dual-hosted git repository.

humingcheng pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/servicecomb-service-center.git


The following commit(s) were added to refs/heads/dev by this push:
     new 097f7628 When determining whether to lock the login, only the request 
from console  will be locked. (#1516)
097f7628 is described below

commit 097f762835d977121e1c032450ba43310288bcb4
Author: melod_yi <[email protected]>
AuthorDate: Tue Aug 26 09:55:26 2025 +0800

    When determining whether to lock the login, only the request from console  
will be locked. (#1516)
    
    When determining whether to lock the login, only the request from console  
will be locked. (#1516)
---
 server/service/rbac/authr_plugin.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/server/service/rbac/authr_plugin.go 
b/server/service/rbac/authr_plugin.go
index f9956140..0f1ede94 100644
--- a/server/service/rbac/authr_plugin.go
+++ b/server/service/rbac/authr_plugin.go
@@ -26,6 +26,7 @@ import (
 
        "github.com/apache/servicecomb-service-center/pkg/log"
        "github.com/apache/servicecomb-service-center/pkg/privacy"
+       "github.com/apache/servicecomb-service-center/pkg/rest"
        "github.com/go-chassis/cari/pkg/errsvc"
        "github.com/go-chassis/cari/rbac"
        "github.com/go-chassis/go-chassis/v2/security/authr"
@@ -45,7 +46,7 @@ func newEmbeddedAuthenticator(_ *authr.Options) 
(authr.Authenticator, error) {
 func (a *EmbeddedAuthenticator) Login(ctx context.Context, user string, 
password string, opts ...authr.LoginOption) (string, error) {
        // Get x-real-ip directly from context
        var ip string
-       if req, ok := ctx.Value("http_request").(*http.Request); ok && req != 
nil {
+       if req, ok := ctx.Value(rest.CtxRequest).(*http.Request); ok && req != 
nil {
                ip = strings.TrimSpace(req.Header.Get("x-real-ip"))
        }
 

Reply via email to