[client] Get static system info once (#2965)

Get static system info once for Windows, Darwin, and Linux nodes

This should improve startup and peer authentication times
This commit is contained in:
Maycon Santos
2024-12-03 10:22:04 +01:00
committed by GitHub
parent a0bf0bdcc0
commit a4826cfb5f
6 changed files with 123 additions and 70 deletions
+8
View File
@@ -61,6 +61,14 @@ type Info struct {
Files []File // for posture checks
}
// StaticInfo is an object that contains machine information that does not change
type StaticInfo struct {
SystemSerialNumber string
SystemProductName string
SystemManufacturer string
Environment Environment
}
// extractUserAgent extracts Netbird's agent (client) name and version from the outgoing context
func extractUserAgent(ctx context.Context) string {
md, hasMeta := metadata.FromOutgoingContext(ctx)