From a667834a5fe2e18dd4405ddc19679dae7566c4b1 Mon Sep 17 00:00:00 2001 From: Neyts Zupan Date: Mon, 4 Aug 2025 13:38:08 +0000 Subject: [PATCH] paretosecurity: 0.2.39 -> 0.3.2 Test for linking had to be removed because now the linking is more complex and it would take too much mocking to test it. The test in question was moved to the dashboard codebase that is closed-source, if that helps in any way. --- nixos/tests/paretosecurity.nix | 50 +++------------------- pkgs/by-name/pa/paretosecurity/package.nix | 6 +-- 2 files changed, 9 insertions(+), 47 deletions(-) diff --git a/nixos/tests/paretosecurity.nix b/nixos/tests/paretosecurity.nix index 0ed86e57a89e..9c4c51271ad5 100644 --- a/nixos/tests/paretosecurity.nix +++ b/nixos/tests/paretosecurity.nix @@ -8,37 +8,10 @@ { imports = [ ./common/user-account.nix ]; - networking.firewall.enable = true; - services.paretosecurity = { - enable = true; - - # Create a patched version of the package that points to the local dashboard - # for easier testing - package = pkgs.paretosecurity.overrideAttrs (oldAttrs: { - postPatch = oldAttrs.postPatch or "" + '' - substituteInPlace team/report.go \ - --replace-warn 'const reportURL = "https://cloud.paretosecurity.com"' \ - 'const reportURL = "http://cloud"' - ''; - }); - }; + services.paretosecurity.enable = true; }; - nodes.cloud = { - networking.firewall.allowedTCPPorts = [ 80 ]; - - services.nginx = { - enable = true; - virtualHosts."cloud" = { - locations."/api/v1/team/".extraConfig = '' - add_header Content-Type application/json; - return 200 '{"message": "Linked device."}'; - ''; - }; - }; - }; - nodes.xfce = { pkgs, ... }: { @@ -70,9 +43,8 @@ testScript = '' # Test setup terminal.succeed("su - alice -c 'mkdir -p /home/alice/.config'") - for m in [terminal, cloud]: - m.systemctl("start network-online.target") - m.wait_for_unit("network-online.target") + terminal.systemctl("start network-online.target") + terminal.wait_for_unit("network-online.target") # Test 1: Test the systemd socket is installed & enabled terminal.succeed('systemctl is-enabled paretosecurity.socket') @@ -91,17 +63,7 @@ + "'" ) - # Test 3: Test linking - terminal.succeed("su - alice -c 'paretosecurity link" - + " paretosecurity://enrollTeam/?token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9." - + "eyJ0b2tlbiI6ImR1bW15LXRva2VuIiwidGVhbUlEIjoiZHVtbXktdGVhbS1pZCIsImlhdCI6" - + "MTcwMDAwMDAwMCwiZXhwIjoxOTAwMDAwMDAwfQ.WgnL6_S0EBJHwF1wEVUG8GtIcoVvK5IjWbZpUeZr4Qw'") - - config = terminal.succeed("cat /home/alice/.config/pareto.toml") - assert 'AuthToken = "dummy-token"' in config - assert 'TeamID = "dummy-team-id"' in config - - # Test 4: Test the tray icon + # Test 3: Test the tray icon xfce.wait_for_x() for unit in [ 'paretosecurity-trayicon', @@ -115,7 +77,7 @@ xfce.succeed("xdotool click 1") xfce.wait_for_text("Run Checks") - # Test 5: Desktop entry + # Test 4: Desktop entry xfce.succeed("xdotool mousemove 10 10") xfce.succeed("xdotool click 1") # hide the tray icon window xfce.succeed("xdotool click 1") # show the Applications menu @@ -123,7 +85,7 @@ xfce.succeed("xdotool click 1") xfce.wait_for_text("Pareto Security") - # Test 6: paretosecurity:// URL handler is registered + # Test 5: paretosecurity:// URL handler is registered xfce.succeed("su - alice -c 'xdg-open paretosecurity://foo'") ''; } diff --git a/pkgs/by-name/pa/paretosecurity/package.nix b/pkgs/by-name/pa/paretosecurity/package.nix index 57767ca3bff0..791b7cba2f04 100644 --- a/pkgs/by-name/pa/paretosecurity/package.nix +++ b/pkgs/by-name/pa/paretosecurity/package.nix @@ -17,16 +17,16 @@ buildGoModule (finalAttrs: { webkitgtk_4_1 ]; pname = "paretosecurity"; - version = "0.2.39"; + version = "0.3.2"; src = fetchFromGitHub { owner = "ParetoSecurity"; repo = "agent"; rev = finalAttrs.version; - hash = "sha256-goINqrt4ZEC5/WklC4D35wMTpjfJ0dZWfGU3vLWTLjM="; + hash = "sha256-TXKymCFr2lrbgmbCxI3vIKx61nbOaRmuUTwNn7k0Hm0="; }; - vendorHash = "sha256-tYpTXCx0vp+JX7keu+m5ePrPlGVJZen38HSfQHS4f7s="; + vendorHash = "sha256-DlCGCheJHa4HPM7kfX/UbOfLukAiaoP7QZnabkZVASM="; proxyVendor = true; # Skip building the Windows installer