فهرست منبع

add gw peer public key

Abhishek Kondur 1 سال پیش
والد
کامیت
ce6bc6f9d6
2فایلهای تغییر یافته به همراه3 افزوده شده و 0 حذف شده
  1. 1 0
      models/structs.go
  2. 2 0
      pro/controllers/users.go

+ 1 - 0
models/structs.go

@@ -70,6 +70,7 @@ type UserRemoteGws struct {
 	Connected         bool      `json:"connected"`
 	IsInternetGateway bool      `json:"is_internet_gateway"`
 	GwClient          ExtClient `json:"gw_client"`
+	GwPeerPublicKey   string    `json:"gw_peer_public_key"`
 }
 
 // UserRemoteGwsReq - struct to hold user remote acccess gws req

+ 2 - 0
pro/controllers/users.go

@@ -203,6 +203,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
 					GwClient:          extClient,
 					Connected:         true,
 					IsInternetGateway: node.IsInternetGateway,
+					GwPeerPublicKey:   host.PublicKey.String(),
 				})
 				userGws[node.Network] = gws
 				delete(user.RemoteGwIDs, node.ID.String())
@@ -235,6 +236,7 @@ func getUserRemoteAccessGws(w http.ResponseWriter, r *http.Request) {
 			GWName:            host.Name,
 			Network:           node.Network,
 			IsInternetGateway: node.IsInternetGateway,
+			GwPeerPublicKey:   host.PublicKey.String(),
 		})
 		userGws[node.Network] = gws
 	}