mirror of
https://github.com/floci-io/floci.git
synced 2026-11-22 21:50:46 -05:00
0f4f59bbbbbc706644de2ccf7aea033a9c7dcfaf
1447
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
0f4f59bbbb |
fix(elbv2): require an HTTPS default certificate (#5989)
* fix(elbv2): require an HTTPS default certificate Refuse HTTPS listener changes until a default certificate is supplied. * docs(elbv2): keep certificate checks documented correctly |
||
|
|
7fb649715c |
fix(cloudfront): serve a Lambda Web Function endpoint origin from Floci itself (#6022)
* fix(cloudfront): serve a Lambda Web Function endpoint origin from Floci itself A custom origin whose domain is an endpoint this Floci minted now goes to the listener the viewer reached, with the endpoint domain as Host. Before, the endpoint host did not resolve, and loopback failed the private address check. As on AWS, a forwarded viewer Host is a 502, because the endpoint's certificate does not name it. * fix(cloudfront): fetch the endpoint origin over plain HTTP for TLS viewers A viewer over TLS reached the HTTPS port, and Floci sent plain HTTP to it. The request now goes to the plain HTTP port at the same address. The endpoint domains are also indexed by the host a CloudFront origin names, so a base URL host with upper case or a trailing dot still matches. |
||
|
|
4b3681eb90 |
fix(apigateway): preserve API ownership across integration invocations (#6001)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
456ae15684 |
fix(ec2): apply the AWS public address rules and displace earlier Elastic IPs (#5963)
* fix(ec2): assign mock public addresses and displace earlier Elastic IPs In mock mode an instance never received a public IPv4 address, whatever its subnet's MapPublicIpOnLaunch or its launch's AssociatePublicIpAddress said, and an associated Elastic IP never reached DescribeInstances. - A mock instance that asks for a public address gets one when it reaches running, whether DescribeInstances, DescribeInstanceStatus or StartInstances completes the launch. Stop and termination release it. An associated Elastic IP replaces it and survives a stop; disassociating it gives a running instance a new automatic address when its launch asked for one. - AssociateAddress disassociates the Elastic IP an instance already has, including one a retained interface carried onto it, as the AssociateAddress reference describes. - Launches from a template take AssociatePublicIpAddress from its device-index-0 interface (RunInstances, CreateFleet, Auto Scaling), and RunInstances and CreateFleet also take that interface's subnet. - RunInstances refuses an instance-level SubnetId combined with network interfaces, on the request or in its launch template, with InvalidParameterCombination. Split out of #5671 at review. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): scope Elastic IP displacement and automatic addresses as AWS does - AssociateAddress ignored PrivateIpAddress, so an Elastic IP meant for a secondary private address displaced the one on the primary. The address is now recorded on the private address it names, only an address already on that private address is displaced, the interface shows it there, and in mock mode only the primary's address becomes the instance's public address. - An instance launched on an existing network interface got an automatic public address; AWS assigns one only to an interface the launch creates. - A released automatic address was replaced while a second interface was attached; AWS does not replace it then. - An Elastic IP that a retained interface carried to a new instance stayed without an instance. It now names that instance, which shows the address and keeps it across a stop. - A mock launch could complete over a concurrent stop or termination, and DescribeAddresses could write back an address disassociated meanwhile; both now re-check under the instance's lock. The tests also cover a request's own network interfaces with an instance-level SubnetId, and the template interface docs now say which launches take the subnet. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): settle second-review findings on mock public addresses - DescribeAddresses re-points associated addresses under the allocation lock, and a mock launch, start or stop reads the instance's Elastic IP under it, so none of them acts on an association written halfway or changed meanwhile. - An Elastic IP that a retained interface carries is found through that interface, also when it is disassociated, instead of being rebound to the next instance at launch, which left a dead InstanceId behind when a container launch failed. - StartInstances leaves a running mock instance alone. - In container mode too, an address on a secondary private address no longer becomes the instance's public address. - The second-interface test associates its address before attaching the interface, since AssociateAddress by InstanceId needs exactly one. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): keep terminated mock instances down and address reads unblocked - StopInstances leaves a terminated or shutting-down mock instance as it is, re-checked under the lock, so terminate, stop and start no longer revives it with a public address. - DescribeAddresses waits for the allocation lock only when an address is associated with an instance, and the container re-point no longer rewrites an unchanged instance. - A mock start treats a state without a name as settled instead of throwing. Tests now cover the terminated instance and, with a reachable container address, an Elastic IP on a secondary private address leaving the instance's public address alone. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): settle Qodo findings on mock public addresses - AssociateAddress refuses a PrivateIpAddress that is neither the instance's primary private address nor a secondary address of its primary interface, with InvalidParameterValue and before any association changes, instead of treating it as the primary and displacing the Elastic IP already there. - RunInstances from a launch template whose device-index-0 interface names an existing NetworkInterfaceId launches on that interface, in its subnet and without an automatic public address, as a request naming it would, instead of on a new interface in the default subnet. - The SubnetId-with-interfaces refusal test now launches against a real subnet and checks that the refused request leaves no instance or interface behind. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): accept a container instance's launch address in AssociateAddress In container mode without AWS-faithful private addresses, the container manager replaces the instance's reported private address with its Docker bridge address once the container runs, and nothing keeps the subnet address RunInstances returned. The new PrivateIpAddress check therefore refused that address with InvalidParameterValue, though callers may still name it. Only mock mode and the AWS-faithful mode, which keep the launch address, now refuse a stray PrivateIpAddress; elsewhere any value means the primary address, as before. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): decide automatic public addresses the same way with containers The public IPv4 rules were applied to mock instances only. A container-backed instance kept its address after a stop and a termination, got one on an existing network interface, kept its reachable address after its Elastic IP was disassociated even when the launch never asked for one, and had a released address replaced while a second interface was attached. One rule, AutomaticPublicAddress, now decides whether an instance has an automatic address in both modes: the launch asked for one on an interface the launch created (recorded when the instance is built), a stop, a termination or a disassociated Elastic IP releases it, and a replacement is held back while a second interface is attached. An Elastic IP on the primary private address still takes precedence. Only the value differs by mode: the container's reachable address, or an invented one where there is no container. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): settle review findings on the shared public address rule - DisassociateAddress decides by the association, not by comparing addresses: only an Elastic IP on the instance's primary private address gives way to another one left there, or to an automatic address when one is due. With a container, every Elastic IP points at the one reachable address, so disassociating a secondary one no longer clears the instance's public address, and one a restart moved no longer survives its disassociation. - StartInstances on a stopped container instance releases an automatic address that a stop outside StopInstances, such as Floci's shutdown, left in place, so the start decides afresh. - With a container, these writes no longer wait on the instance's lock while holding the allocation lock, since the port-forward manager holds that lock across Docker calls. - A start test case now keeps an address distinct from the one it expects, and two comments describe the flag as it now is. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): release only the primary interface's Elastic IP on disassociation - DisassociateAddress treats an Elastic IP as the instance's public one only when it sits on the primary interface, not on a retained interface attached at another device index, so disassociating that one no longer clears the instance's automatic address. - With a container, DescribeAddresses no longer writes a re-pointed address back onto a terminated or shutting-down instance. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): show a carried Elastic IP on a container instance's launch - An instance launched on a retained interface that still carries an Elastic IP records that address at RunInstances, and the container launch re-points it once the container runs. With containers, such an instance had no public address until a stop and start, since the shared rule gives an existing interface no automatic address. - With a container, TerminateInstances clears the public address under the allocation lock, so a DescribeAddresses re-point already under way cannot write it back onto the terminated instance. - The secondary-interface disassociation test checks the address was still associated before the call and is not after it. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): re-point a carried Elastic IP at its new instance - DescribeAddresses re-points an Elastic IP that a retained interface carries at the instance that interface is now the primary interface of. With containers, the address otherwise kept the previous container's address for good, since termination clears its instance id. - With a container, StopInstances leaves a terminated or shutting-down instance alone, as mock mode does, instead of stopping it into a startable state and writing its Elastic IP back. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): give mock instances no invented public address by default Mock instances due an automatic public IPv4 address got a random 54.x.x.x one, a real AWS range, so a tool that connected to it reached someone else's host. The new floci.services.ec2.mock-public-addresses setting (FLOCI_SERVICES_EC2_MOCK_PUBLIC_ADDRESSES) chooses the address: none (the default) gives none, documentation draws distinct addresses from 203.0.113.0/24 as Lightsail and EMR do, and fixed gives every instance mock-public-address (default 127.0.0.1), an address the caller can reach. Only the value changes. The launch still records whether it asked for an address, so the shared rule and Elastic IP precedence work as before, and instances with containers keep reporting their reachable address. Elastic IP allocation still draws from 54.x.x.x, as on main. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): settle review findings on the mock public address setting A configured mock-public-address with surrounding spaces was reported as is; it is now stripped. The docs and the AutomaticPublicAddress Javadoc no longer describe every mock instance as getting an address, and the test configurations that launch mock instances name the setting instead of leaving it null. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): allocate Elastic IPs from the documentation range AllocateAddress handed out random 54.x.x.x addresses, a real AWS range, and this branch shows an associated Elastic IP as a mock instance's public address, so even with mock-public-addresses at none a client could reach someone else's host through one. Elastic IPs now come from 203.0.113.0/24 in every mode, distinct from the account's other Elastic IPs and its instances' public addresses; once all 254 are taken AllocateAddress fails with AddressLimitExceeded rather than repeat one, since callers name an Elastic IP by its address. Under mock-public-addresses: fixed, an Elastic IP on a mock instance's primary private address is re-pointed at the configured address, as one on a container instance is at the container's reachable address, and disassociation restores the allocated address. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): settle review findings on documentation-range Elastic IPs An Elastic IP re-pointed at the fixed address kept it after a restart under another setting; the next read now shows its allocated address again. The re-point Javadoc and the Elastic IP docs no longer claim a 54.x.x.x allocation or addresses that never repeat, the docs say that earlier allocations keep their address until released, and a test now proves an allocation skips the addresses instances hold. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
34d904fde5 |
feat(iot): search fleet things by connectivity status (#6025)
* feat(iot): search fleet things by connectivity status SearchIndex refused every connectivity field and its documents carried no connectivity, so an application that finds its things by connection state got InvalidQueryException. With connectivity indexing on, a thing now reports the MQTT broker session whose client id is its name, and connectivity.connected, connectivity.clientId and connectivity.disconnectReason can be searched. The other connectivity fields are still refused with InvalidQueryException. A thing whose client id never connected reports connected false and timestamp 0, as on AWS. The broker now records the account, region, connect time, keep alive and clean session of each session, and keeps in memory how the last one of each client id ended in each account and region, until a state reset. The reason is the one the session's disconnected lifecycle event carries, recorded by the same single endSession under the session lock, so the late end of a displaced session cannot overwrite its successor's. A plaintext session counts in the default account and region, a TLS session in its certificate's. Closes #4912 * fix(iot): serialize connectivity reads and resets with session ends A connectivity lookup read the live session without the session lock, so a search racing DeleteConnection could see the session connected after its disconnect was recorded. A state reset cleared the history without the lock too. Both now run under the session lock; the lookup tests the session's ended flag instead of the endpoint, as the lock is never held across endpoint calls. Tests cover the reset contract, a lookup and a reset racing a held DeleteConnection, and a TLS session counting in its certificate's account and region. |
||
|
|
1eb402d623 |
fix(ec2): keep tags in the region of the resource they label (#5973)
* fix(ec2): keep tags in the region of the resource they label DescribeTags listed every region's tags because the tag store was keyed by the bare resource id. Tags are now stored per region, so DescribeTags, DeleteTags, CreateTags and the aws:ResourceTag IAM condition only see the request region's tags. Each side of a cross-region transit gateway or VPC peering connection keeps its own tags in its own region. Tags stored by bare id are moved under their resource's region at startup, for every account; a tag whose resource no region holds is dropped. DescribeTags now reports image, volume, snapshot, network-acl, vpc-peering-connection and spot-instances-request instead of "unknown". Tags given when a volume or peering connection is created reach the store, and DescribeVolumes, DescribeSnapshots and DescribeSpotInstanceRequests show later CreateTags and DeleteTags changes. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): remove tags with their resource and keep node and catalog AMI tags on upgrade Deleting a volume (directly or as a delete-on-termination volume of a terminated instance), a snapshot with its image or a VPC peering connection, and pruning a terminated instance, now removes the resource's tags, both peering sides included. The startup migration no longer drops tags it cannot place in a store: a catalog AMI's tags move to the default region, and an instance's are kept until its EKS node is found in a region, which then claims them. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): file a cluster node's legacy tags under its own region A region-less findInstanceById reaches the EKS provider, which answers from any region, so the claim moved the node's legacy tags under a null region where DescribeTags never finds them. The claim now uses the instance's own region, and with no region known it reads the legacy tags in place for a regional lookup to claim. Signed-off-by: Hector Ventura <hectorvent@gmail.com> * fix(ec2): pass the region in the query GET resource-tag stub Signed-off-by: Hector Ventura <hectorvent@gmail.com> --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
5774e7db8d |
feat(cloudformation): support S3 Vectors resources (#5853)
* feat(cloudformation): support S3 Vectors resources * fix(cloudformation): validate S3 Vectors encryption settings * fix(cloudformation): align S3 Vectors provisioning contracts * fix(cloudformation): restore S3 Vectors properties on rollback |
||
|
|
eba0f72255 |
fix(iam): check iam:PassRole for ECS, Step Functions, EventBridge and CloudFormation (#5971)
Under IAM enforcement, a request that handed one of these services a role needed no iam:PassRole on it. A user allowed only ecs:RegisterTaskDefinition and ecs:RunTask could start a task with any role in the account, and with ECS task-role credentials on, the task got that role's credentials. The IAM user guide requires the permission for every role passed to a service. AWS's Service Reference names the service each operation passes its role to, and the check now covers these operations as it already covers Lambda and EC2: - ECS: RegisterTaskDefinition passes its task and execution roles to ecs-tasks.amazonaws.com. RunTask and StartTask pass the task definition's roles and any role override, and CreateService, UpdateService and CreateTaskSet pass the roles of the task definition they name. The infrastructure roles go to ecs.amazonaws.com: a managed EBS volume's role, the service role, the load balancer, lifecycle hook, Service Connect TLS and VPC Lattice roles, and a Managed Instances provider's infrastructure role. A role given by name is the role of that name in the caller's account. - Step Functions: CreateStateMachine and UpdateStateMachine pass roleArn to states.amazonaws.com, in a JSON or a CBOR body, gzip-encoded or not, since the CBOR endpoint decompresses a body before running it. - EventBridge: PutRule passes RoleArn, and PutTargets each target's RoleArn, to events.amazonaws.com. - CloudFormation: CreateStack, UpdateStack, DeleteStack, CreateChangeSet and ContinueUpdateRollback pass RoleARN when the request names one. A later operation that names none reuses the stack's role without the check, as CloudFormation does. CreateStackSet and UpdateStackSet pass AdministrationRoleARN, or the default AWSCloudFormationStackSetAdministrationRole for a self-managed StackSet, as the CloudFormation user guide says. An update goes by the StackSet's own permission model, which Floci keeps whatever PermissionModel the request names. A role override on RunTask is checked as well as the task definition's roles, not instead of them, because Floci runs a task with the definition's task role. The task definition and the StackSet's permission model are looked up through a new PassedRoleLookup interface, which ECS and the StackSet service implement, so the filter does not depend on either service. Three services are left out. Floci authorizes Cloud Control as cloudcontrolapi:*, where AWS uses cloudformation:*, so its RoleArn waits until that namespace is fixed. EventBridge Scheduler and Pipes are REST services that no IAM route rule maps to an action yet, so enforcement does not check their requests at all, iam:PassRole included. |
||
|
|
5787dac5e8 |
fix(kinesisanalytics): retry Flink configuration uploads (#6020)
Rebuild archive streams for transient daemon failures using the shared tar copier. Preserve required and optional copy handling, and cover consumed streams, retry exhaustion and startup order without sleeping in tests. |
||
|
|
fb390968d5 |
feat(guardduty): support publishing destinations (#6016)
* feat(guardduty): support publishing destinations
Add CreatePublishingDestination, DescribePublishingDestination,
UpdatePublishingDestination, DeletePublishingDestination and
ListPublishingDestinations under /detector/{detectorId}/publishingDestination.
Previously these returned UnknownOperationException, which broke
Terraform's aws_guardduty_publishing_destination.
Destinations are stored per detector through StorageFactory, so they follow
the detector's account and region scoping, survive a persistent-storage
reload, and report PUBLISHING on create (the state Terraform's create waiter
targets). A missing destination returns BadRequestException with the message
the Terraform provider matches for not-found. Deleting a detector removes its
destinations.
clientToken makes create idempotent and is capped at the model's 64
characters, measured in code points as the model's length constraint is.
destinationArn stays optional on create: the GuardDuty model marks
DestinationProperties.DestinationArn and KmsKeyArn as not required
(botocore guardduty/2017-11-28 service-2.json).
The service gains a five-store constructor; the existing three- and
four-store (malware protection plan) constructors delegate to it.
Closes #4983
* docs(guardduty): update the service matrix operation count
* test(guardduty): cover the publishing destination lifecycle through the SDK
Create, describe, update, list and delete an S3 publishing destination
with the AWS SDK v2 GuardDuty client, asserting the shapes as the SDK
reads them, including the required publishingFailureStartTimestamp.
|
||
|
|
28799ed352 |
fix(apigatewayv2): answer an HTTP API's Lambda proxy body it cannot read with 500 (#6012)
* fix(apigatewayv2): answer an HTTP API's Lambda proxy body it cannot read with 500 Review of #5985: the catch at the end of buildProxyResponse still answered an HTTP API with 502 and the function's output, for example when isBase64Encoded is set on a body that is not base64. Measured on HTTP APIs (eu-west-1), with payload formats 1.0 and 2.0: API Gateway answers 500 with {"message":"Internal Server Error"} a body that is an object or a list, an isBase64Encoded it cannot read as a boolean, and a body said to be base64 that does not decode. It reads isBase64Encoded's text as Go's strconv.ParseBool does: "True", "TRUE", "t" and 1 are true, "F" and 0 false, and "tRuE", "yes", 2 and 1.5 are not read. Floci read true, the text "true" and any integer but 0 as true, so it relayed "True" and "t" bodies undecoded, "yes" ones as plain text, decoded a body under 2, and answered an object body 200 with an empty body. A number or a boolean body is still its text. The catch now answers an HTTP API with the same 500 for a result Floci cannot parse at all; a REST API keeps its 502. * refactor(apigatewayv2): decode an HTTP API's base64 body once Review of #6012: the readability check decoded a base64 body that the response then decoded again, a second decode and array for every encoded reply. The catch at the end of buildProxyResponse already answers an HTTP API with 500 and the generic message, so the check now looks only at the body's shape, and a body said to be base64 that does not decode fails where it is decoded and reaches that catch. |
||
|
|
65e35adf54 |
feat(backup): add CreateLogicallyAirGappedBackupVault (#6015)
* feat(backup): add CreateLogicallyAirGappedBackupVault
Route PUT /logically-air-gapped-backup-vaults/{name}. The vault shares the
standard vault namespace and ARN shape; DescribeBackupVault reports VaultType
LOGICALLY_AIR_GAPPED_BACKUP_VAULT, VaultState and the retention days. Both
retention values are required, MinRetentionDays >= 7, MaxRetentionDays >= Min.
The vault is locked at creation so the existing retention enforcement applies,
vault-lock put/delete are rejected on it, and ListBackupVaults honours the
vaultType filter.
Closes #4986
* docs(backup): correct the service matrix operation count
* fix(backup): fail a job whose vault was replaced before it completed
A backup job resolved its vault by name at completion. Deleting a
logically air-gapped (or locked) vault while a job was in flight is
allowed, since it holds no recovery point yet; recreating the name as a
standard vault then received the old job's recovery point, which the
unlocked replacement let be deleted inside the original vault's minimum
retention.
Completion now checks, under the vault-name monitor, that the vault
holding the name is the incarnation the job started in. If not, the job
ends FAILED with no recovery point, as it cannot land in a vault that no
longer exists.
* fix(backup): air-gapped vault LockDate at creation; standard vault VaultType BACKUP_VAULT
CreateLogicallyAirGappedBackupVault now sets LockDate to the creation
date, so the vault's lock reads as compliance mode (immutable) rather
than a governance lock with no LockDate. DescribeBackupVault and
ListBackupVaults report VaultType BACKUP_VAULT for standard vaults,
filled at read time so vaults stored with no VaultType are covered.
|
||
|
|
f8ab55f319 |
feat(sfn): encode HTTP Task object bodies as form data (#6010)
* feat(sfn): encode HTTP Task object bodies as form data * refactor(sfn): simplify HTTP Task payload encoding Reuse the shared RFC 3986 URI encoder and remove the unused form payload branch while preserving buffer and no-body requests. |
||
|
|
87aa6f38a1 |
feat(iot): publish connection lifecycle events (#5277)
* feat(iot): publish connection lifecycle events The MQTT broker publishes $aws/events/presence/connected and disconnected for every session, with its session identifier, certificate principal, version number and disconnect reason, through topic rules and to subscribers. Topic filters starting with a wildcard no longer match $ topics, as on AWS. Closes #5275 * fix(iot): keep lifecycle events within the reset guard A lifecycle event admits its topic rules under the rule state at the time of the event, so one queued before an emulator reset skips them. A DeleteConnection that wins the session tolerates an endpoint the client's DISCONNECT already closed. * fix(iot): serialize session transitions and report keep-alive timeouts Admission, takeover, DeleteConnection and session end now allocate the versionNumber and change the session map under one lock, with endpoint I/O kept outside it. A takeover of an endpoint that is already closed still accepts the new connection. A close after a full keep-alive period without a packet from the client is reported as MQTT_KEEP_ALIVE_TIMEOUT, as AWS IoT does. The WebSocket upgrade carries the client's port, and the wildcard-first exclusion is limited to the lifecycle topics, which AWS does not deliver to such filters while it does deliver shadow topics. * fix(iot): keep ended sessions out of subscriptions and time keep-alive from CONNECT * test(iot): drive keep-alive tests from an injected nano-time source The broker takes a LongSupplier nano-time source, as ReloadingKeyManager does, so the keep-alive unit tests move a fake clock forward instead of sleeping. The race test uses ThreadStates.awaitBlockedOrDone. |
||
|
|
fcb41966a8 |
fix(cloudformation): read an ECS task definition's properties as the ECS handler does (#6018)
Measured on CloudFormation (eu-west-1): an AWS::ECS::TaskDefinition gets
no template validation. CloudFormation hands the ECS handler every
scalar as text, and the handler converts each to the type the resource
schema declares: an integer is a sign and digits once trimmed, within
32 bits ("+128", " 128", "0128"), and a boolean is true or false in
lower, upper or title case once trimmed. A value it cannot convert
("abc", 4.5 or true for an integer, "yes", "tRuE" or "1" for a
boolean), and an object, a list and a scalar standing for one another,
fail the resource with every violation of the unconverted model, where
every scalar is a String, so a Memory of 128 is listed beside the value
that failed. At each object its missing required members come first,
then its members in the schema's order. When every value converts, the
required members the model lacks fail it alone, grouped where their
paths meet as the schema validator groups them.
Floci read the properties as plain JSON: a Memory of "abc" and a
container without an image were registered, and an Essential of
"False" registered an essential container.
AWS::ECS::TaskDefinition joins the generated cfn-property-types.json,
whose structures now carry the members the schema requires, read into
RequestShapeModel's shapes. CfnPropertyTypes' walk over the shapes is
shared by the template validation Reader and the new HandlerReader,
which differ in how a scalar converts and in what a mismatch does.
|
||
|
|
a103b938d2 |
fix(query): route signed GET requests through the Query dispatcher (#6007)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
0a37ea830b |
fix(dynamodb): support legacy table discovery and batch cleanup (#5986)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
83147f204e | fix(rds): buffer PostgreSQL login responses for PgBouncer (#6005) | ||
|
|
2b45288e13 |
fix(sagemaker): retry model and training archive uploads (#5999)
* fix(sagemaker): retry model and training archive uploads * test(sagemaker): avoid production backoff in retry tests |
||
|
|
ca47df9ec5 |
fix(lambda): preserve Docker provided runtime bootstrap paths (#5974)
Signed-off-by: Andre Kurait <akurait@amazon.com> |
||
|
|
4c9deed379 |
fix(elbv2): apply duration-based target stickiness (#5978)
* fix(elbv2): apply duration-based target stickiness * fix(elbv2): honor inherited cross-zone stickiness * fix(elbv2): simplify target-group stickiness eligibility |
||
|
|
6e5b1569fe |
feat(lambdaweb): publish the Web Function metrics (#5976)
* feat(lambdaweb): publish the Web Function metrics to CloudWatch AWS counts a request that reached an environment in ExecutedRequests, also one answered with Runtime.OriginRequestError or Runtime.RequestTimeout. The status classes count the platform pages too, except the 400, 404 and 505 pages. Each environment has a datapoint at init, also a failed one, then one each minute and one when it ends. * fix(lambdaweb): bound the waiting metric writes and store them before shutdown * fix(lambdaweb): report each answer before it goes out and build datapoints with MetricDatum.of A test can then wait for the publisher once and read the metrics without polling. RDS and SES build their datapoints with the same factory. * fix(lambdaweb): wait for the metric writes even when their queue is full The wait now takes the last accepted write instead of a slot in the queue. The writes run one at a time in order, so once it is done all are. Only PutMetricData stores a zero timestamp as the current time, so the MetricDatum.of comment says so. |
||
|
|
e06013e1fe |
docs: keep grouped service action counts in sync (#5991)
* docs: keep grouped service action counts in sync * docs: guard service action source coverage * docs: require counts for generated action tables * docs: correct on-premises instance tag descriptions |
||
|
|
c145fa104c |
fix(ssm): normalize parameter resource ARNs (#5261)
* fix(ssm): normalize parameter resource ARNs A parameter's ARN is now arn:<partition>:ssm:<region>:<account>:parameter/<name without leading slash> for both top-level names and paths, matching AWS. Before, a top-level name such as foo got parameterfoo. SsmService.parameterResource(name) is the single formula, used by PutParameter and by the AWS::SSM::Parameter provisioner, so the CloudFormation Arn attribute equals the GetParameter ARN. Tag operations and the internal getParameter(nameOrArn, region) read resolve an ARN to the stored name and, for parameter/x when only x is stored, fall back to x, so a top-level parameter is found by its ARN, also with a :version or :label selector. ECS task secrets pass valueFrom to that read whole instead of stripping only ":parameter". Legacy parameterfoo ARNs still resolve. * test(cloudformation): share the CloudFormation Query request builder Six CloudFormation integration tests each carried a private copy of the same Query request builder, as cfn or request. CfnRequests.cfn in testing replaces them, as RdsRequests.rds does for RDS. A null stack name leaves StackName out, which the ContinueUpdateRollback validation test needs. |
||
|
|
e75b15809f |
fix(autoscaling): honor launch configuration metadata options (#5964)
* fix(autoscaling): honor launch configuration metadata options CreateLaunchConfiguration ignored MetadataOptions, so DescribeLaunchConfigurations never returned them and every instance launched from the configuration got EC2's defaults, HttpTokens=optional included. - The Query handler and the AWS::AutoScaling::LaunchConfiguration provisioner read the structure, validate it as EC2 does (ValidationError for a value outside the allowed set or range) and store it. CloudFormation resolves Fn::If and AWS::NoValue inside it. - DescribeLaunchConfigurations returns the structure with defaults for the members left out, and omits it when it was never given. - The reconciler passes it to every launch, instance refresh replacements included. - Auto Scaling launches from a launch template, directly or through a mixed instances policy, and CreateFleet forward the template's metadata options, which they dropped before. Split out of #5671 at review. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(autoscaling): clean up after the launch configuration metadata tests The metadata tests now delete the groups, launch configurations and stacks they create, so later reconcileAll calls in the shared test application stop reconciling leaked groups. They build their Authorization headers with EnforcementFixtures.auth, and the case that expects no MetadataOptions first checks that the launch configuration was found. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(autoscaling): word metadata option errors as Auto Scaling does CreateLaunchConfiguration refused bad MetadataOptions with EC2's InvalidParameterValue text under a ValidationError code. It now answers with Auto Scaling's model-validation text, for example "1 validation error detected: Value '65' at 'metadataOptions.httpPutResponseHopLimit' failed to satisfy constraint: Member must have value less than or equal to 64", and reports every invalid member of the structure in one error, "N validation errors detected: ...; ...". EC2's validator is no longer shared. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): refuse list or object launch configuration metadata members A MetadataOptions member given as a list or an object, such as HttpTokens: [required], read as an empty string and so as absent: the launch configuration was created with that member at its default, HttpTokens=optional included. Such a member now fails the resource with ValidationError, as the whole structure already does when it is not an object. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(autoscaling): cover every metadata member in the combined error The test that sends several invalid MetadataOptions members now makes all three invalid, so the position of HttpEndpoint in the combined ValidationError is checked, and confirms that no launch configuration was created. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): report metadata type errors as CloudFormation does A launch configuration MetadataOptions block or member of the wrong JSON type failed with wording Floci made up, such as "HttpTokens must be a string.". It now fails with CloudFormation's schema type error, as the S3 and DynamoDB provisioners already report it, for example "Model validation failed (#/MetadataOptions/HttpTokens: expected type: String, found: JSONArray)". A value of the right type that Auto Scaling rejects keeps Auto Scaling's ValidationError. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): report an oversized metadata hop limit as out of range A whole-number HttpPutResponseHopLimit too large for an int, such as 2147483648, failed with the contradictory "expected type: Integer, found: Integer". It is an integer outside 1 to 64, so it now fails with the same Auto Scaling ValidationError text as 65 or 0, with the value as written. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): count an oversized hop limit with the other metadata errors An oversized CloudFormation HttpPutResponseHopLimit was refused before the other MetadataOptions members were checked, so an invalid HttpTokens beside it went unreported, and the value was echoed as written, "+002147483648" included. Auto Scaling now builds the whole error from the options and the hop limit as a BigInteger, so the oversized value is counted with every other violation and printed as a plain number. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(autoscaling): build metadata option errors through SmithyValidationErrors The launch configuration MetadataOptions validator assembled its "N validation errors detected" message by hand. It now uses SmithyValidationErrors, which main adopted for Auto Scaling's other checks. The error code and text are unchanged. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): read launch configuration metadata through CfnPropertyTypes The MetadataOptions reader had its own type check and answered every wrongly typed value with the handler's "Model validation failed" message. It now reads the block through CfnPropertyTypes, as the Events and Lambda provisioners do: - a value of the wrong type fails template validation first, for example "Property [HttpTokens] expected type: String, found: JSONArray", and a hop limit of 4.5 is "found: Float"; - a hop limit beyond 32 bits fails the handler's model validation, before Auto Scaling's own check runs; - a number or a boolean given for a string member arrives at Auto Scaling as its text, as CloudFormation converts it, and fails its enum check there. The hand-written type helpers go away. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * refactor(autoscaling): fold the metadata options error back into its validator The public metadataOptionsError took the hop limit as a BigInteger so that CloudFormation could report a value beyond 32 bits through it. CloudFormation now refuses such a value in model validation, before Auto Scaling, so the helper goes back to a private validator over the Integer field. The error code and text are unchanged. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(ec2): delete the launch template the metadata test creates Ec2LaunchTemplateMetadataOptionsIntegrationTest never deleted its launch template, and its cleanup began only after the fleet or group had launched, so an earlier failure left everything behind. Everything after the template is created now runs in the try block, and the finally block removes the group or the instance and then the template, ignoring the status so a test's own failure is kept. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(ec2): check template metadata options before a CreateFleet dry run A launch template stores its metadata options unchecked, as AWS does, so they fail at launch. CreateFleet forwards them to the launch since this branch, but a dry run returned DryRunOperation before any launch ran, saying a fleet would succeed that then fails with InvalidParameterValue. CreateFleet now checks every launch's metadata options with the rest of its pre-launch checks, as RunInstances does before honoring DryRun. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(autoscaling): pin the Query answer for a hop limit beyond 32 bits CreateLaunchConfiguration with MetadataOptions.HttpPutResponseHopLimit= 2147483648 answers MalformedInput, as for any value that is not a 32-bit integer: the awsQuery protocol binds the member before model validation runs. A row now covers it beside the non-numeric case. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
09b14e9d10 |
fix(s3): check the extra IAM actions a CreateBucket needs (#5961)
* fix(s3): check the extra IAM actions a CreateBucket needs A CreateBucket whose headers configure the new bucket needs more than s3:CreateBucket, as the CreateBucket API reference lists: - s3:PutBucketAcl for a canned ACL other than private, or a grant header - s3:PutBucketObjectLockConfiguration and s3:PutBucketVersioning for x-amz-bucket-object-lock-enabled: true - s3:PutBucketOwnershipControls for x-amz-object-ownership S3Controller now checks these actions before the bucket is created, so a denied request creates nothing. * chore(s3): move the CreateBucket header actions next to the object ones S3ObjectActions.bucketCreationActions now gives the actions a CreateBucket needs from its headers, and reuses GRANT_HEADERS. EnforcementFixtures.putUserPolicy replaces the test's own PutUserPolicy helper. |
||
|
|
3a913ca8d6 |
fix(s3): ignore hoisted upload checksum query parameters (#5977)
* fix(s3): ignore hoisted upload checksum query parameters * fix(s3): ignore hoisted multipart checksum types |
||
|
|
49d2d74f3f |
fix(apigatewayv2): answer the Lambda proxy results an HTTP API cannot read with 500 (#5985)
* fix(apigatewayv2): answer the Lambda proxy results an HTTP API cannot read with 500
Measured on HTTP APIs (eu-west-1), with payload formats 1.0 and 2.0:
a function that raises is answered 500 with {"message":"Internal Server
Error"}, not the 502 Floci sent. The same 500 answers what API Gateway
cannot read as a response: in format 1.0 a result that is not an object
with a statusCode (a result without one, a string, a number, null), and
in either format a statusCode that is not a whole number from 100 to 599
(99, 600, 201.5, "abc"); a statusCode given as text that spells one,
"201", is taken, and headers that are not an object are left out.
Format 2.0 keeps inferring a 200 for a result without a statusCode.
Floci answered a format 1.0 result without a statusCode with 200 and
its headers and body, as HttpApiLambdaProxyResponseInferenceIntegrationTest
pinned since #5153; AWS answers 500, and that test and the unit tests
that pinned 502 now expect what AWS answers. A REST API's Lambda proxy
keeps its own 502, untouched.
The HTTP API's generic error responses come from one helper, which the
invocation failures from #5935 (500, or 503 when Lambda throttles) use
too.
* test(compat): skip the HTTP API proxy cases unless the API reaches Lambda
Review of #5985: the test checked only that Lambda can be invoked, not
that API Gateway dispatches to it. It now sends a readable result through
the API first, as ApiGatewayV2ExecuteTest does, and skips the cases when
that does not come back.
|
||
|
|
241806a4f3 | fix(codeartifact): retry Verdaccio configuration uploads (#5982) | ||
|
|
84dfb77f99 |
fix(acm): reject mismatched certificate private keys (#5987)
Preserve existing certificates when an import supplies the wrong key. |
||
|
|
b14537baa7 |
fix(iam): take every access key status the model publishes (#5968)
UpdateAccessKey refused the Expired that statusType permits, answered a message of its own making, and read the status only after it had looked the key up, so a bad key carrying a bad status answered NoSuchEntity 404 where the shape is what AWS answers for. The reference's Valid Values line on the operation reads "Active | Inactive | Expired" and the pinned model's statusType holds those same three. The fix is one call rather than a new rule. requireStatusFromEnum already serves UpdateSigningCertificate, UpdateSSHPublicKey and UpdateServiceSpecificCredential: it validates before each of those lookups and answers the rendering a recording of the third shows, naming neither the offending value nor the permitted set. UpdateAccessKey was the one operation of the four not calling it, so it calls it, and the helper's javadoc and the set behind it say four instead of three. UserName was the other half. The page carries the sentence DeleteAccessKey carries, "if the UserName is not specified, the user name is determined implicitly based on the AWS access key ID used to sign the request", and the handler passed the raw parameter straight through, so a call that omitted it compared the key's owner against null and answered NoSuchEntity. It resolves through resolveUserName now, as GetUser, ListAccessKeys and DeleteAccessKey do, and AccessKeyId is read through requireParam, as the sibling handlers read the ids they require. AWS::IAM::AccessKey refused Expired as well, and its own Allowed values line in the CloudFormation template reference reads "Active | Inactive | Expired". Leaving it would have been the same drift on a second surface, and taking Expired on the API while refusing it in a template is worse than either alone. The provisioner keeps its own guard, which runs before a key is created so that a refusal cannot orphan one, and its own message, which names the resource it refuses. One more drift came out of reading the method back, and it is the one that mattered. updateAccessKey is a read-modify-write that took no lock, where each of the three sibling status operations holds its family's. There was no access key lock at all: createAccessKey counted a user's keys and only then stored another, and the user rename rewrote each key's owner outside one, the single credential family that rename did not guard. Measured before the fix, racing the calls against each other: an update racing a delete wrote the deleted key back on 80 of 2000 trials, and four callers racing the two-key quota left more than two on 226 of 500. One accessKeyLock now covers the count and the store, the lookup and the delete, the read-modify-write, and the rename's loop, and the owner check that the delete and the update each carried is one helper. Substituting a fresh monitor for that lock at all four sites fails the quota case on its first trial and the resurrection case by its eighty-third. Three more places the lock has to reach, each measured the same way. The rename read the key list before taking the lock and rewrote it inside, so a delete that landed in between was undone and the key came back under the new name, where it authenticates again; the read moves inside the lock, where every other credential family already reads its own, and putting it back outside fails by the third trial. createAccessKey confirmed the user before taking the lock and deleteUser checked for keys without holding it, so a create could store a key for a user the delete had just removed; the confirmation moves inside the lock, the way UploadSigningCertificate's already is, and deleteUser holds the lock across its key check and the delete, outermost of the five it nests, which is the order UpdateUser leaves intact by taking that lock on its own. Reverting either half alone puts the orphan back, by the seventeenth trial and by the second. Fifteen tests. Seven over the wire: Expired stored and read back, a status outside the set, an absent status, an absent key id, the order against a key that is not there, a call that names no user, and another user's key still answering NoSuchEntity. Three on the service for the three statuses, the order, and the absent status. One on the provisioner for a template declaring Expired. And four in IamConcurrencyTest, which raced six collections and no credential family before this: an update against a delete, four creates against the quota, a rename against a delete, and a create against DeleteUser. The two refusals also read the key back, over the wire and on the service, so a validation that wrote before it refused would not pass them. What is left is the count: AWS reports "2 validation errors detected" when the id and the status are both wrong, where every message here leads with one, which is the follow-up #5280 already carries. |
||
|
|
36b315d77b |
fix(s3): refuse Object Lock settings on a bucket without Object Lock (#5969)
PutObjectRetention, GetObjectRetention, PutObjectLegalHold and GetObjectLegalHold on a bucket without Object Lock set or returned the setting with a 200. S3 refuses them with 400 InvalidRequest, "Bucket is missing Object Lock Configuration", as LocalStack's AWS-validated recordings show, and Floci now does too, before it looks for the key. A legal hold without a status is still refused as malformed first, as recorded. PutObject, CopyObject and CreateMultipartUpload applied a mode, a retain-until date or a legal hold of ON on such a bucket as well, and since deletes enforce the lock there too, a COMPLIANCE object in it could not be deleted until its date passed. They are refused the same way. No AWS document or recording covers object creation; moto refuses the same headers with InvalidRequest under its own message, so the recorded one is used. A legal hold of OFF sets no lock and is still accepted. In a bucket with Object Lock, GetObjectRetention and GetObjectLegalHold of an object without a retention or a legal hold answered 200, with no mode or with OFF. S3 was recorded answering both with 404 NoSuchObjectLockConfiguration, which they answer now. PutObjectRetention saved a mode without a date, a date without a mode, or a mode S3 does not know. S3 was recorded refusing a mode without a date, and an unknown mode, with 400 MalformedXML, and a date without a mode would now read as no retention at all, so all three are refused that way. A retention naming neither still removes it. |
||
|
|
98b2429e58 |
fix(ecs): launch a container with its linuxParameters, checked as RegisterTaskDefinition does (#5951)
* fix(ecs): launch a container with its linuxParameters, checked as RegisterTaskDefinition does
RegisterTaskDefinition kept a container's linuxParameters and
DescribeTaskDefinition returned them, but the container was launched
without any of them. A worker that set initProcessEnabled so its orphaned
browser processes would be reaped ran with its own command as PID 1, and
they stayed zombies until the container ended; capabilities, devices,
/dev/shm size, tmpfs mounts and swap limits were ignored the same way.
ECS documents each member as a docker run option, and the container is
now created with them: initProcessEnabled is --init (through
ContainerSpec.init, the flag main already has for it), capabilities are
--cap-add and --cap-drop, devices are --device (read, write and mknod when
no permissions are given, at the host path when no container path is),
sharedMemorySize is --shm-size in MiB, each tmpfs entry is a --tmpfs of
its size in MiB with its mount options, maxSwap is --memory-swap as the
container's hard limit plus that many MiB, and swappiness is
--memory-swappiness. ContainerSpec gains LinuxOptions for the rest,
applied in ContainerLifecycleManager's HostConfig; a constructor with the
former signature keeps every other caller unchanged.
A container behind a security group already had NET_ADMIN and NET_RAW
dropped, because the group is enforced by nftables in the namespace the
task's containers share. Docker applies a named --cap-add over a
--cap-drop, so those two are now also removed from what the container
asks to add; ALL can stay, since Docker grants every capability but the
dropped ones then (measured: docker run --cap-add ALL --cap-drop NET_ADMIN
--cap-drop NET_RAW reports CapEff 000001ffffffcfff, bits 12 and 13 clear).
Measured on RegisterTaskDefinition (eu-west-1, 2026-10-03 and 2026-10-16),
with the SDK's own validation off, and now checked the same way before
anything is stored:
- every capability must be one the KernelCapabilities reference lists, in
any case and without a CAP_ prefix ("Unrecognized Linux capabilities in
add: [CAP_NET_ADMIN]", likewise for drop);
- a device needs a hostPath ("Device cannot have empty hostPath") and only
read, write and mknod as permissions, as written ("Invalid permission:
READ for device /dev/null");
- a tmpfs mount needs a containerPath, a size above zero and options the
Tmpfs reference lists, as written ("The NOEXEC tmpfs mount option
specified is invalid.");
- sharedMemorySize must be above zero, maxSwap zero or more and needs a
swappiness ("When a container has a swap memory, it must also specify a
swappiness value."), from 0 to 100;
- the checks run capabilities, devices, tmpfs, then swap, all before the
Fargate rules;
- on Fargate a non-empty devices list, sharedMemorySize, maxSwap and
swappiness are refused in that order ("Fargate compatible task
definitions do not support devices", with no trailing period, unlike
AWS's other Fargate refusals), and any capability added but SYS_PTRACE
as written ("NET_ADMIN is not allowed on Fargate.");
- a swappiness without maxSwap is accepted and dropped, and capabilities
are stored with both an add and a drop list.
EcsLinuxParameters holds all of it, validation, the stored form and the
launch, and reads the members through one set of helpers, so EcsService
only calls it.
Not done: swap is not limited for a container with no hard memory limit,
since Docker cannot limit swap without one, and a daemon on cgroup v2
discards swappiness, as Amazon Linux 2023 does on ECS.
Tests: EcsLinuxParametersTest and ContainerLifecycleManagerLinuxOptionsTest
for what reaches Docker, EcsLinuxParametersDockerIntegrationTest for a
real container (PID 1, capabilities, device, /dev/shm, tmpfs),
EcsFargateEdgeCaseIntegrationTest for the measured refusals and the stored
form, and EcsLinuxParametersRegistrationTest in sdk-test-java for the
same through the SDK.
* fix(ecs): read linuxParameters as RegisterTaskDefinition does, and guard devices like host volumes
Review of #5951 (Qodo).
A device hands the container the host's hardware, and reached Docker with
no check, where a host volume at the same path is refused by default.
HostVolumePolicy now covers each device's hostPath too, naming the field
it checks: refused unless floci.services.ecs.host-volume-roots holds it or
allow-unsafe-host-volumes is set, at RegisterTaskDefinition after AWS's
own checks (so their messages still come first) and again at launch,
through EcsContainerManager.checkDeviceHostPaths. The registration check
sits in EcsService rather than beside the host volume one in
EcsJsonHandler, so a template's definition gets it too.
Measured with raw requests on RegisterTaskDefinition (eu-west-1,
2026-10-18):
- a member of the wrong JSON type is refused with an
InvalidParameterException from the deserializer, before any rule on the
values: "Unexpected field type" for a scalar where an object or a list
is expected, "Unexpected value type in payload" for a device or a tmpfs
mount that is not an object, "Start of structure or map found where not
expected" for an object where a list or a scalar is expected,
"NUMBER_VALUE cannot be converted to String", "STRING_VALUE cannot be
converted to Integer", "TRUE_VALUE ...", "NUMBER_VALUE cannot be
converted to Boolean", "Unexpected token received from parser" for text
that is not true or false, and no message at all for a list where none
is expected;
- numbers are read as integers, the fraction dropped (sharedMemorySize
1.9 is stored as 1, 0.5 as 0 and refused) and the range capped
(3000000000 is 2147483647); a boolean may come as text in any case; a
null member or list entry is absent, and a null device is an empty one.
Floci kept such values as written and silently skipped what it could not
read, so a definition stored one size and launched another. The stored
form now holds what AWS stores.
Tests: EcsFargateEdgeCaseIntegrationTest for every measured shape, the
stored numbers, booleans and nulls, and a device refused by default; the
Docker test allows /dev/null through host-volume-roots. All fail on the
previous head.
* refactor(ecs): check linuxParameters' JSON types against the vendored ECS model
Review of #5951. EcsLinuxParameters hand-wrote the deserializer's type
check member by member, where Floci already drives that check from
botocore for DynamoDB and SES v2 (RequestShapeModel, with the shapes
vendored by tools/aws/request_shapes.py).
tools/aws/regen_ecs_shapes.py vendors botocore's ECS model as
src/main/resources/aws/ecs-request-shapes.json (botocore 1.43.113, the
release requirements.txt pins), registered in make aws-data-sync and
aws-data-check and in the shared generator's tests. EcsRequestShapes
walks a container's linuxParameters against the LinuxParameters shape
with ECS's InvalidParameterException messages, the ones measured on
RegisterTaskDefinition; EcsLinuxParameters' own member list is gone.
The messages and their order are unchanged.
The device change named host volumes only in two more descriptions of
floci.services.ecs.host-volume-roots: docs/configuration/
environment-variables.md and the configuration table in
docs/services/ecs.md now name devices too, as does the host volume
section and the allow-unsafe-host-volumes Javadoc.
Tests: EcsRequestShapesTest for every measured message against the
vendored model; EcsFargateEdgeCaseIntegrationTest passes unchanged.
* refactor(core): walk request shapes once, with each service's messages
Review of #5951: EcsRequestShapes walked the vendored model the same way
DynamoDbRequestShapes and SesV2RequestShapes do (a null is absent, an
unknown member is skipped, a structure's values are read as members and a
list's or a map's as elements, a boolean reads from "true" or "false" in
any case, a scalar of the wrong kind is named by its JSON token), with only
the error code and a few messages apart. That walk is now
RequestShapeCheck, next to RequestShapeModel in core.common, and each
service hands it its deserializer's wording as RequestShapeCheck.Messages:
DynamoDB's SerializationException with DECIMAL_VALUE and the base-64
message for a blob, SES v2's SerializationException with its "can not be
converted to a" wording and only strings and blobs checked, as probed, and
ECS's InvalidParameterException with no message for a list where none is
expected.
The three services' tests pass unchanged. SES v2's wording becomes
constants in SesV2Json, which its member helpers and the walk share.
|
||
|
|
6e18bb0b95 |
fix(tls): restore TLS 1.2 listener compatibility (#5953)
* fix(tls): restore TLS 1.2 listener compatibility Default the Quarkus TLS registry to TLS 1.3 and TLS 1.2 while preserving explicit legacy HTTP restrictions. Cover public-proxy handshakes, obsolete-protocol rejection and certificate reload without changing ciphers, trust or exposure. * test(tls): share certificate integration helpers |
||
|
|
d60c973865 |
fix(cloudformation): keep a rule target's dead-letter queue, retry policy, role and ECS parameters (#5958)
* fix(cloudformation): keep a rule target's dead-letter queue, retry policy, role and ECS parameters EventsCfnProvisioner built each AWS::Events::Rule target from Id, Arn, the inputs, HttpParameters, SqsParameters and BatchParameters only. A target's DeadLetterConfig and RetryPolicy were dropped, so ListTargetsByRule showed neither, delivery ran on the defaults (185 attempts over 24 hours) and an event the target could not take was logged and lost instead of reaching the queue the stack declared. RoleArn and EcsParameters, which PutTargets keeps, were dropped as well. Targets set through PutTargets already get the delivery semantics from TargetDispatcher, so the provisioner now passes the four members through, validated by putTargets as the API validates them. EcsParameters is converted to the API's shape: the resource schema spells AwsVpcConfiguration, PlacementStrategies, TagList and the placement and capacity provider items differently from the EventBridge API, which spells them awsvpcConfiguration, PlacementStrategy, Tags and in camel case; ListTargetsByRule on AWS returns the converted shape (measured). RoleArn is stored, not used for delivery, as Floci does not invoke targets under the role. Targets is resolved once, with the engine's resolveNodeOmittingNoValue, so an Fn::If choosing the whole list works, and a member, a list item or an Fn::If branch that is AWS::NoValue is left out of the call while a literal "" stays. An earlier version marked AWS::NoValue itself before resolving, with a sentinel; the engine's rule does the same without one. The four members are read against the types AWS::Events::Rule's resource schema gives them, before the rule exists, with the messages measured on CloudFormation (eu-west-1): template validation's "Property [MaximumRetryAttempts] expected type: Integer, found: Float", and the handler's "Model validation failed (#/Targets/0/EcsParameters/ EnableECSManagedTags: expected type: Boolean, found: String)" for what only the handler refuses, which waits until every target has passed template validation, as on AWS. What CloudFormation converts is converted the same way: "4" is 4, "TRUE" is true, 5 in a list of strings is "5". Reading them with convertValue alone truncated 4.5 to 4, ignored a RetryPolicy given as a string and failed on "abc" with Jackson's message. A list of strings (Subnets, SecurityGroups) takes every form that yields a list on AWS, as Lambda's list properties do since #5923 and #5949: a Ref to a CommaDelimitedList, Fn::Split and an Fn::If choosing either, also inside an EcsParameters an Fn::If chooses; a Ref to a String is refused (measured). That is why the reader walks the template as written, with the engine's omitNoValue, now public, and resolves each call it meets, instead of checking the resolved tree, where a CommaDelimitedList is already text. The check is the new CfnPropertyTypes, which also takes over LambdaCfnProvisioner's requireType and its list-of-strings reading, so template validation has one implementation for both provisioners. * test(cloudformation): read the rule's only target without List.getFirst The SDK compatibility tests compile for Java 17, which has no List.getFirst; the image build of sdk-test-java and ec2-containers failed on it. A local JDK 25 with source 17 does not check the API, so the class was compiled again with --release 17. * test(compat): wait for a stack 50 ms at a time against Floci Review of #5958: TestFixtures.awaitStackTerminal slept 500 ms between checks, so each stack, which Floci finishes in milliseconds, cost at least half a second. It now checks every 50 ms against Floci, as the integration tests' CfnStackWaits does, and keeps 500 ms against real AWS. The rule target test waits 10 seconds for a stack against Floci instead of 60, and 10 minutes against AWS, where the queues take minutes. |
||
|
|
6027872078 |
feat(codeartifact): add ListPackageVersionAssets for every format (#5962)
Lists a package version's assets with size and SHA-256 hash, for generic (from its own packageVersions record) and maven/npm/pypi/nuget (bridged to each sidecar, reusing the listPackageVersionAssetNames/fetchPackageVersionAsset primitives CopyPackageVersions already built). Confirmed live against all four sidecars with Docker-gated tests; real AWS places no format restriction on this action either. First of the six list/lifecycle actions (item 10 in the design plan). Fixes caught by Qodo's review after opening the PR, verified against the wire model and the sidecar code before applying: the endpoint was registered as GET, but real CodeArtifact's ListPackageVersionAssets is a bodyless POST with query parameters, like every other List* action in this service (the Describe*/Get* actions are the ones that use GET) - switched the controller and its Docker-gated tests to POST. Also stopped fetching and hashing every asset in a container-backed version before paginating: asset names are now paginated first, and only the page actually being returned gets fetched and hashed. Added regression tests for the validation paths (missing fields, invalid format, and namespace requirements) that had none. |
||
|
|
401f5ce2d7 |
fix(iam): name a denied S3 POST in CloudTrail (#5942)
Under IAM enforcement a denied S3 request is recorded in CloudTrail as the operation that was refused, but a denied POST on an object was not recorded at all. CreateMultipartUpload and CompleteMultipartUpload are both checked as s3:PutObject and SelectObjectContent as s3:GetObject, so the action alone could not say which operation ran, and RestoreObject had no name. A denied POST is now named from the sub-resource that chose its action: ?uploads is CreateMultipartUpload, an uploadId CompleteMultipartUpload, ?restore RestoreObject and ?select SelectObjectContent, with ?uploads ahead of an uploadId as S3Controller runs them. The S3 user guide lists all four among the object data events CloudTrail logs. A POST naming none of them still gets no name rather than a wrong one. SelectObjectContent and GetObjectAttributes were missing from the read-only events, so a trail logging only reads dropped their denials and other trails recorded them as writes. CloudTrail counts an event that changes no resource as read-only, and neither one changes the object. |
||
|
|
f0975a9f47 |
fix(iam): check iam:PassRole when Lambda or EC2 is passed a role (#5938)
Under IAM enforcement no request was checked for iam:PassRole. A user allowed only lambda:CreateFunction, or ec2:RunInstances, could give the function or the instance any role in the account, and Floci runs the function with that role and serves the instance its credentials, so the user could act with the role's permissions. A request that passes a role to Lambda or EC2 now also needs iam:PassRole on that role, as the IAM user guide requires: "To pass a role (and its permissions) to an AWS service, a user must have permissions to pass the role to the service." The check offers iam:PassedToService, the service AWS's Service Reference names for the operation, so a grant to pass a role to one service does not cover another. It covers Lambda's CreateFunction, UpdateFunctionConfiguration when it sets the role, CreateWebFunction and CreateWebFunctionRevision, and EC2's RunInstances, RequestSpotInstances, AssociateIamInstanceProfile, ReplaceIamInstanceProfileAssociation, CreateLaunchTemplate and CreateLaunchTemplateVersion, which pass the roles of the instance profile they name, and CreateFlowLogs. A Spot Instance request now takes its instance profile by name as well as by ARN, as RunInstances does, so the role checked is the one the instance gets. Launching from a launch template checks nothing, as on AWS: the EC2 user guide warns that whoever can create a template version can pass its role without iam:PassRole. The role parameters of other services are left for later changes. |
||
|
|
494a6725a1 |
feat(iam): release and exchange the delegation token (#5914)
M4a dispatched the delegation request lifecycle as far as ACCEPTED and stopped there, so no request reached FINALIZED and the credentials the whole feature exists to hand over could not be obtained at all. This is the token half: IAM SendDelegationToken and STS GetDelegatedAccessToken, the last two of the ten operations the family spans. SendDelegationToken takes a request id, answers no output shape, and moves an ACCEPTED request to FINALIZED. The reference says that "cannot be rolled back", which makes it the one transition that refuses to repeat itself: releasing twice answers ConcurrentModification, the wrong-state shape the other four writers already use. Releasing mints the token and records the instant it happened, both on the request, because the shape publishes neither and nothing else is going to hold them. Releasing is also where OnlySendByOwner is finally read. M4a stored the flag with nothing looking at it, which was right while nothing could release; SendDelegationToken is the one operation it speaks to. It "prevents any party other than the owner from calling SendDelegationToken API for this delegation request", for the case the reference spells out: the owner lacked the permission to approve, forwarded the request to a more privileged user, and still has to be the one who hands the token over. So the release is the one call on this family decided per identity rather than per account, the handler passing the caller ARN as associate and accept already do, and an approver who is not the owner answers AccessDenied 403, which the API reference publishes as a common error for every IAM operation. GetDelegatedAccessToken exchanges that token for credentials in the customer's account. The delegation period "starts when customer releases the exchange token, not when the product provider redeems it", and "all credentials obtained from the same exchange token expire at the same time", so the expiry is release plus SessionDuration whenever it is redeemed and a token can be exchanged repeatedly, each exchange buying less time than the one before. AssumedPrincipal is the identity that approved the request rather than the one that claimed it: accepting a request "records the details and the state of the identity that called this API", and "this is the identity that gets mapped to the delegated credential", which the user guide says the same way, the provider obtaining the "approver's temporary credentials". The two are the same identity until a request is forwarded for approval, which is the case OnlySendByOwner serves. PackedPolicySize is left out: the model deprecates it and states it is not populated for this operation. Two answers had to be chosen rather than read off, both forced by the error set. GetDelegatedAccessToken models exactly three errors, and none of them says "no such token", so a token nothing matches is answered as an expired one: from the caller's side the two are the same situation, and the reference's own remedy, "Request a new token and retry the operation", fits both. A token offered by an account that did not file the request answers AccessDenied 403 instead, the shape this handler already uses for a caller who may not perform the operation, because "the exchange token can only be redeemed by the product provider account that created the delegation request" is a refusal rather than an expiry. The account is checked before the window so that neither guard can hide the other, and both are tested with the other one passing. The code is ExpiredTradeInTokenException, not ExpiredTradeInToken. The model writes the Exception suffix into error.code for that shape and for RegionDisabledException while PackedPolicyTooLarge drops it, so each code is read off its own shape rather than derived from the shape's name. What the credentials carry is the request's PermissionPolicy, the policy AWS renders from the partner's registered template. No API registers a template, so nothing sets it and the session carries none, which is where M4a left PolicyTemplateArn for the same reason. The session is filed in the customer's account with no issuing key, and as a delegated session rather than an issued one. The delegation is the customer's grant, so a partner key that happened to name an IAM user must not become the session's issuer: issuingUser bounds a session by the issuer's own permissions, which would be the partner's rather than what the customer gave away. The approver is carried in a field of its own for the same reason the issuer is left empty. An issued session holds its identity in the role ARN slot, which is resolved by name, so an approver named like a role would act with that role's permissions, one named like no role would act with none, and GetCallerIdentity would answer for a role that does not exist. A delegated session instead resolves its approver from what the ARN says it is: a user's own policies and boundary, the account's access where the root approved the request, the role behind a session assumed from one, and nothing where that identity is gone. The account is the owner's either way, a request being visible only from the account that claimed it. The request's PermissionPolicy still bounds it on top wherever one exists, which is where the registered template would land. One gap this step cannot close on its own. AWS publishes the exchange token only in the ExchangeToken notification on the partner's SNS topic, and no operation on the family answers it. Floci sends no notification yet, so the token is minted onto the record and nothing hands it back over the wire. The integration test reads it from the service for that one step and drives everything either side of it over the wire. Twenty-one tests: eight on the service covering the release, the owner-only flag either way, the repeated exchange, both refusals and the window, with a clock the test owns, eight over the wire across the two accounts, one on the handler holding the session to the customer's account and to its approver, and four under IAM enforcement on what the credentials may then do: an approver allowed to read and not write, whose delegated credentials do exactly that, a request forwarded to an administrator who approved it, whose credentials write where its owner can only read, a role carrying the approver's name that lends them nothing, and a request approved by the account root. Four probes, each reverting one thing: mapping the credentials to the owner fails the forwarded case and the handler test and nothing else, anchoring the expiry at the redemption instant fails the two tests that describe it, filing the session against the partner fails the one that holds it, and dropping the owner-only guard fails the one that asks for it. SendDelegationToken joins the delegation family in ResourceArnBuilder, AWS giving it the delegation-request type, so it is authorized against the request rather than the wildcard. Routing needs nothing added since #5879 reads each service's actions from its botocore model, which names both of these, so the matrix rows in docs/services/index.md are the only counts this moves: IAM 174 to 175 and STS 7 to 8. |
||
|
|
9099cec5e8 |
fix(cloudformation): check S3 ownership rules against the resource schema (#5834)
* fix(cloudformation): check S3 ownership rules against the resource schema #5712 made AWS::S3::Bucket apply OwnershipControls, with the provisioner answering a wrong type and a rule without ObjectOwnership, and S3 answering two rules, no rule and an unknown mode with MalformedXML. Two constraints of AWS's published resource schema were still missing. A key the schema does not define was dropped unread: next to a valid rule the stack reached CREATE_COMPLETE, and a misspelt ObjectOwnership was reported as missing. A rule listed twice was refused by S3 for the rule count, not by the schema for the repeat. Both now fail the resource before the bucket is created or changed, in the provisioner's "Model validation failed (#/OwnershipControls...)" form: "extraneous key [<key>] is not permitted" on OwnershipControls and on each rule, and "array items are not unique" on Rules, compared once intrinsic functions are resolved. Every other case keeps #5712's answer: two different rules, no rule and an unknown mode still get MalformedXML, and a rule without ObjectOwnership still reports the missing key. Its type checks get tests for the shapes it did not cover. docs/services/cloudformation.md gains an S3 ownership controls section. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * fix(cloudformation): check each ownership rule before the repeat The uniqueness check ran before each rule's own checks, so a repeated rule that is malformed by itself, such as {"Rules": [{}, {}]} or two string rules, was refused as "array items are not unique" rather than for its own fault, which is the answer #5712 gives the same rule alone. The repeat is now checked once every rule passes on its own, still before S3's rule count. Tests now pin the order and the key each level allows: an extra key beside a Rules of the wrong type, ObjectOwnership on OwnershipControls, Rules on a rule, and a repeat that is not adjacent. The update test checks the error it gets. The previous commit's "Every other case keeps #5712's answer" holds from this commit on. Where the schema and S3 disagree, a missing Rules key and a mode outside the enum still get S3's MalformedXML. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): correct the S3 ownership controls section Say which key each level allows, that S3 rather than the resource schema requires ObjectOwnership, and that a repeated rule is checked once every rule passes its own checks. Name the two cases, a missing Rules and a mode outside the enum, where Floci keeps S3's answer and the schema would refuse the template itself. Describe the reason a stack reports rather than error codes it never shows, and flatten the nested list, which Python-Markdown renders as siblings at a two-space indent. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * test(cloudformation): pin the repeat check after every ownership rule A repeat ahead of a malformed rule, as in [A, A, {}], must still fail for the third rule's missing ObjectOwnership, as a single malformed rule does. Without this row, checking each rule against the earlier ones inside the rule loop passed every test. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> * docs(cloudformation): say S3 ownership rules are checked in turn The section said that what the resource schema refuses is reported first. The provisioner checks each rule in turn, so a rule without ObjectOwnership, which only S3 requires, is reported ahead of a schema fault in a later rule. Give the order the checks run in, and say that CloudFormation's reason can differ for such a rule, since the schema accepts it. Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> --------- Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com> |
||
|
|
b6bc3032f1 |
fix(lambdaweb): report init failures as AWS does (#5960)
* fix(lambdaweb): tell why a Web Function app failed to start as AWS does An app that exits at start with a status other than 0 now gets Runtime.ExitError, and an app that cannot find a module at import gets Runtime.ImportCodeError. A failed import writes the one ERROR event AWS writes in place of Node's stack. * fix(lambdaweb): read the init error type from a file so any exit status keeps its meaning * fix(lambdaweb): write the init error type where any user can * fix(lambdaweb): clear an init error type left in the runtime image |
||
|
|
916e72570e |
fix(logs): resolve trailing-colon query ARNs (#5954)
* fix(logs): resolve trailing-colon query ARNs * fix(logs): constrain trailing-colon ARN normalization |
||
|
|
678c5b82a6 |
fix(rds): require database role grants for PostgreSQL IAM login (#5945)
* fix(rds): require database role grants for PostgreSQL IAM login * fix(rds): preserve standard proxy IAM authentication * fix(rds): report PAM refusal for IAM member passwords |
||
|
|
e9154fb928 | fix(logs): require the policy type's own permission for PutAccountPolicy (#5956) | ||
|
|
a57c20943a |
feat(cloudformation): provision AWS::WAFv2::IPSet (#5950)
* feat(cloudformation): provision AWS::WAFv2::IPSet Serve AWS::WAFv2::IPSet from WafV2CfnProvisioner instead of the dispatcher stub, so stacks with IP sets no longer fail in strict mode and Web ACL rules can resolve a real IP set ARN. Name and Scope are create-only: a change replaces the set with a new name|id|scope physical id (Ref) and deletes the prior one the same way a Web ACL replacement does, tolerating a cleanup failure so the new set is still tracked. Addresses, Description and Tags update in place through UpdateIPSet; IPAddressVersion is never passed to the update, matching the real API, so a template that flips it fails address validation and reports UPDATE_FAILED. Fn::GetAtt resolves Arn and Id from the backing set, and DeleteStack removes it, tolerating a set already gone. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(cloudformation): defer IPSet replacement cleanup and honor its optional name Review follow-ups on the AWS::WAFv2::IPSet provisioner: - A renamed or re-scoped set now records the displaced one with ReplacementCleanup, so a failing delete of the prior set is reported by completeUpdate instead of being tolerated, and rollbackUpdate restores the prior set and deletes the replacement, the same contract the S3 bucket replacement follows. - IPAddressVersion is validated against IPV4/IPV6 on every provision. An in-place update never sends it to UpdateIPSet, so an unknown value would otherwise be accepted without ever reaching WAFv2. - Name is optional in the CloudFormation schema, matching what the Web ACL arm in the same provisioner already does: an omitted Name generates one on a create and reuses the existing set's name on an update. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> * fix(cloudformation): mark AWS::WAFv2::IPSet Name and Scope create-only Name and Scope are create-only in the registry schema, so without an entry in create-only-properties.json a Scope change fell to the name-based default and showed Replacement: False in the change set. A resource that reads the set's Ref or Arn was then skipped by the update and kept the ARN of the set that replacement cleanup deletes. Also share the IPV4/IPV6 rule between the provisioner and WafV2Service.validateAddresses, which repeated it, so an unknown IPAddressVersion is rejected in one place. Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> --------- Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com> |
||
|
|
06bd8c2207 |
fix(s3vectors): preserve resource configuration and serialize writes (#5892)
* fix(s3vectors): preserve resource configuration and serialize writes * fix(s3vectors): match index configuration response contracts * fix(s3vectors): stabilize legacy metadata and query validation * fix(s3vectors): use an injectable clock for resource timestamps |
||
|
|
7dc514b52f |
feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes (#5748)
* feat(emr): ListReleaseLabels, DescribeReleaseLabel and ListSupportedInstanceTypes None was served, so Terraform's aws_emr_release_labels and aws_emr_supported_instance_types data sources failed against Floci. A curated catalogue of EMR releases (emr-7.5.0, Floci's default, and emr-7.4.0, emr-6.15.0, emr-6.14.0 and emr-5.36.2) carries each release's applications and versions from the EMR Release Guide and its recent Amazon Linux releases, with common instance types and their EC2 sizes. The three actions filter and page it as the API documents, and answer InvalidRequestException for an unknown release, a bad token or an out-of-range MaxResults. A configured default release outside the catalogue is still listed. Closes #5734 * fix(emr): report EMR architecture values and match application versions without regard to case ListSupportedInstanceTypes returned the EC2 spellings x86_64 and arm64; the EMR model gives X86_64 and AARCH64 for Architecture. The ListReleaseLabels application filter matched the name without regard to case but not the version, so phoenix@4.14.3-hbase-1.4 missed emr-5.36.2. * refactor(emr): page the release catalogue with the shared Pagination ListReleaseLabels and ListSupportedInstanceTypes now page through core.common.Pagination, with the filters in the token namespace so a token replayed with other filters, or altered, is refused. DescribeReleaseLabel answers every application, as AWS reserves its MaxResults and NextToken. The EMR integration tests share one request helper. |
||
|
|
e3e06a1122 |
feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists (#5772)
* feat(iot): add RegisterCertificateWithoutCA and the V2 principal lists RegisterCertificateWithoutCA registers a certificate from any issuer in SNI_ONLY mode. ListThingPrincipalsV2 and ListPrincipalThingsV2 page the thing principal attachments and report each one as NON_EXCLUSIVE_THING, because Floci does not model exclusive attachment. * fix(iot): validate the principal and page size of the V2 principal lists ListPrincipalThingsV2 requires a principal, and both V2 lists accept 1 to 250 results per page, as on AWS. Tests cover these checks and the RegisterCertificateWithoutCA rejection of a missing PEM and an unknown status. * fix(iot): refuse a device certificate registered in more than one account AWS selects the account from the server name, which Floci does not do yet. The MQTT TLS listener therefore refuses a certificate that more than one account registers, instead of admitting it under the lowest account ID. RegisterCertificateWithoutCA drops the cached location, and the lookup runs under compute, so a connect cannot cache a stale account. * fix(iot): make the RegisterCertificateWithoutCA duplicate check atomic A lock holds the duplicate check and the store write together, as CreateAuthorizer does, so two identical registrations at the same moment store one certificate and the other caller gets the 409. The 409 carries resourceId and resourceArn, as AWS lists for this call. |
||
|
|
4204ee2ea5 |
fix(bedrock-runtime): return errors when upstream error bodies stall (#5527)
* fix(bedrock-runtime): cancel abandoned calls and bound stalled error bodies Close the upstream request when the caller disconnects, including a stream stalled between tokens, and read streaming error bodies under a one-second deadline so a backend that stalls mid-error still returns ModelErrorException. Warnings keep the upstream status but omit the response body. * fix(bedrock-runtime): bound stalled error bodies on non-streaming converse Non-streaming Converse read the upstream body with ofString, so an error status followed by a stalled body hung until the caller gave up: the request timeout stops at the headers. Both Converse paths now share one send step that reads error bodies under the collection deadline. The deadline is configurable (error-body-timeout-millis, default 1000) so the tests run against a short one, and the raw-socket upstream fixture is shared between the cancellation and logging tests. * fix(bedrock-runtime): declare the error-body timeout in application.yml * fix(bedrock-runtime): schedule the error-body cut instead of polling for it The cancellation poll checked the deadline every 100 ms, so a stalled error body was cut 100 to 200 ms after it started. A timer armed when the error status arrives cuts it exactly, and the poll goes back to watching only for a caller disconnect. The test deadline drops to 10 ms. * fix(bedrock-runtime): validate the error-body timeout and tighten its tests Refuse a non-positive error-body-timeout-millis at startup, list the setting in the configuration table, and restore the non-streaming "Proxy request interrupted." wording. The complete-error-body tests now send headers and body in one write through StallingUpstream, so the 10 ms test deadline cannot race them, and the 8 KiB test asserts that the read ended at the cap rather than at the deadline. A shared ConverseRequests helper replaces the three hand-built Converse requests. |
||
|
|
1f4a46804c |
fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string (#5949)
* fix(cloudformation): refuse a list property that a parameter or an intrinsic makes a string The follow-up asked on #5923. The engine kept parameter values but not their types, so the Lambda provisioner's list readers could not tell a Ref to a CommaDelimitedList parameter, which the engine resolves to the comma-joined text, from a Ref to a String parameter: both read as lists, where CloudFormation refuses the second. Measured on CloudFormation (eu-west-1, 2026-10-18), Layers and Architectures of AWS::Lambda::Function: - a Ref to a CommaDelimitedList, AWS::SSM::Parameter::Value<List<String>> or AWS::SSM::Parameter::Value<CommaDelimitedList> parameter, Fn::Split, an Fn::If choosing a Ref to a list, and Ref AWS::NotificationARNs are lists; - a Ref to a String or Number parameter, Ref AWS::Region, Fn::Select, Fn::Join, Fn::Sub and an Fn::If choosing a literal string fail the template's validation with "Property [Architectures] expected type: JSONArray, found: String"; - a resource's Ref and Fn::GetAtt fail only when the resource is provisioned, with "Properties validation failed for resource Fn with message: #/Architectures: expected type: JSONArray, found: String". CloudFormationTemplateEngine now takes the declared parameter types, which executeTemplate reads from the template (stacks, change sets, stack sets and nested stacks all deploy through it), and yieldsString tells the forms of the second group. The list readers refuse such an intrinsic with the validation message, as they refuse a literal of the wrong type. The third group is left as it was: the engine cannot tell a list-valued attribute from a string one before provisioning, and a resource's own message format is not modelled. parameterType gives a declaration's Type, String when it is left out, for the new reader and for GetTemplateSummary, which had its own copy. Tests: CloudFormationTemplateEngineTest for yieldsString over every measured form; CloudFormationLambdaObjectPropertyIntegrationTest for each refused form, an Fn::If choosing a list, and a nested stack whose own parameter types decide; CloudFormationLambdaObjectPropertyTest in sdk-test-java for a String parameter through the SDK. The integration and SDK tests fail on main. * fix(cloudformation): take Fn::Base64 as a string where a list is expected Review of #5949 (Qodo). Measured on CloudFormation (eu-west-1, 2026-10-18): Architectures: {"Fn::Base64": "x86_64"} fails validation with "Property [Architectures] expected type: JSONArray, found: String", like Fn::Sub. yieldsString left it out, so the Lambda reader split the encoded text into a list and the function got an invalid architecture instead. Tests: CloudFormationTemplateEngineTest and CloudFormationLambdaObjectPropertyIntegrationTest gain the case; both fail on the previous head. |