From 18d842f1143f37ce4e7c4b1e20932ad8982f82f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sondre=20Sj=C3=B8lyst?= <18713420+sondresjolyst@users.noreply.github.com> Date: Thu, 16 Apr 2026 07:59:29 +0200 Subject: [PATCH 1/4] fix: replace string.Equals with ToUpper comparison in SwitchesController (#94) (#95) * fix(switches): whitelist SOCKET type in GET /api/switches Only return switches with type 'SOCKET'. This excludes SHRGBC light bulbs and any other unknown device types, keeping the list to actionable socket devices only. * fix: replace string.Equals with ToUpper comparison in SwitchesController (#94) --- Controllers/SwitchesController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/SwitchesController.cs b/Controllers/SwitchesController.cs index d990486..c6ca76c 100644 --- a/Controllers/SwitchesController.cs +++ b/Controllers/SwitchesController.cs @@ -71,7 +71,7 @@ public async Task GetAllSwitches() _logger.LogInformation("GetAllSwitches called by {@LogData}", new { User = User.Identity?.Name }); var allSwitches = await _context.Switches - .Where(sw => sw.Type.Equals("SOCKET", StringComparison.OrdinalIgnoreCase)) + .Where(sw => sw.Type.ToUpper() == "SOCKET") .ToListAsync(); var accessibleSwitches = new List(); From 9457bad6010eca9b85e1e6c6b99af6082d7abed5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 16 Apr 2026 08:00:07 +0200 Subject: [PATCH 2/4] chore(main): release 1.7.2 (#96) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e8409f1..e12d8b3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## [1.7.2](https://github.com/sondresjolyst/garge-api/compare/v1.7.1...v1.7.2) (2026-04-16) + + +### Bug Fixes + +* replace string.Equals with ToUpper comparison in SwitchesController ([#94](https://github.com/sondresjolyst/garge-api/issues/94)) ([#95](https://github.com/sondresjolyst/garge-api/issues/95)) ([18d842f](https://github.com/sondresjolyst/garge-api/commit/18d842f1143f37ce4e7c4b1e20932ad8982f82f9)) + ## [1.7.1](https://github.com/sondresjolyst/garge-api/compare/v1.7.0...v1.7.1) (2026-04-16) From 4e5018bac1c118fe45affcf5ac0e2b017af5a6ee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 22:28:12 +0200 Subject: [PATCH 3/4] chore(main): release 2.0.0 (#99) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- CHANGELOG.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e12d8b3..d70f93d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,16 @@ # Changelog +## [2.0.0](https://github.com/sondresjolyst/garge-api/compare/v1.7.2...v2.0.0) (2026-04-18) + + +### ⚠ BREAKING CHANGES + +* rename roles ([#97](https://github.com/sondresjolyst/garge-api/issues/97)) + +### Features + +* rename roles ([#97](https://github.com/sondresjolyst/garge-api/issues/97)) ([04de8f8](https://github.com/sondresjolyst/garge-api/commit/04de8f835e68516e82b5101f830719073388976b)) + ## [1.7.2](https://github.com/sondresjolyst/garge-api/compare/v1.7.1...v1.7.2) (2026-04-16) From 160d9fc305e40c7e31e3e2e134b6e2b7f7f7c98b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?sondre=20Sj=C3=B8lyst?= <18713420+sondresjolyst@users.noreply.github.com> Date: Sun, 19 Apr 2026 17:54:45 +0200 Subject: [PATCH 4/4] fix: automation admin role check --- Controllers/AutomationController.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Controllers/AutomationController.cs b/Controllers/AutomationController.cs index da1dba8..145764b 100644 --- a/Controllers/AutomationController.cs +++ b/Controllers/AutomationController.cs @@ -30,7 +30,7 @@ private async Task UserHasAccessToAutomationAsync(AutomationRule rule) var userRoles = User.FindAll(ClaimTypes.Role).Select(r => r.Value).ToList(); if (userRoles.Contains("admin", StringComparer.OrdinalIgnoreCase) || - userRoles.Contains("automation_admin", StringComparer.OrdinalIgnoreCase)) + userRoles.Contains("AutomationAdmin", StringComparer.OrdinalIgnoreCase)) { return true; }