You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2021/08/16 14:50:50 UTC

[servicecomb-service-center] branch master updated: add disabled situation (#1140)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new c296f4b  add disabled situation (#1140)
c296f4b is described below

commit c296f4b1fab50fe8ee7d7bd8ced24473fef6363d
Author: Sphairis <56...@users.noreply.github.com>
AuthorDate: Mon Aug 16 22:50:45 2021 +0800

    add disabled situation (#1140)
    
    Co-authored-by: SphaIris <aaalixiaopei123>
---
 server/service/gov/kie/kie_distributor.go | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/server/service/gov/kie/kie_distributor.go b/server/service/gov/kie/kie_distributor.go
index d1184ec..9284604 100644
--- a/server/service/gov/kie/kie_distributor.go
+++ b/server/service/gov/kie/kie_distributor.go
@@ -274,12 +274,16 @@ func (d *Distributor) Name() string {
 }
 
 func initClient(endpoint string) *kie.Client {
+	var options *httpclient.Options
+	if rbacsvc.Enabled() {
+		options = &httpclient.Options{
+			SignRequest: rbacsvc.SignRequest,
+		}
+	}
 	client, err := kie.NewClient(
 		kie.Config{Endpoint: endpoint,
 			DefaultLabels: map[string]string{},
-			HTTPOptions: &httpclient.Options{
-				SignRequest: rbacsvc.SignRequest,
-			},
+			HTTPOptions:   options,
 		})
 	if err != nil {
 		log.Fatal("init kie client failed, err: %s", err)