diff --git a/CHANGELOG.md b/CHANGELOG.md index 085d61b..46f894a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/). +## [2.2.1] - 2026-10-16 + +### Fixed + +- Reject null, empty, or whitespace-only attribute values in `create.ps1` and `update.ps1` with an attribute-specific audit error. All attributes are validated before anything is written, preventing empty values from being stored in the blocklist. + ## [2.2.0] - 2026-08-03 ### Added diff --git a/create.ps1 b/create.ps1 index 3cf8131..9f370ec 100644 --- a/create.ps1 +++ b/create.ps1 @@ -199,6 +199,13 @@ try { $accessToken = $null } + # Validate all attributes before writing anything to the blocklist + $actionMessage = "validating attributes" + $emptyAttributes = $attributeNames | Where-Object { [string]::IsNullOrWhiteSpace($actionContext.Data.$_) } + if ($emptyAttributes) { + throw "Attribute(s) [$($emptyAttributes -join ', ')] must not be null, empty or whitespace." + } + foreach ($attributeName in $attributeNames) { # Check if attribute is in table $actionMessage = "querying row in table [$table] where [$($attributeName)] = [$($actionContext.Data.$attributeName)]" diff --git a/update.ps1 b/update.ps1 index a208605..7988c1b 100644 --- a/update.ps1 +++ b/update.ps1 @@ -202,6 +202,13 @@ try { throw "The account reference could not be found" } + # Validate all attributes before writing anything to the blocklist + $actionMessage = "validating attributes" + $emptyAttributes = $attributeNames | Where-Object { [string]::IsNullOrWhiteSpace($actionContext.Data.$_) } + if ($emptyAttributes) { + throw "Attribute(s) [$($emptyAttributes -join ', ')] must not be null, empty or whitespace." + } + foreach ($attributeName in $attributeNames) { # Check if attribute is in table $actionMessage = "querying row in table [$table] where [$($attributeName)] = [$($actionContext.Data.$attributeName)]"