mirror of
https://github.com/netbirdio/netbird.git
synced 2024-12-02 04:53:51 +01:00
94fbfcdb85
Send Desktop UI client version as user-agent to daemon This is sent on every login request to the management Parse the GRPC context on the system package and retrieves the user-agent Management receives the new UIVersion field and store in the Peer's system meta
27 lines
528 B
Go
27 lines
528 B
Go
package system
|
|
|
|
import (
|
|
"context"
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
"google.golang.org/grpc/metadata"
|
|
)
|
|
|
|
func Test_LocalWTVersion(t *testing.T) {
|
|
got := GetInfo(context.TODO())
|
|
want := "development"
|
|
assert.Equal(t, want, got.WiretrusteeVersion)
|
|
}
|
|
|
|
func Test_UIVersion(t *testing.T) {
|
|
ctx := context.Background()
|
|
want := "netbird-desktop-ui/development"
|
|
ctx = metadata.NewOutgoingContext(ctx, map[string][]string{
|
|
"user-agent": {want},
|
|
})
|
|
|
|
got := GetInfo(ctx)
|
|
assert.Equal(t, want, got.UIVersion)
|
|
}
|