Implements Phase 1 of the Transfer Family JSON 1.1 handler covering
17 operations across server lifecycle, user management, SSH key
management, and tagging.
immediately closing a ServerSocket. Between that check and Docker
binding the port, a second concurrent RunInstances call saw the same
port as free — both instances raced to bind 2200 and the second one
failed with "port is already allocated".
Fix: PortAllocator now maintains an in-memory ConcurrentSkipListSet of
reserved ports. allocate() is synchronized and adds the chosen port to
the set before returning, so concurrent callers skip it even before
Docker has bound it. release() removes the entry when the container is
terminated, making the port available for future instances.
Ec2ContainerManager.terminate() now calls portAllocator.release() after
the Docker container is removed.
Add PortAllocatorTest with 5 cases including a concurrency test that
races 20 threads simultaneously to confirm uniqueness.
Fixes#721
* feat(route53): add Route53 management-plane emulation
Implements Route53 Phase 1 with 17 operations: hosted zones (Create,
Get, Delete, List, ListByName, Count), resource record sets
(ChangeResourceRecordSets, List), change tracking (GetChange), health
checks (Create, Get, Delete, List, Update), tagging
(ListTagsForResource, ChangeTagsForResource), and GetAccountLimit.
Auto-creates SOA and NS apex records on zone creation. Rejects deletion
of non-empty zones. All changes return INSYNC immediately. IDs are
returned with path prefixes (/hostedzone/Z…, /change/C…) to satisfy
the SDK Route53IdInterceptor. Nameservers are configurable via
floci.services.route53.default-nameserver[1-4].
Adds OpenTofu and Terraform compatibility tests covering zone creation,
A record, auto-created SOA/NS records, health check, and tag persistence.
* feat(feat): adding missing endpoints
* feat(route53): fix timeout when creating route dns from terraform
- Add 7 on-premises instance operations: RegisterOnPremisesInstance,
DeregisterOnPremisesInstance, GetOnPremisesInstance,
BatchGetOnPremisesInstances, ListOnPremisesInstances,
AddTagsToOnPremisesInstances, RemoveTagsFromOnPremisesInstances
- Add Server AppSpec YAML parsing (jackson-dataformat-yaml) extracting
os and hooks map (hookName → [{location, timeout, runas}])
- Resolve deployment targets from EC2 tag filters (via Ec2Service) and
on-premises instance tag filters; fall back to all registered
on-premises instances when no filters are configured
- Run lifecycle events in order (ApplicationStop → DownloadBundle →
ValidateService) on a virtual thread per deployment; DownloadBundle
and Install auto-succeed as infrastructure steps
- Execute AppSpec hook scripts via SSM Run Command when the instance is
registered in SSM; graceful degradation (treat as succeeded) when SSM
is not available for an instance
- Refactor deploymentTargets from two-level to three-level
(region→deploymentId→targetId→wrapper) to support multi-instance
Server deployments alongside existing Lambda/ECS single-target shape
- Add SsmCommandService helpers: isInstanceRegistered,
sendCommandToInstance, getCommandInvocationStatus
- Add OnPremisesInstance model with instanceName, instanceArn,
iamSessionArn, iamUserArn, registerTime, deregisterTime, tags,
registrationStatus
PutEmailIdentityDkimAttributes, CreateEmailIdentity, and DeleteEmailIdentity
now return the same error codes and messages as real AWS SES v2:
- PutEmailIdentityDkimAttributes on unknown identity -> 400 BadRequestException
("Domain X is not verified for DKIM signing.")
- PutEmailIdentityDkimAttributes on email-format identity whose parent
domain is registered -> 200 OK no-op (DKIM is a domain-level concept)
- CreateEmailIdentity on duplicate identity -> 400 AlreadyExistsException
- DeleteEmailIdentity on unknown identity -> 404 NotFoundException
V1 idempotent semantics (VerifyEmailIdentity / VerifyDomainIdentity /
DeleteIdentity) are preserved -- strict checks are added at the V2
controller level only.
Integration tests assert the exact AWS error messages (with trailing
period) and, for the email-with-registered-parent no-op case, verify
that the parent domain's DkimAttributes are unchanged before and after.
Following #714, the 2-arg PipesTargetInvoker.invokeSqs(arn, payload)
overload became dead code; only the region-aware 3-arg version is
called from invoke().
* feat(ses): add MAIL FROM domain and identity attribute operations
v1 (Query):
- SetIdentityMailFromDomain / GetIdentityMailFromDomainAttributes
- SetIdentityFeedbackForwardingEnabled
- SetIdentityHeadersInNotificationsEnabled
- GetIdentityNotificationAttributes now reflects the stored
feedbackForwardingEnabled and per-NotificationType
headersInNotificationsEnabled flags instead of hard-coded defaults
v2 (REST JSON):
- PUT /v2/email/identities/{id}/mail-from -> PutEmailIdentityMailFromAttributes
- GetEmailIdentity response surfaces real MailFromAttributes
(MailFromDomain / MailFromDomainStatus / BehaviorOnMxFailure) instead
of the previously hard-coded "" / NOT_STARTED / USE_DEFAULT_VALUE
- v1 PascalCase <-> v2 SCREAMING_SNAKE BehaviorOnMxFailure values are
translated at the controller boundary, with both ends rejecting
unknown enum values
Identity gains mailFromDomain, behaviorOnMxFailure (v1 form),
mailFromDomainStatus, and headersInNotificationsEnabled fields. The
service layer normalizes BehaviorOnMxFailure to the canonical SESv1
enum values (UseDefaultValue / RejectMessage), so storage is
consistent regardless of which protocol wrote it.
Validation (verified against live aws-cli output):
- ForwardingEnabled / Enabled / MailFromDomain are required on the
matching v1 setters; missing values produce InvalidParameterValue
rather than silently being treated as false / null
- An empty-string MailFromDomain remains the documented "clear" path,
distinct from a missing parameter; whitespace-only values are
rejected (only "" or null clear the setting)
- BehaviorOnMxFailure / NotificationType enum violations return the
AWS-canonical "1 validation error detected: Value at '<param>' failed
to satisfy constraint: Member must satisfy enum value set: [...]"
message: ValidationError on v1, BadRequestException on v2
- Unknown identity on v1 setters returns InvalidParameterValue with
the AWS-canonical "Identity <X> does not exist." form (HTTP 400)
- v2 PutEmailIdentityMailFromAttributes follows the same wire mapping:
unknown identity surfaces as BadRequestException (HTTP 400) via
remapV1Exception, with the same "Identity <X> does not exist."
message text. Schema / enum validation runs before the service call
so an unknown enum on a missing identity still surfaces as an enum
error rather than as the identity error
- v2 controller validates that MailFromDomain and BehaviorOnMxFailure
are JSON strings; non-textual values produce BadRequestException
- AwsQueryController.SES_ACTIONS picks up the new v1 actions for the
auth-less fallback dispatch
Tests: 21 v1 integration cases, 9 v2 integration cases, 4 SDK compat
cases (AWS Java SDK 2.42.24).
* fix(ses): align identity-setter missing-identity errors with live AWS
Previously setFeedbackForwardingEnabled threw NotFoundException/404 and
setHeadersInNotificationsEnabled threw a Floci-specific
"Identity <X> does not exist." message. Real AWS verified via
aws-cli returns InvalidParameterValue (HTTP 400) for both, but with
*different* operation-specific message texts:
- SetIdentityFeedbackForwardingEnabled (also v2 PUT /feedback after
remapV1Exception):
Identity X is invalid. Must be a verified email address or domain.
- SetIdentityHeadersInNotificationsEnabled:
Identity X is invalid. It must be a verified email address or domain.
- SetIdentityMailFromDomain (unchanged in this commit):
Identity <X> does not exist.
Update the service-level throws so each setter emits its operation's
exact wire shape. setFeedbackForwardingEnabled now also benefits the
pre-existing v2 PUT /feedback endpoint, which previously surfaced
NotFoundException/404 instead of BadRequestException/400.
Tests:
- v1 unknown-identity coverage for SetIdentityFeedbackForwardingEnabled
(new) and updated message-text assertion for HeadersInNotificationsEnabled
- v2 unknown-identity coverage for PUT /feedback
- SDK compat additions: getIdentityNotificationAttributes round-trip
exercising forwarding/header flags, and v2
PutEmailIdentityMailFromAttributes unknown-identity throwing
BadRequestException
* test(ses): update putFeedbackAttributes_notFound to expect BadRequest
The previous commit changed setFeedbackForwardingEnabled to throw
InvalidParameterValue (HTTP 400) for missing identities to match real
AWS, which propagates through remapV1Exception as BadRequestException
on the v2 PUT /feedback path. The pre-existing
SesV2IntegrationTest.putFeedbackAttributes_notFound still asserted the
old 404 / NotFoundException behavior, so it began failing in CI.
Update the test to expect 400 / BadRequestException, matching the
verified live AWS response.
When FLOCI_SERVICES_LAMBDA_AWS_CONFIG_PATH is set, bind-mount the host
path read-only into Lambda containers at /opt/aws-config and set
AWS_SHARED_CREDENTIALS_FILE and AWS_CONFIG_FILE env vars so the SDK
discovers credentials regardless of container HOME directory.
When unset, credentials are read from Floci's own environment with a
fallback to test/test/test. Blank values are treated as absent.
Closes#686
- Include <associationState> in AssociateRouteTable response so Terraform
v6 waiters can confirm association without timing out
- Add association.route-table-association-id, association.subnet-id,
association.gateway-id, and association.main filter support to
DescribeRouteTables
- Apply resource-id, resource-type, key, and value filters in DescribeTags
(previously all filters were ignored, returning every tag)
- Add RouteTableAssociation.gatewayId field for gateway-id filter support
- Add integration tests covering new filters and associationState assertion
- Add VPC networking resources to compat-terraform and compat-opentofu
suites (IGW, subnet, route table + association, security group)
When DOCKER_HOST is set without a scheme (e.g. "10.37.124.101:2375" in
Bitbucket Pipelines), docker-java's createDefaultConfigBuilder() calls
URI.create() on the raw value and throws IllegalArgumentException before
Floci's own withDockerHost() override can take effect. PR #665 normalized
the value from floci.docker.docker-host but left this crash path open.
- Add createDockerConfigBuilder() to catch the IAE and fall back to a
fresh Builder() so the normalized host can still be applied
- Add resolveEffectiveDockerHost() to use DOCKER_HOST env var (normalized)
as a fallback when floci.docker.docker-host is at its default unix socket,
so CI environments like Bitbucket Pipelines work without requiring a
separate FLOCI_DOCKER_DOCKER_HOST setting
- Add unit tests covering the Bitbucket scenario and edge cases
Fixes#663
AppConfigTagHandler inherited the default tagsBodyKey() = "tags"
(lowercase), so SharedTagsController parsed and serialised the tag
payload with the lowercase key. The AWS spec for AppConfig
TagResource and ListTagsForResource is capital "Tags" with a map
body, which is what AWS SDK clients send and expect — so SDK calls
to appConfig.tagResource(...) silently dropped tags and listing
came back empty.
Override tagsBodyKey() on AppConfigTagHandler to return "Tags".
The other axes (POST method, map body, lowercase tagKeys query)
already match the defaults so no further override is needed.
AppConfigIntegrationTest is updated to send capital "Tags" bodies
and assert capital "Tags" response keys, matching the AWS SDK
wire format. AppConfigTest (SDK compatibility) now exercises a
tagResource → listTagsForResource → untagResource round-trip via
AppConfigClient to lock in the wire format end-to-end.
* feat(sqs,dynamodb): add TRACE-level payload logging
Add TRACE log lines that include request/response payloads for the
common SQS and DynamoDB operations -- off by default, opt-in via
per-category log level. Helps diagnose TestContainers-based test
failures where DEBUG IDs alone don't reveal what was sent.
SQS: SendMessage / SendMessageBatch / ReceiveMessage / DeleteMessage /
DeleteMessageBatch log body and attributes.
DynamoDB: PutItem / GetItem / UpdateItem / DeleteItem log the item;
Query and Scan log the returned and scanned counts (bodies would be
too noisy).
Ship quarkus.log.min-level: TRACE so a single category override is
enough -- users don't also have to lower the root floor.
Closes#613
* Apply suggestions from code review
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
* feat(scheduler): support TagResource, UntagResource, ListTagsForResource
Implements the three remaining EventBridge Scheduler tag APIs by
extending the shared /tags/{arn} dispatcher. Tags apply to schedule
groups only, matching AWS behavior; ARNs pointing at individual
schedules return ValidationException.
A survey of all ~75 AWS services that share the /tags/{arn} path
shows three independent shape axes — body key (`tags` lower vs
`Tags` capital), body structure (map vs list of {Key, Value}), and
untag query parameter name (`tagKeys` vs `TagKeys`) — and most
"capital Tags" services still use lowercase tagKeys query, so these
axes vary independently. TagHandler exposes them as five orthogonal
default methods rather than a coarse-grained enum:
- tagsBodyKey() defaults to "tags"
- tagsBodyIsList() defaults to false (map)
- tagKeysQueryName() defaults to "tagKeys"
- tagResourceUsesPut() defaults to false (POST)
- strictTagValidation() defaults to false (lenient parsing)
The defaults match the most common AWS shape (~73 services use
lowercase tags map + POST + lowercase tagKeys) so handlers like
EKS, Pipes, and AppConfig need no overrides. The dispatcher
returns 405 MethodNotAllowedException for the unused HTTP method
per handler. Strict input validation (missing Tags, wrong-shaped
Tags, missing TagKeys, entries missing Key or Value) is enforced
when strictTagValidation() is true, mirroring the AWS Scheduler
error shape; lenient handlers retain the looser parsing they had
before.
SchedulerTagHandler overrides tagsBodyKey, tagsBodyIsList,
tagKeysQueryName, and strictTagValidation. ApiGatewayTagHandler
overrides tagResourceUsesPut to true. AppConfigIntegrationTest
switches its tagApplication call from PUT to POST to match the
AWS spec for AppConfig (was relying on the dispatcher's prior
leniency on HTTP method).
* fix(tags): normalize empty body and reject non-object payloads
Address Copilot review on floci-io/floci#700.
- doTagResource normalizes null/blank request bodies to "{}" before
passing to ObjectMapper.readTree, mirroring SchedulerController's
parseTags. Previously an empty body raised a Jackson parse error
that strict handlers surfaced as a ValidationException with a raw
Java/Jackson message instead of the structured AWS error shape.
- parseTags adds a strict-only check that the JSON root is an
object. A request body like a JSON array or string used to fall
through to "Value null at 'Tags' ..." which misleads about the
actual problem; it now reports that the payload itself must be a
JSON object.
SchedulerIntegrationTest covers both paths with a 400 assertion.
- Translate LocalStack env vars (LOCALSTACK_HOST, PERSISTENCE, LAMBDA_DOCKER_NETWORK, etc.)
to Floci equivalents automatically at startup; opt out with LOCALSTACK_PARITY=false
- Serve /_localstack/init and /_localstack/health alongside /_floci/* equivalents
- Report executed scripts with path, state, and return_code in /_floci/init response
- Add /_aws/sqs/messages GET (non-destructive peek) and DELETE (purge) inspection endpoint
- Add /_aws/execute-api/{apiId}/{stageName} LocalStack-compat path for REST API invocation
- Add four-phase init hook lifecycle (boot/start/ready/stop) with dual-path discovery
(/etc/floci/init/ and /etc/localstack/init/ compat paths)
- Install Python 3, AWS CLI, boto3 in standard image; wrap aws binary to pre-configure
--endpoint-url=http://localhost:4566 so init scripts need no extra flags
- Wire entrypoint.sh + gosu privilege drop into all Dockerfile variants
- Add migration guide and update README, docker-compose, docker-images, SQS, and
initialization-hooks docs
* feat(glue): add Glue Schema Registry support
* Move Glue SDK coverage to compatibility tests
* Align protobuf compatibility expectations
* Resolve services index merge conflict
* Remove unused Lombok compatibility dependency
* Serialize Glue schema registry timestamps as strings
* Tighten Glue schema registry name validation
* Avoid duplicate schema registry index rebuild
* Limit schema registry in-memory constructor visibility
* Clone Glue tables before resolving schema references
* Align Glue schema registry response shapes
* Extract Glue schema version resolver helper
Both validateSchemaReference and withResolvedSchemaReference duplicated
the latest-version computation and the four-argument getSchemaVersion
call. Pull that into a private resolveSchemaVersion(SchemaReference)
helper so the call sites read at one level of abstraction and a future
change to the resolution rule lands in one place.
* Fix Glue schema version list projection
---------
Signed-off-by: Tristan Burch <tburch@users.noreply.github.com>
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
* feat(ses): add TestRenderTemplate (v1) and TestRenderEmailTemplate (v2)
Render a stored SES template against caller-supplied data and return the
resulting MIME message. v1 is dispatched via the Query protocol; v2 is
exposed at POST /v2/email/templates/{name}/render.
Template variable substitution is now strict: a missing attribute in the
rendering data raises MissingRenderingAttribute (mapped to BadRequestException
on v2), matching AWS / moto / LocalStack semantics. Invalid TemplateData
JSON raises InvalidRenderingParameter; non-object TemplateData is rejected
with operation-appropriate errors on the send paths (InvalidParameterValue
on v1, BadRequestException on v2).
The rendered output is a hand-rolled multipart/alternative MIME with a
Date header (UTC), Subject header, and text/plain + text/html parts.
Transfer encoding is auto-selected (7bit for ASCII bodies, 8bit for UTF-8)
matching moto's encode_7or8bit. Body line endings are normalized to CRLF.
Subject control characters and XML 1.0 invalid characters in the rendered
output are stripped to keep the response parseable by SDK clients.
Bulk per-entry rendering errors (MissingRenderingAttribute /
InvalidRenderingParameter raised at apply time) surface as INVALID_PARAMETER
in BulkEmailEntryResults rather than generic FAILED.
No new dependencies are introduced.
* test(ses): consolidate new SesServiceTemplateTest cases via @ParameterizedTest
Group 23 of the new unit tests added in this PR into 6
@ParameterizedTest methods driven by MethodSource data sets:
- pickTransferEncoding (ascii vs non-ascii) -> 1 test, 4 cases
- parseRenderingData invalid inputs -> 1 test, 5 cases
- normalizeToCrlf line-ending variants -> 1 test, 4 cases
- mapErrorCodeToBulkStatus -> 1 test, 4 cases
- sanitizeSubject control / DEL / Unicode preservation -> 1 test,
6 cases (null-input case kept separate)
- stripXml10InvalidChars C0 / noncharacters / surrogates -> 1 test,
11 cases
Coverage is preserved (every input that was exercised before is still
exercised; surfacing each case as an individual test makes the run
report show 58 cases instead of 49 for this file). The remaining
tests -- buildTestRenderMime structure assertions and the original
applyTemplateData edge cases -- stay as individual @Test methods
because they have distinct multi-step assertions.
* test(ses): address upstream Copilot style nits
- Remove unused containsString static import in
SesTestRenderV2IntegrationTest after the parameterized refactor
- Replace assertEquals(true/false, ...) with assertTrue/assertFalse in
SesServiceTemplateTest for clearer intent and better failure output
Map state was passing each item raw to the branch executor, ignoring
ItemSelector (current AWS syntax) and Parameters (legacy syntax).
Now resolves the transform against the Map state's effective input
(after InputPath) and enriches the context with $$.Map.Item.Index
and $$.Map.Item.Value per iteration before calling executeBranch.
* feat(elbv2,codedeploy): real ALB Vert.x proxy and ECS blue/green deployment
ELB v2 Phase 2: replace the mock ALB with a real Vert.x HTTP reverse proxy.
ElbV2DataPlane compiles listener rules into an atomic rule chain and proxies
requests to target group members. ElbV2HealthChecker runs periodic health
checks against registered targets. shiftListenerForward atomically rewrites
the default forward rule (simple or weighted) for CodeDeploy traffic shifts.
CodeDeploy Phase 3: implement full ECS blue/green deployment. CreateDeployment
drives the complete lifecycle — green task set creation, BeforeInstall /
AfterInstall / BeforeAllowTraffic hooks, ALB listener traffic shift (AllAtOnce,
Canary, or Linear), AfterAllowTraffic hook, green task set promoted to PRIMARY,
blue task set deleted. Compute platform is resolved from the Application when
the deployment group doesn't carry it, matching real AWS SDK behavior.
* fix: refactor to use arnUtils
Replace ~60 scattered split(":")[n] accesses and "arn:aws:..." string
concatenations with a single Arn record that owns both responsibilities.
AwsArnUtils.Arn.of(service, region, accountId, resource).toString()
covers all construction. AwsArnUtils.parse() with regionOrDefault() /
accountOrDefault() covers all parsing. RegionResolver.buildArn() delegates
to Arn.of() internally.
Service-specific ARN parsers (LambdaArnUtils, DynamoDbTableNames,
AppConfigTagHandler) keep their domain validation but delegate the
six-field base parsing to AwsArnUtils.parse().
Implement cross-stack export/import support so CDK multi-stack deployments
resolve Fn::ImportValue tokens to actual values instead of passing them
through as literal strings.
Changes:
- Track exports from stack Outputs with Export.Name declarations
- Maintain a global per-region export registry in CloudFormationService
- Resolve Fn::ImportValue in CloudFormationTemplateEngine via the registry
- Add ListExports API action with AWS-compatible XML response
- Include ExportName in DescribeStacks output XML
- Validate duplicate export names across stacks (AWS-compatible error)
- Fail stack creation when Fn::ImportValue references a missing export
- Clean up exports on stack delete and update
- Route ListExports through AwsQueryController
Tests:
- Cross-stack Fn::ImportValue with Fn::Join
- Dynamic export names via Fn::Sub
- Export rename on stack update
- Duplicate export name rejection
- Missing import value failure
AWS SDKs using the form-encoded query protocol send queue-specific operations
(GetQueueAttributes, SendMessage, ReceiveMessage, etc.) with the queue URL as
the HTTP path and no QueueUrl in the body:
POST /000000000000/my-queue HTTP/1.1
Content-Type: application/x-www-form-urlencoded
Action=GetQueueAttributes&AttributeName.1=QueueArn
#153 fixed routing for this pattern (preventing S3Controller from handling
the request), but QueueUrl was lost after the path rewrite, so SqsQueryHandler
received null and returned QueueDoesNotExist.
Fix: before rewriting the path, reconstruct the queue URL from the original
path components and append it to the entity stream as a form parameter
(&QueueUrl=...). SqsQueryHandler then reads it naturally from the form body.
Content-Length is updated when present. AwsQueryController is unchanged.
Affects Java SDK v1, Python boto3 (legacy), Go SDK v1, .NET SDK v1, and any
other client using the query protocol with path-based queue URL routing.
Adds the admin variant of RespondToAuthChallenge, enabling server-side
challenge response handling with explicit UserPoolId validation.
Extracts shared challenge logic into processChallenge to avoid duplication.
* fix(http): remove 8 KB per-attribute limit on form-encoded request bodies
Vert.x 4.x defaults HttpServerOptions.maxFormAttributeSize to a small
value (effectively 8 KB via the Netty AbstractHttpData limit). This
causes any request with Content-Type: application/x-www-form-urlencoded
that carries a single attribute larger than the limit to be rejected with
"Size exceed allowed maximum capacity".
Two places fixed:
- HttpOptionsCustomizer (new CDI bean): sets maxFormAttributeSize=-1 on
the main Quarkus HTTP server so large form-encoded AWS Query Protocol
requests (CloudFormation templates, EC2 UserData in base64, large IAM
policies, etc.) are accepted. The overall body size is still bounded
by quarkus.http.limits.max-body-size (512 MB).
- RuntimeApiServer: passes HttpServerOptions with maxFormAttributeSize=-1
when creating the per-container Vert.x HTTP server. This fixes the case
where the Lambda runtime posts a large synchronous response body (e.g.
a 5 MB base64 payload) back to the Runtime API endpoint and the body
is incorrectly decoded through the form attribute path.
* fix(lambda): enforce AWS invoke payload size limits (sync 6 MB, async 1 MB)
Rejects oversized invocation requests with HTTP 413 RequestTooLargeException
before dispatching to the container, matching the AWS Lambda API contract.
Also enforces the 6 MB sync response limit after the function returns.
* test(lambda): add tests for invoke payload size limits
Unit/integration tests (LambdaIntegrationTest) cover sync >6 MB and async >1 MB
request rejections plus boundary-at-limit acceptance. Compat test
(LambdaPayloadSizeLimitTest) uses the Java SDK to verify RequestTooLargeException
is surfaced correctly, including a Docker-gated test for the 6 MB response limit.
* test(lambda): add regression test for 5 MB response via RuntimeApiServer
Verifies that a sync invocation returning a 5 MB body (within the 6 MB AWS
limit) succeeds end-to-end. Without the maxFormAttributeSize fix on the
RuntimeApiServer, the Lambda runtime's POST of the large response body was
rejected by Netty's 8 KB form-attribute cap, crashing the request with
"Size exceed allowed maximum capacity".
IamActionRegistry.resolve() only looked for the Action parameter in the
URL query string. AWS SDKs send Query-protocol calls (IAM, STS, EC2,
SQS, SNS, RDS, ELBv2, CloudFormation, CloudWatch, ...) as POST with
Action=... in the application/x-www-form-urlencoded body, so the
resolver always returned null for those services. Combined with the
permissive "unknown action -> ALLOW" fallback in IamEnforcementFilter
and the absence of any iam/sts/ec2/sqs/sns rules in the REST-JSON rule
table, IAM enforcement was silently bypassed for every Query-protocol
service.
Read Action from the form-encoded body when it isn't in the query
string, and restore the entity stream so AwsQueryController's
MultivaluedMap injection still works.
The deny path returned a JSON AccessDeniedException body for every
request, including Query-protocol services (IAM, STS, EC2, SQS, SNS,
RDS, ELBv2, CloudFormation, CloudWatch, ...) and S3, both of which
speak XML. AWS SDKs hard-fail when an XML parser sees a leading "{",
so the deny payload was unreadable for those clients — the AWS CLI
prints "invalid XML received" and SDK error types are lost.
Pick the response shape from request signals:
- credentialScope == "s3" -> S3 <Error> XML
- form-encoded body -> AWS Query <ErrorResponse> XML
- everything else -> historical JSON shape (DynamoDB, Lambda,
Kinesis, KMS, REST-JSON services)
Status code stays 403 across all protocols; the message string is
unchanged, so downstream parsers that key off
"not authorized to perform: <action>" keep working.
Closes#656
* feat(lambda): support ImageConfig.WorkingDirectory override
Propagate WorkingDirectory from the Lambda ImageConfig through the full
stack so container images that rely on a specific WORKDIR can be invoked
correctly, matching real AWS behavior.
- LambdaFunction: add imageConfigWorkingDirectory field + getter/setter
- LambdaService: parse WorkingDirectory on CreateFunction and
UpdateFunctionConfiguration
- ContainerSpec: add workingDir record component
- ContainerBuilder: add withWorkingDir() fluent method
- ContainerLifecycleManager: pass workingDir to Docker via withWorkingDir()
- ContainerLauncher: apply workingDir when building the container spec
- LambdaController: serialize WorkingDirectory in ImageConfigResponse
* test(lambda): add tests for ImageConfig.WorkingDirectory
Unit tests (LambdaImageConfigTest):
- CreateFunction stores WorkingDirectory alongside Command/EntryPoint
- createFunction with all three fields together
- updateFunctionConfiguration updates and clears WorkingDirectory
- ContainerLauncher passes workingDir to ContainerSpec
Compat tests across all SDKs:
- awscli (lambda.bats): create/get/update WorkingDirectory round-trip
- Java SDK (LambdaFunctionConfigTest): ImageConfig.WorkingDirectory round-trip
- Python (test_lambda_function_config.py): TestImageConfigWorkingDirectory class
- Node (lambda.test.ts): create/update WorkingDirectory assertions
- Go (lambda_test.go): TestLambdaImageConfigWorkingDirectory subtests
- Rust (lambda_test.rs): full create/get/update round-trip