PR comments resolved

This commit is contained in:
Abhishek Kondur 2022-10-01 06:27:30 +05:30
parent c55a24d241
commit acd7a70b77
4 changed files with 8 additions and 10 deletions

View file

@ -221,11 +221,13 @@ func genKeyName() string {
return strings.Join([]string{"key", entropy.Text(16)[:16]}, "-")
}
// GenKey - generates random key of length 16
func GenKey() string {
entropy, _ := rand.Int(rand.Reader, maxentropy)
return entropy.Text(16)[:16]
}
// GenPassWord - generates random password of length 64
func GenPassWord() string {
entropy, _ := rand.Int(rand.Reader, maxentropy)
return entropy.Text(62)[:64]

View file

@ -58,7 +58,6 @@ func CollectServerMetrics(serverID string, networkNodes []models.Node) *models.M
newServerMetrics.Connectivity[currNodeID] = models.Metric{
Connected: false,
Latency: 999,
PercentUp: 0,
}
}
}

View file

@ -219,7 +219,7 @@ func StringDifference(a, b []string) []string {
return diff
}
// CheckIfFileExists - checks if file exists or no in the given path
// CheckIfFileExists - checks if file exists or not in the given path
func CheckIfFileExists(filePath string) bool {
if _, err := os.Stat(filePath); os.IsNotExist(err) {
return false

View file

@ -18,12 +18,6 @@ import (
"golang.org/x/crypto/pbkdf2"
)
// DynamicSecSubTopic - constant for dynamic security subscription topic
const dynamicSecSubTopic = "$CONTROL/dynamic-security/#"
// DynamicSecPubTopic - constant for dynamic security subscription topic
const dynamicSecPubTopic = "$CONTROL/dynamic-security/v1"
// mq client for admin
var mqAdminClient mqtt.Client
@ -41,15 +35,18 @@ const (
CreateRoleCmd = "createRole"
// constant for delete role command
DeleteRoleCmd = "deleteRole"
)
const (
// constant for admin user name
mqAdminUserName = "Netmaker-Admin"
// constant for server user name
mqNetmakerServerUserName = "Netmaker-Server"
// constant for exporter user name
mqExporterUserName = "Netmaker-Exporter"
// DynamicSecSubTopic - constant for dynamic security subscription topic
dynamicSecSubTopic = "$CONTROL/dynamic-security/#"
// DynamicSecPubTopic - constant for dynamic security subscription topic
dynamicSecPubTopic = "$CONTROL/dynamic-security/v1"
)
// struct for dynamic security file