mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-10-31 12:16:29 +08:00 
			
		
		
		
	add port to token
This commit is contained in:
		| @@ -147,6 +147,7 @@ func RegisterIntClient(client models.IntClient) (models.IntClient, error) { | ||||
|         client.ServerAPIEndpoint = gcfg.APIHost + ":" + gcfg.APIPort | ||||
| 	client.ServerAddress = server.ServerAddress | ||||
| 	client.ServerPort = server.ServerPort | ||||
| 	client.ServerGRPCPort = gcfg.GRPCPort | ||||
| 	client.ServerKey = server.ServerKey | ||||
|  | ||||
|         if client.ClientID == "" { | ||||
|   | ||||
| @@ -631,8 +631,9 @@ func CreateAccessKey(accesskey models.AccessKey, network models.Network) (models | ||||
| 	netID := network.NetID | ||||
| 	grpcaddress := servercfg.GetGRPCHost() + ":" + servercfg.GetGRPCPort() | ||||
| 	apiaddress := servercfg.GetAPIHost() + ":" + servercfg.GetAPIPort() | ||||
| 	wgport := servercfg.GetGRPWGCPort() | ||||
|  | ||||
| 	accessstringdec := grpcaddress + "|" + apiaddress + "|" + netID + "|" + accesskey.Value + "|" + privAddr | ||||
| 	accessstringdec := wgport + "|" +grpcaddress + "|" + apiaddress + "|" + netID + "|" + accesskey.Value + "|" + privAddr | ||||
| 	accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(accessstringdec)) | ||||
| 	//validate accesskey | ||||
| 	v := validator.New() | ||||
|   | ||||
| @@ -45,7 +45,7 @@ func CreateServerToken(netID string) (string, error) { | ||||
| 		privAddr = network.LocalRange | ||||
| 	} | ||||
|  | ||||
|         accessstringdec := address + "|" + address + "|" + netID + "|" + accesskey.Value + "|" + privAddr | ||||
|         accessstringdec := " " + "|"+ address + "|" + address + "|" + netID + "|" + accesskey.Value + "|" + privAddr | ||||
|  | ||||
| 	accesskey.AccessString = base64.StdEncoding.EncodeToString([]byte(accessstringdec)) | ||||
|  | ||||
|   | ||||
| @@ -12,6 +12,7 @@ type IntClient struct { | ||||
| 	ServerAPIEndpoint  string         `json:"serverapiendpoint" bson:"serverapiendpoint"` | ||||
| 	ServerAddress  string             `json:"serveraddress" bson:"serveraddress"` | ||||
| 	ServerPort     string             `json:"serverport" bson:"serverport"` | ||||
| 	ServerGRPCPort     string             `json:"serverport" bson:"serverport"` | ||||
| 	ServerKey      string             `json:"serverkey" bson:"serverkey"` | ||||
| 	IsServer       string             `json:"isserver" bson:"isserver"` | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 afeiszli
					afeiszli