From 97fc64be816c9d9a83ef10257a63d37a00a20c4e Mon Sep 17 00:00:00 2001 From: mountain Date: Mon, 23 Sep 2024 17:46:39 +0900 Subject: [PATCH] =?UTF-8?q?maingateApiToken=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/http_handler.go | 13 ++++++++----- server/server.go | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/server/http_handler.go b/server/http_handler.go index 124b109..c34a795 100644 --- a/server/http_handler.go +++ b/server/http_handler.go @@ -25,9 +25,10 @@ type HoustonServerWithHandler interface { type houstonHandler struct { HoustonServer - methods map[string]reflect.Method - deployPath string - downloadPath string + methods map[string]reflect.Method + deployPath string + downloadPath string + maingateApiToken string } func NewHoustonHandler() HoustonServerWithHandler { @@ -40,8 +41,9 @@ func NewHoustonHandler() HoustonServerWithHandler { methods[strings.ToLower(method.Name)] = method } return &houstonHandler{ - HoustonServer: NewServer(), - methods: methods, + HoustonServer: NewServer(), + methods: methods, + maingateApiToken: loadServerConfig().MaingateApiToken, } } @@ -172,6 +174,7 @@ func (h *houstonHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { r.Body.Close() }() + // TODO : 구글 인증까지 붙인 후에 주석 제거 // var userinfo map[string]any // if !*noauth && (*authtype == "on" || *authtype == "both") { // authheader := r.Header.Get("Authorization") diff --git a/server/server.go b/server/server.go index d01bc9b..8dc64de 100644 --- a/server/server.go +++ b/server/server.go @@ -20,8 +20,9 @@ type HoustonServer interface { } type serverConfig struct { - GrpcPort int `json:"grpc_port"` - StorageRoot string `json:"storage_path"` + GrpcPort int `json:"grpc_port"` + StorageRoot string `json:"storage_path"` + MaingateApiToken string `json:"maingate_api_token"` } type DeployRequest struct {