mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
fix(cloudwatch): validate manual state reason lengths (#6470)
Check modeled reason lengths before state mutation, preserving required StateReason validation and both regression groups from current main. Use the Unicode-aware Smithy formatter. Signed-off-by: Andre Kurait <AndreKurait@gmail.com>
This commit is contained in:
1 parent
3d2e17bbbd
commit
75d7923290
4 files changed
+89
No files matched your search
+10
@@ -562,6 +562,16 @@ public class CloudWatchMetricsService {
|
||||
if (stateReason == null) {
|
||||
throw SmithyValidationErrors.validationError(SmithyValidationErrors.notNull("stateReason"));
|
||||
}
|
||||
String reasonViolation = stateReason == null ? null
|
||||
: SmithyValidationErrors.lengthOutOfRange("stateReason", stateReason, 0, 1023);
|
||||
if (reasonViolation != null) {
|
||||
throw SmithyValidationErrors.validationError(reasonViolation);
|
||||
}
|
||||
String dataViolation = stateReasonData == null ? null
|
||||
: SmithyValidationErrors.lengthOutOfRange("stateReasonData", stateReasonData, 0, 4000);
|
||||
if (dataViolation != null) {
|
||||
throw SmithyValidationErrors.validationError(dataViolation);
|
||||
}
|
||||
List<AlarmSnsNotifier.Notification> notifications = List.of();
|
||||
synchronized (this) {
|
||||
String key = region + "::" + alarmName;
|
||||
|
||||
Reference in new issue
Block a user