mirror of
https://github.com/gravitl/netmaker.git
synced 2025-02-20 22:23:45 +08:00
PR comments resolved
This commit is contained in:
parent
c55a24d241
commit
acd7a70b77
4 changed files with 8 additions and 10 deletions
|
@ -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]
|
||||
|
|
|
@ -58,7 +58,6 @@ func CollectServerMetrics(serverID string, networkNodes []models.Node) *models.M
|
|||
newServerMetrics.Connectivity[currNodeID] = models.Metric{
|
||||
Connected: false,
|
||||
Latency: 999,
|
||||
PercentUp: 0,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
|
13
mq/dynsec.go
13
mq/dynsec.go
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue