Files
floci/src/test/java
Sam Fakhreddine c3133f14c3 fix(lambda): validate members the model bounds (ESM Topics, S3 code, alias, LicenseInfo) (#4989)
* fix(lambda): enforce Topics and SourceAccessConfigurations limits on event source mappings

CreateEventSourceMapping and UpdateEventSourceMapping only checked that
Topics was a non-empty list of strings. The model allows at most one
topic, each 1-249 characters matching [^.]([a-zA-Z0-9\-_.]+), and at most
23 SourceAccessConfigurations. Both paths now reject a violation with the
ValidationException message the other Lambda member checks use; the update
path checks before it applies any change.

EsmIntegrationTest.createSelfManagedKafkaEventSourceMapping created a
mapping with two topics, which AWS rejects, so it now uses one.

Refs #4607

* fix(lambda): validate the UpdateFunctionCode S3Bucket and S3Key members

UpdateFunctionCode passed S3Bucket and S3Key straight to the S3 fetch, so a malformed value came back as ServiceUnavailableException. The model limits S3Bucket to 3-63 characters matching [0-9A-Za-z\.\-_]*(?<!\.) and S3Key to 1-1024; both are now checked before the function changes, with the Lambda ValidationException format.

Refs #4607

* fix(lambda): validate alias FunctionVersion and Description

CreateAlias and UpdateAlias stored any FunctionVersion and Description. The model limits FunctionVersion to 1-1024 characters matching (\$LATEST(\.PUBLISHED)?|[0-9]+) and Description to 256; both methods now check them before touching the alias, with the Lambda ValidationException format.

Refs #4607

* fix(lambda): validate the PublishLayerVersion LicenseInfo length

PublishLayerVersion stored a LicenseInfo of any length; the model caps it at 512 characters. It now reuses LambdaService.validateMaxLength (made package-private, like validateEnumList, which the layer service already calls).

Fixes #4607

* fix(lambda): validate empty topics and cap SourceAccessConfigurations for every ESM source

An empty Topic now fails the Topic shape's min length with a ValidationException, the 23-entry SourceAccessConfigurations cap applies to ARN sources as well as self-managed Kafka, and the shared max-items check is reused. Tests: one-topic CloudFormation Kafka case, update leaves stored fields unchanged.
2026-10-09 23:34:44 -04:00
..