You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by ti...@apache.org on 2023/02/06 01:13:20 UTC

[servicecomb-service-center] branch master updated: [fix]server information leak in dump API (#1375)

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

tianxiaoliang 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 a2a6f025 [fix]server information leak in dump API (#1375)
a2a6f025 is described below

commit a2a6f025801820a0dada8988871be84679052e23
Author: little-cui <su...@qq.com>
AuthorDate: Mon Feb 6 09:13:15 2023 +0800

    [fix]server information leak in dump API (#1375)
---
 pkg/dump/dump.go             | 7 +++----
 server/service/admin/dump.go | 4 ----
 2 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/pkg/dump/dump.go b/pkg/dump/dump.go
index f85988b8..75400486 100644
--- a/pkg/dump/dump.go
+++ b/pkg/dump/dump.go
@@ -180,10 +180,9 @@ type Request struct {
 }
 
 type Response struct {
-	Response  *discovery.Response    `json:"-"`
-	Info      *version.Set           `json:"info,omitempty"`
-	AppConfig map[string]interface{} `json:"appConf,omitempty"`
-	Cache     *Cache                 `json:"cache,omitempty"`
+	Response *discovery.Response `json:"-"`
+	Info     *version.Set        `json:"info,omitempty"`
+	Cache    *Cache              `json:"cache,omitempty"`
 }
 
 type WatchInstanceChangedEvent struct {
diff --git a/server/service/admin/dump.go b/server/service/admin/dump.go
index b51359bf..f0f8832e 100644
--- a/server/service/admin/dump.go
+++ b/server/service/admin/dump.go
@@ -26,7 +26,6 @@ import (
 	"github.com/apache/servicecomb-service-center/version"
 	mapset "github.com/deckarep/golang-set"
 	"github.com/go-chassis/cari/discovery"
-	"github.com/go-chassis/go-archaius"
 )
 
 func Dump(ctx context.Context, in *dump.Request) (*dump.Response, error) {
@@ -65,13 +64,10 @@ func appendData(ctx context.Context, option string, resp *dump.Response) {
 	switch option {
 	case "info":
 		resp.Info = version.Ver()
-	case "config":
-		resp.AppConfig = archaius.GetConfigs()
 	case "cache":
 		resp.Cache = datasource.GetSystemManager().DumpCache(ctx)
 	case "all":
 		appendData(ctx, "info", resp)
-		appendData(ctx, "config", resp)
 		appendData(ctx, "cache", resp)
 	}
 }