A bucket's lifecycle configuration was stored and returned but never
evaluated. A background sweep now applies its expiration actions:
- Expiration (Days, Date) deletes the current version of a matching
object, or adds a delete marker in a versioning-enabled bucket. Day
counts run from the last-modified time and round up to the next
midnight UTC, as on S3.
- ExpiredObjectDeleteMarker, and a Days or Date expiration once the
marker is old enough, remove a delete marker with no other versions.
- NoncurrentVersionExpiration (NoncurrentDays, NewerNoncurrentVersions)
permanently deletes noncurrent versions, counting from when the next
newer version was written.
- AbortIncompleteMultipartUpload (DaysAfterInitiation) aborts uploads
under a prefix-only filter.
Filters are Prefix, Tag, ObjectSizeGreaterThan, ObjectSizeLessThan, an
And of them, or the older rule-level Prefix. Disabled rules are skipped,
versions under Object Lock retention or a legal hold are never deleted,
and each bucket is swept in its owning account. Lifecycle deletions are
notified as s3:LifecycleExpiration:* rather than s3:ObjectRemoved:*,
with S3 itself as the requester, and their EventBridge reason is
"Lifecycle Expiration".
A rule S3 would have refused on put, such as Days 0, a size bound that
is not a number or a Tag without a Value, is skipped as a whole, so a
bad value never widens what a rule deletes. A body that is not one
well-formed LifecycleConfiguration document has no rules.
Each key is planned from one pass over its account's objects, then read
again by its known store keys and applied under the bucket monitor.
Lifecycle configuration changes and tagging now change under that
monitor too, and a multipart upload is aborted only
while its bucket and the rules are still the ones the sweep started on.
Versions written in the same millisecond keep the order they were
written in, for ListObjectVersions as well as for lifecycle.
PutObject, GetObject and HeadObject on a current version that an
Expiration rule matches return x-amz-expiration with the expiry date
and the URL-encoded rule id.
The sweep runs every 60 seconds by default, configured with
floci.services.s3.lifecycle-sweep-enabled and
floci.services.s3.lifecycle-sweep-interval-seconds. Transition actions
are still not applied.
Closes#5137
The groups map is a StorageBackedMap once storage is initialised. Its
iterator snapshots keys and reads each value lazily, so a group deleted
between the two yields a null value. describeAutoScalingGroups returned
that null (the reconciler then NPE'd in reconcile and again in its catch
block), and describeAutoScalingInstances, SetInstanceHealth and
TerminateInstanceInAutoScalingGroup NPE'd outright (HTTP 500).
Skip null values at those iteration sites. SetInstanceHealth and
TerminateInstanceInAutoScalingGroup now re-read and update the group
under its per-group lock, as saveAutoScalingGroupIfPresent does, instead
of an unlocked find/mutate/put that could race the reconciler or
resurrect a just-deleted group.
* feat(lambdaweb): CloudFormation types for Lambda Web Functions
AWS::Lambda::WebFunction, AWS::Lambda::WebFunctionRevision and
AWS::Lambda::WebFunctionEndpoint provision through the resource
registry. Ref of each is its ARN. Every property of a revision is
createOnly in the registry schema, so a changed revision mints a new one
and the displaced revision is deleted once the update commits. An
endpoint keeps its identity while its function, name, type and regions
stay the same. Fn::GetAtt on RegionalEndpoints is recorded as a gap.
Part of #5699
* fix(lambdaweb): compare a revision against the function's default log group
revisionMatches filled a request without a log group with the existing
revision's log group, so a template that dropped a custom log group kept
the old revision. The default is the function's log group, as when a
revision is created. replaceTags returns the updated function.
* fix(cloudformation): put a Lambda Web function or endpoint back after a failed stack update
A function's tags and an endpoint's mutable configuration are changed in
place on update. The provisioner now snapshots them before the change and
restores them from rollbackUpdate, as the other in-place provisioners do.
The function attributes after a tag update come from the updated
function, so UpdatedAt moves with the tag change.
* test(cloudformation): roll a Lambda Web stack update back after a failed revision
A revision that fails to create after the endpoint moved to a replaced
revision rolls the stack back. The endpoint returns to the kept revision
and the replacement is deleted. The doc page says that a CloudFormation
endpoint is always Disabled with RevisionWeights, since the schema has no
AutoDeploymentMode, and that a failed update puts in-place changes back.
* fix(cloudformation): refuse AutoDeploymentMode on a Lambda Web endpoint
The registry schema has no AutoDeploymentMode property and AWS fails a
template that sets it at validation. An endpoint from CloudFormation is
always Disabled and routes by RevisionWeights. Floci passed the property
through to the service, which accepted LatestRevision.
* refactor(lambdaweb): share the create and tag steps between the API and CloudFormation paths
createFunction and createFunctionShell both check the name and refuse a
duplicate under the function's lock. tagResource and replaceTags both
check the tags, lock, write, stamp and persist. Each pair now calls one
private helper, so the two paths cannot drift.
getAlternateContact and deleteAlternateContact each built the same
ResourceNotFoundException. Move it into a notFound() helper next to
validation() so the two stay in step.
Follow-up to #5560.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
A stack update that changed an AWS::SSM::Parameter and then failed on a
later resource ended in UPDATE_ROLLBACK_FAILED with the new value left
in place: the provisioner had no rollback.
An update that keeps the name now keeps the parameter's value, settings
and managed tags before it writes, and the rollback writes them back as
a new version unless the parameter still holds them. A changed Name
creates the replacement and leaves the displaced parameter to the
shared ReplacementCleanup record: a committed rename deletes it unless
UpdateReplacePolicy is Retain, a rollback deletes the replacement, and
ContinueUpdateRollback retries a restore or delete that failed. A
snapshot is spent when the update commits, and one a skipped rollback
left is dropped when the next update starts.
A create or replacement is one PutParameter without overwrite that
carries the tags, as AWS's handler sends it, so a name held outside the
stack fails the resource instead of being overwritten or adopted; a
dispatcher stub's id is taken over by a create. As AWS's handler checks
that the parameter exists before an update writes it, a parameter
deleted outside the stack fails the update in place, and a rollback
that finds it gone, with ParameterNotFound. A delete treats
ParameterNotFound as already deleted.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): require a value for every declared parameter
CreateStack, UpdateStack and CreateChangeSet accepted a template that
declares a parameter with no Default when the request gave it no value.
The stack deployed with the parameter unset: a condition compared it as
an empty string, and a Ref resolved to the parameter's own name.
Such a request now fails with ValidationError "Parameters: [Env] must
have values", naming every such parameter in declaration order, before
the SAM transform and the dependency preflight run and before any stack
state changes. An empty value counts as a value. An update does not
carry values over, so it needs a value or UsePreviousValue, which keeps
the deployed one, for each parameter without a Default.
UsePreviousValue on a parameter with no deployed value passes none,
rather than an empty string. A request its stack refuses outright, an
update of a stack that is missing or cannot be updated or a create over
a name in use, still gets that refusal. A parameter that an AWS::Include
defines, which only execution merges, is not checked up front.
The same check refuses CreateStackSet and UpdateStackSet, before the
stack set changes or an operation is recorded. UpdateStackSet resolves
UsePreviousValue against the previous template's Defaults too, since a
stack set keeps only the values it was given. A nested stack resource
whose Parameters leave a child parameter without a value fails, before
the child is created or changed. Those Parameters now resolve as a
property value: an Fn::If may choose the whole map, and an AWS::NoValue
value passes nothing.
A CreateStackInstances whose targets cannot be resolved, or whose
change set is refused, now ends its operation FAILED. Left RUNNING, it
refused every later operation on the stack set.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): evaluate conditions through the template engine
Conditions resolved only a bare Ref, and only to a parameter, the
account or the region. Every function other than that Ref compared as
an empty string inside Fn::Equals: Fn::FindInMap, a Ref to
AWS::StackName or AWS::StackId, Fn::Join. A condition on a mapped value
or on the stack's own name was decided wrongly, so the wrong resources,
or none, were created.
The operands now resolve through the template engine, with the
template's Mappings and the stack's name and id. The change-set preview
and the dependency preflight evaluate against the stack too: the live
one an update targets, or the name a create takes, whose id does not
exist yet. An operand the engine cannot resolve compares as an empty
string, as every function did before, so a template that evaluated then
still does. A declared parameter that a stack stored by an older Floci
lacks still compares as an empty string, and AWS::NotificationARNs is
the empty list, now in properties and outputs too.
CloudFormation does not allow Fn::ImportValue in a condition, so a
template being deployed with one there is refused with "Template error:
Cannot use Fn::ImportValue in Conditions.", also in an operand that
evaluation never reaches. A SAM template's change set, or its stack,
fails with that reason instead. A stored template compares the import
as an empty string, so it never blocks an update that supplies a new
template; UsePreviousTemplate checks the stored one as it would a new
one.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* fix(cloudformation): check a create's dependencies with its stack id
A create's dependency preflight evaluated AWS::StackId as an empty
string while the execution used the stack's id, so a dependency on a
resource whose condition reads the stack id could pass the preflight
and then fail the deploy, or the other way round. A create over a name
in use was checked against the stack holding the name instead, and
could get a dependency error rather than AlreadyExistsException.
createChangeSet now allocates the new stack's id before the preflight
and creates the stack with it, so the preflight, the change-set preview
and the execution evaluate the same id. An update, or a create that
attaches to a REVIEW_IN_PROGRESS placeholder, is checked against that
stack as before, and a create over a name in use is checked as the new
stack it asks for.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): place the parameter check before dependency checks
The parameter section said template errors such as a dependency cycle
come first, but createChangeSet checks the parameter values before the
dependency checks, which evaluate conditions that read those values.
Say so, and keep the stack's own refusal ahead of both.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): order the stack's refusal after dependency errors
The previous commit said the stack's own refusal comes ahead of both
the parameter check and the dependency checks. It comes ahead of the
parameter check only: a request its stack refuses still gets a
template's dependency error first, as on main. Say so, and re-wrap the
conditions paragraph.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* docs(cloudformation): say parameter values are checked before dependency errors
The parameter section still read as if a template's dependency errors
came first. createChangeSet checks the parameter values before the
dependency checks, which evaluate conditions that read the values, so
a template with a cycle and a missing value gets the parameter error.
Say that, and that a stack's own refusal replaces the parameter error
but still follows a dependency error.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* test(cloudformation): pin a missing value ahead of a dependency cycle
A template with both a DependsOn cycle and a parameter without a value
gets "Parameters: [Env] must have values" and creates no stack.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(cloudformation): name the tolerated parse failures ignored
requireParameterValues and parametersWithDefaults return when the
template does not parse, as intended: there is nothing to check or to
add, and the preflight and the execution report the parse error. Name
the caught exception ignored and say why, as AGENTS.md asks.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* refactor(cloudformation): say only execution reports a parse failure
The comment on the ignored parse failure in requireParameterValues
said the preflight reports it too. The dependency preflight skips a
template that does not parse; only executing the change set reports
the error.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
---------
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
Startup restore runs from @PostConstruct and shutdown from a lifecycle
hook, both outside any request, so an account-aware keys() sees only
the default account. Every other account's EC2 state was skipped:
- after a restart its VPCs and subnets were not re-declared, so paths
that do not declare lazily, such as an EKS node joining its VPC,
found no network; reconcileOrphans also judged its VPC networks
against the default account only;
- its instances' private addresses were not re-reserved and their
IMDS registrations were not restored, so IMDS stopped answering;
- shutdown, and a state reset, which wipes every account, did not stop
its running instances.
Restore and shutdown now walk every account's VPCs, subnets and
instances. Restore runs each instance as its own account, so the
security groups and prefix lists it resolves come from that account, in
the instance's own region, and both paths write to the owning partition.
VPCs are declared default account first, then in account and key order,
because overlapping CIDRs go to whichever VPC is declared first. The
port-forward persister, which also runs on container executor threads
with no request, writes to the account that holds the instance instead
of the current one, and writes nothing when no account holds it any more
(terminated meanwhile). A pre-multi-account key is migrated once, or
dropped when a scoped copy already exists.
Co-authored-by: Robin Baeckman <27041454+RobinBaeckman@users.noreply.github.com>
* feat(rds): EnableHttpEndpoint, DisableHttpEndpoint and HttpEndpointEnabled
EnableHttpEndpoint and DisableHttpEndpoint answered UnsupportedOperation
and DBCluster carried no HttpEndpointEnabled, so Terraform's
enable_http_endpoint and CDK's enableDataApi never read back what they
set.
Clusters now record the flag and report it. The two actions take the
cluster's ARN and raise ResourceNotFoundFault and
InvalidResourceStateFault as the model lists them; CreateDBCluster,
ModifyDBCluster and the AWS::RDS::DBCluster EnableHttpEndpoint property
set it too. Turning it on is refused for engines other than Aurora
PostgreSQL and Aurora MySQL. The Data API itself does not check the
flag, so existing callers keep working.
Closes#5732
* refactor(rds): one cluster ARN parser, and stricter Data API inputs
clusterForResourceArn repeated the ARN parsing, cluster: prefix and
account and Region check of clusterIdentifierFromArnOrName; both now
call clusterIdFromArn, each raising the error its API documents.
The Data API engine check takes aurora-postgresql, aurora-mysql and the
older aurora name exactly instead of any name starting with aurora, and
the AWS::RDS::DBCluster EnableHttpEndpoint property accepts true or
false only, so a malformed value fails instead of turning the endpoint
off.
* fix(rds): take only aurora-mysql and aurora-postgresql for the Data API
The API reference lists those two engines, and new clusters cannot carry
the bare aurora name, so the check no longer accepts it.
* feat(route53resolver): implement ListResolverEndpointIpAddresses
The Terraform provider lists an endpoint's IP addresses right after
CreateResolverEndpoint, so the missing operation (UnknownOperationException)
failed every aws_route53_resolver_endpoint create.
Built from the IpAddresses recorded at create time: one ATTACHED entry per
request with a deterministic rni- IpId. Unknown endpoint ids raise
ResourceNotFoundException. Not paginated, like the sibling List operations.
* docs(route53resolver): update service matrix operation count
* refactor(route53resolver): add endpoint IP addresses with a single addAll
* fix(route53resolver): distinct IpIds for repeated entries; fail on missing IP record
ListResolverEndpointIpAddresses hashed only the endpoint id and the entry,
so two identical entries (two addresses in one subnet, both left for AWS to
pick, which IpAddressesRequest allows) shared an IpId. Include the entry's
position in the recorded list, which is normalised once at create and so
stable across reads.
An endpoint whose recorded IP requests are missing returned an empty list
beside a nonzero IpAddressCount. Throw the modeled
InternalServiceErrorException instead.
* test(route53resolver): import List/HashSet instead of fully qualifying (checkstyle NoFqcn)
* fix(route53resolver): return InternalServiceErrorException as HTTP 400
The Route 53 Resolver model gives InternalServiceErrorException no
httpStatusCode, so clients expect the awsJson default of 400, as with
every other Resolver error.
A RunInstances or CreateFleet BlockDeviceMapping with NoDevice set removes
its device regardless of the other values it carries. The root volume type
resolution and the VolumeType validation read Ebs on such entries, so a
request that removed a template's gp3 root still got gp3, and a removed
mapping naming an unknown VolumeType failed with InvalidParameterValue.
Drop NoDevice entries before both, on the request-only and template-merged
paths alike.
UpdateGuardrail set the name, description and blocked messaging on the
stored DRAFT before resolving kmsKeyId. getGuardrail returns the live
stored object, so a request rejected for an unusable key still left those
fields applied, while updatedAt, the policies and kmsKeyArn kept their old
values.
The key is now resolved into a local before any setter runs, the same
validate-before-mutate order #2501 gave UpdateMemory. It stays after the
guardrail lookup, so an unknown guardrail is still reported as
ResourceNotFoundException first.
Fixes#5654
* fix(ec2): resolve a NAT gateway's network interface and mark its Elastic IP associated
CreateNatGateway gave each gateway address a networkInterfaceId of
"eni-" + randomHex(17), but nothing else knew about that interface:
DescribeNetworkInterfaces had no NAT arm, so the id DescribeNatGateways
publishes (aws_nat_gateway.network_interface_id) answered
InvalidNetworkInterfaceID.NotFound. The Elastic IP the gateway took was
also never marked associated, so DescribeAddresses showed a held
allocation as free.
The interface id is now derived from the gateway id, as endpoint ENIs
are, and DescribeNetworkInterfaces reports one requester-managed
nat_gateway interface per gateway address, built from the stored
address so the two reads cannot disagree. CreateNatGateway records the
association, interface and private address on the allocation (no
instanceId), and DeleteNatGateway clears them if the association is
still the gateway's.
* fix(ec2): refuse a NAT gateway on an occupied Elastic IP, keep its association, scope its ENI lookup to the account
CreateNatGateway rejects an allocation already held by an instance or another gateway
(Resource.AlreadyAssociated) under the lock that writes the association. DisassociateAddress
rejects an association owned by a NAT gateway. The NAT arm of DescribeNetworkInterfaces reads
gateways and subnets for the account asked about.
* fix(ec2): lock NAT gateway EIP release, treat a legacy gateway's EIP as held
DeleteNatGateway releases the Elastic IP under the lock CreateNatGateway
takes. CreateNatGateway also refuses an allocation any live gateway
references, covering gateways persisted before Address records were
marked. The CloudFormation networking test gives the replacement NAT
gateway a new EIP: replacement creates before it deletes, and AWS's
CreateNatGateway refuses an EIP still associated elsewhere.
* fix(ec2): AssociateAddress refuses a NAT gateway's Elastic IP; legacy gateways hold theirs
AssociateAddress checks for a gateway holding the allocation and writes
under the allocation lock CreateNatGateway and DeleteNatGateway take, so
an instance cannot take over an address the gateway still claims. The
gateway scan behind that check, and CreateNatGateway's, now includes
unmigrated pre-account-isolation gateway records for the default
account, never another account's.
* fix(ec2): scope NAT gateway ownership checks to the caller's records
callerNatGateways scanned every account's gateways before filtering. Read
the caller's own records, plus unprefixed legacy records only for the
default account.
* fix(ec2): create a NAT gateway failed on an Elastic IP already in use
CreateNatGateway with an allocation another gateway or an instance holds
no longer answers 400. As the NatGateway shape documents, the gateway is
created in state failed with FailureCode Resource.AlreadyAssociated and
FailureMessage "Elastic IP address <alloc> is already associated". It
gets no interface, claims nothing, and does not count as a holder.
AWS::EC2::NatGateway fails the resource and deletes the failed gateway.
ReleaseAddress on an allocation a NAT gateway holds, legacy gateways
included, answers InvalidIPAddress.InUse. DisassociateAddress and
ReleaseAddress run under privateIpAllocationLock. The NAT interface lookup
reads legacy unprefixed gateways and subnets for the default account. It
also loads the interface's tags, and DeleteNatGateway deletes them.
endpointEniId and natEniId become one helper, eniIdFromSeed.
* test(cloudformation): say why the replacement template keeps NatEip
The replacement template keeps NatEip for two reasons. On AWS a gateway
given an Elastic IP the displaced gateway still holds is created failed.
And Floci update cleanup deletes removed resources before the old copies
of replaced ones, so dropping the EIP while replacing its gateway would
try to release it while it is still held.
* fix(ec2): a failed NAT gateway does not pin its subnet or VPC
#5503 made DeleteSubnet and DeleteVpc refuse while a NAT gateway that is
not deleted sits in the subnet. A failed gateway was never created and
holds no interface, so it no longer counts, matching the Elastic IP
holder check.
* feat(redshift-serverless): add release track, managed workgroup and reservation reads
Add GetTrack, ListTracks, ListManagedWorkgroups, ListReservations,
ListReservationOfferings, GetReservation, GetReservationOffering and
CreateReservation so SDK, CLI and IaC clients no longer get an unknown
operation error. Floci models no zero-ETL managed workgroups and sells no
reservations, so the lists are empty and the reservation lookups answer
ResourceNotFoundException. The two release tracks are current and trailing.
Required members, patterns and lengths come from the AWS model through
RedshiftServerlessRequestShapes; only the track names, which the model leaves
unenumerated, are checked by hand.
* refactor(redshift-serverless): reuse Pagination.paginate and remove unused admin handle method
Rely on Pagination.paginate for maxResults and nextToken validation in listTracks and listWithoutItems, matching the other Redshift Serverless lists. Remove the unused handle method and its duplicate unknown-operation response in RedshiftServerlessAdminJsonHandler.
* fix(ecs): apply EFS access point PosixUser and CreationInfo to task volumes
An ECS task mounting EFS through an access point ignored the access
point's own settings, so the volume stayed root:root 0755 and a non-root
task could not write to it. Resolve the access point from EfsService and
initialise the volume root from RootDirectory.CreationInfo, and run the
container as PosixUser (uid:gid plus secondary gids). Each part falls
back independently to floci.storage.efs.*. An access point on another
file system, or with incomplete CreationInfo/PosixUser, rejects the launch.
Owner ids use long so unsigned 32-bit POSIX ids are not narrowed.
Closes#5480
* fix(ecs): attach PosixUser groups as supplementary groups instead of replacing container user
Preserve the container definition or image user when mounting an EFS access point, and attach the PosixUser gid and secondary gids as supplementary groups instead of overriding the container user.
Also stabilize ElbV2PreserveHostHeaderIntegrationTest socket connection to avoid public DNS resolution timeouts in CI.
* fix(ecs): validate CreationInfo permissions and filter null secondary GIDs
* revert(elbv2): revert listener test wait and loopback address change
* fix(ecs): share octal permissions check with ContainerLifecycleManager
* fix(cloudformation): clean up, roll back and delete AWS::EC2::VPC like the other EC2 types
A CidrBlock change, or a tenancy change other than dedicated to default,
replaces the VPC, but the provisioner never recorded the displaced one and had
no delete arm, so the old VPC was left behind; in-place Tags, EnableDnsSupport
and EnableDnsHostnames changes were not snapshotted, so a later failing
resource left the VPC changed and reported rollback as not implemented.
Ec2VpcCfnProvisioner now follows Ec2NetworkCfnProvisioner: ReplacementCleanup
records the displaced VPC and deletes it after the update commits or restores
it on rollback; a prior-state snapshot restores DNS attributes, tags and a
dedicated-to-default tenancy change on rollback, eagerly when provision itself
fails; and a delete arm through CfnDeletes.safeDelete removes the VPC on stack
teardown, tolerating only InvalidVpcID.NotFound so stack-external dependents
fail the delete with DependencyViolation, as on AWS.
* refactor(cloudformation): use the shared CfnRollback.guarded in the VPC provisioner
* fix(ec2): count instances and NAT gateways as subnet and VPC dependents
DeleteSubnet and DeleteVpc checked subnets, security groups, route tables,
ACLs, gateways and endpoints but not the instances and NAT gateways living in
a subnet, so a stack teardown could remove a subnet and its VPC out from under
an instance launched into it out of band. Both now fail with
DependencyViolation while an instance that is not terminated (shutting-down
still holds its interface) or a NAT gateway that is not deleted sits in the
subnet, as on AWS. The rollback integration test also pins Boom after the VPC
with DependsOn so the scenario cannot pass by ordering alone.
* fix(cloudformation): keep the VPC and subnet rollback snapshot until the restore succeeds
rollbackUpdate removed the in-place snapshot before restoring; a restore that
threw left the resource persisted as UPDATE_FAILED with no prior state for a
ContinueUpdateRollback retry. Ec2VpcCfnProvisioner and the pre-existing
Ec2NetworkCfnProvisioner now restore first and remove after, as the AgentCore
provisioner already did. The describeTags loop shared by Ec2Tags.reconcile and
the VPC snapshot moves to Ec2Tags.current.
* fix(ec2): count standalone network interfaces and interface endpoints as subnet dependents
A subnet is pinned by any network interface in it, not only the ones an
instance or NAT gateway owns: a standalone interface from
CreateNetworkInterface and an interface or Gateway Load Balancer endpoint
keep DeleteSubnet at DependencyViolation on AWS too. The endpoint test that
deleted a subnet out from under a live endpoint relied on that state being
reachable; it now asserts the refusal and that the published interface ids
are unchanged.
* fix(cloudformation): wait for terminated on instance delete and resolve VPC properties before creating
With real containers an instance is still shutting-down when the stack's
instance delete returns, so the subnet delete that follows was refused by the
new resident check and the stack ended DELETE_FAILED. The instance provisioner
now polls until the instance is terminated or gone, as CloudFormation does.
The VPC provisioner created the VPC before EnableDnsSupport, EnableDnsHostnames
and Tags were resolved, so a resolution failure left it untracked; the resolves
now run first, as the subnet provisioner does. Ec2Tags.current drops reserved
aws: keys so a rollback snapshot never tries to write one, and the replacement
integration test waits in the stack's own region.
* fix(msk): publish a host listener when Floci runs in a container
* fix(msk): list both listeners in GetBootstrapBrokers when a bootstrap hostname is set
With floci.services.msk.bootstrap-hostname set, GetBootstrapBrokers
returned only the host listener's address, <hostname>:<port>. Inside a
sibling container that is usually the container itself, so the setting
broke broker discovery for containers on the Docker network, the case the
Docker-network default exists to keep working.
It now returns both listeners, <container-name>:9092,<hostname>:<port>.
Kafka clients try bootstrap entries until one connects, and the broker then
advertises the address of the listener they came in on, so host and
sibling-container clients can each discover the broker through the MSK
API. The broker's listeners and advertised addresses are unchanged; only
the API response is.
The container name is used rather than its IP because it fails fast on the
host, where it does not resolve, while an IP the host cannot route to waits
for a connect timeout. It goes first for callers that read only the first
entry, such as isReady's fallback after a restart.
A blank bootstrap hostname is now treated as unset in both places that read
it. Before, the advertised address fell back to localhost while the
bootstrap response still switched to the host form.
* fix(msk): resolve broker readiness from the container id, not an in-memory map
* fix(msk): release the Kafka host port when setup fails before the container starts
* docs(msk): document the bootstrap-hostname setting
* fix(msk): probe broker readiness on the broker's own Docker network
* test: import LinkedHashMap instead of qualifying it inline
* fix(msk): try the next Kafka host port when Docker reports it in use
When Floci runs in a container, PortAllocator.allocate() probes ports in
Floci's own network namespace, so it cannot see a host process that
already holds one, such as a local Kafka or a second Floci. Docker then
refuses the bind, and startContainer released the port and failed the
cluster even though the rest of the kafka-host-port range was free.
Before the host listener, container mode published no Kafka port, so
this is new with it.
startContainer now goes through PortAllocator.allocateAndStart, as the
ECR registry and EC2 instances do: a port Docker reports as in use moves
on to the next one, and the Redpanda listener args and container spec
are rebuilt for each candidate. allocateAndStart also releases the port
on any other failure before the container runs, volume setup included,
so it replaces the hand-written try.
* feat(cloudformation): provision SES email identities
* fix(cloudformation): retry pending SES update rollback
* fix(cloudformation): keep recovered SES resource complete
* fix(cloudformation): retain recovered SES state on failed replacement
* test(cloudformation): use shared waiter for SES DKIM verification
* feat(redshift-serverless): validate requests against the AWS model constraints
Generate the input constraints (required members, length, pattern, enum,
number range, list size) from botocore's Redshift Serverless model with
tools/aws/regen_redshift_serverless_shapes.py and vendor them under
src/main/resources/aws, like the DynamoDB request shapes. A new
RedshiftServerlessRequestShapes check runs before dispatch and answers a
ValidationException. Pagination members are left to the services, which keep
reporting InvalidPaginationException.
Move the request parsing and error helpers that the JSON handler, the usage
limit service and the service each carried a copy of into ServerlessSupport,
so the resource families that follow share one implementation.
* fix(redshift-serverless): address review findings on request validation
- Match a model pattern against the whole value, so an unanchored pattern such
as the account id no longer accepts a value that merely contains a match.
- Count string lengths in Unicode code points, so a tag of 200 supplementary
characters is not rejected for exceeding 256 UTF-16 units.
- Validate only the actions the handler implements, so a modeled but
unsupported action keeps answering UnknownOperationException.
- Read every string member through ServerlessSupport.text and reject a tag key
or value that is not a string, so a numeric nextToken or tag member is a
ValidationException instead of being treated as absent or coerced.
- Regenerate the vendored shapes from botocore 1.43.113, the version
tools/aws/requirements.txt pins.
- Cover the rejected-request case with a state check, and add the pattern, code
point, page token and tag regressions.
* refactor(redshift-serverless): use VendoredResources, ServerlessSupport.notFound and update docs
DeleteRoute removed the local route CreateRouteTable seeds for the VPC CIDR
and reported success. Since CreateRoute answers RouteAlreadyExists for that
destination, the route table was left without intra-VPC routing and with no
way to put the route back. DeleteRoute also reported success for a
destination the table does not hold, hiding caller mistakes.
Reject the seeded local route with InvalidParameterValue and report an
unknown destination with InvalidRoute.NotFound, matching AWS. The route is
identified by its CreateRouteTable origin, so a route repointed by
ReplaceRoute stays undeletable while repointed.
The CloudFormation route restore path now tolerates the already-gone
InvalidRoute.NotFound case through CfnDeletes.safeDelete.
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
* feat(stepfunctions): emit execution status change events to EventBridge
STANDARD executions now publish "Step Functions Execution Status Change"
events (source aws.states) to the default EventBridge bus on RUNNING,
SUCCEEDED, FAILED, TIMED_OUT and ABORTED, so rules matching aws.states
fire as they do on AWS. EXPRESS executions emit nothing, as on AWS.
StepFunctionsEventPublisher follows the EcsEventPublisher pattern.
RUNNING is published when StartExecution creates the execution, terminal
statuses from the worker's completion callback, and ABORTED from
StopExecution only, so a stopped execution emits exactly one ABORTED.
An idempotent StartExecution and the startup sweep of executions
abandoned by a restart emit nothing.
* fix(stepfunctions): match the documented execution status change event
Address review feedback on the aws.states events:
- Always send stateMachineVersionArn and stateMachineAliasArn, null
when unused, as AWS's documented events do.
- Report redrive status as the documented examples do: FAILED and
TIMED_OUT are REDRIVABLE with "Execution is <status> and is
redrivable"; RUNNING, SUCCEEDED and ABORTED are NOT_REDRIVABLE with
"Execution is <status> and cannot be redriven".
- Name States.Timeout as the error of a TIMED_OUT event.
- Apply the 248 KiB rule: input is left out when the escaped input
and output together exceed it, output when the escaped output alone
does, and inputDetails/outputDetails.included report it.
* test(stepfunctions): check event absences without waiting on empty queues
The integration test long-polled SQS for 2 s after each case to show
nothing more arrived, so the class waited about 10 s by design. It now
asserts only the events that should arrive. The absences that matter
are checked in StepFunctionsServiceExecutionEventsTest: it captures the
completion callback from a mocked AslExecutor and verifies that an
EXPRESS execution publishes nothing and that the worker's callback
after StopExecution adds no second ABORTED.
Add StepFunctionsExecutions.waitForTerminalState to the shared testing
package and use it here; moving the other Step Functions integration
tests onto it is left for a separate PR.
* feat(cloudformation): apply AssociatedRoles on RDS clusters and instances
AWS::RDS::DBCluster and AWS::RDS::DBInstance ignored AssociatedRoles,
so a CDK DatabaseCluster with s3ImportBuckets deployed with no role on
the cluster.
The roles are now associated when the resource is created, through the
same checks as AddRoleToDBCluster and AddRoleToDBInstance; a list RDS
refuses fails the resource and deletes the new database. An update adds
the roles the template gained and removes the ones the previous
template declared and this one drops, so a role associated outside the
stack is kept. An Aurora cluster member carrying its own
AssociatedRoles is a ValidationError, as the schema calls the property
not applicable there. addRolesToNewDbCluster now also refuses a role
named twice in its own list.
Closes#5638
* fix(cloudformation): follow AWS on repeated roles, and check before changing a database
A renamed instance's predecessor was deleted before the new instance
took its roles, so a refused list left neither; the roles now go on
first. The property is resolved before it is read, so Fn::If around the
list or an entry works and AWS::NoValue leaves it out, and any other
value that is not a list is a ValidationError rather than "no roles".
Repeated roles follow AWS's handlers: an instance skips a role or
feature already associated (AWS ignores DBInstanceRoleAlreadyExists),
while a cluster's list is checked first on an update too, and a role
the template newly declares is always added, so one attached by hand
fails the update with DBClusterRoleAlreadyExists. A rolled back cluster
replacement also restores the record of which roles the stack declared.
* fix(cloudformation): undo a failed role update's own changes
An update changed roles one at a time, so when a later step was
refused the roles it had already added stayed on the database while
the stack restored its old record, and a retry failed on them with
DBClusterRoleAlreadyExists. A refused step now removes the roles the
update added and puts back the ones it removed before the error is
reported. The cluster check also takes the template's engine, now that
it checks feature names, and the roles record reader catches only the
JSON parse error.
* fix(apigateway): resolve imported request model references
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(apigateway): snapshot request model schemas for deployments
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(apigateway): match the default body validation error
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test(apigateway): expect the AWS default validation message
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(apigateway): address model snapshot review findings
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(apigateway): resolve model URLs from deployment snapshots
Signed-off-by: Andre Kurait <akurait@amazon.com>
* test(apigateway): make model reference cases collectable
Signed-off-by: Andre Kurait <akurait@amazon.com>
* fix(apigateway): accept canonical model URLs in every partition
Signed-off-by: Andre Kurait <akurait@amazon.com>
---------
Signed-off-by: Andre Kurait <akurait@amazon.com>
* feat(lambdaweb): Lambda Web Functions control plane
The lambda-web service model (apiVersion 2025-03-07) signs as lambda, so
it is served under the lambda service at /2025-03-07/... with the AWS
wire shapes, state words and error wording of the 20 operations on web
functions, revisions, endpoints, tags and the resource policy.
Revisions and endpoints converge at once. They are stored Active and an
endpoint update is stored Successful, while the create and update
responses report the transitional state AWS reports, so a CLI waiter
settles on its first poll. Code comes from an S3 object that must exist.
IamAuth, the resource policy and the endpoint domain are stored but not
served yet.
Part of #5699
* fix(lambdaweb): carry the page position in the token
The nextToken of a list operation was a UUID keyed into an in-memory
anchor map that only grew and was not scoped to the account. The token
is now a core Pagination cursor that encodes the request (operation,
region, account, function, filters and page size) and the cursor of the
item the page ended on. A token reused with other parameters gets the
AWS "does not match the request" error and any other token the AWS
"invalid or has expired" error.
AWS issues UUID tokens and rejects any other shape, so Floci no longer
reproduces the pattern error for a malformed token.
* fix(iam): resolve a Lambda Web revision or endpoint named by its ARN
The route resource for IAM enforcement took the path segment after
revisions or endpoints as the id. A revision or endpoint ARN in that
position carries slashes, so the resource ARN ended in the ARN's first
segment and a policy scoped to the revision or endpoint did not apply.
The id is now the last segment of such an ARN.
* fix(lambdaweb): add the values of a repeated state filter
AWS lists a function when any state filter in the request names its
state. A later state filter replaced the earlier one, so a request with
state=Active followed by state=Failed listed nothing.
* fix(lambdaweb): refuse empty arrays in a resource policy
AWS answers an empty Action or Resource array with the policy syntax
error and an empty principal array with the invalid principal error,
which wins when all three are empty. Floci stored such a policy.
* fix(lambdaweb): judge a wildcard principal by the operator and value of its condition
A trusted condition key alone kept an Allow for every principal out of
the public check. AWS blocks the policy unless a positive operator pins
the key: StringNotEquals and the IfExists forms do not count, nor does a
wildcard in an account value or in the account field of an ARN value,
while a wildcard elsewhere in an ARN and a literal * under StringEquals
do.
* feat(ui): add a light and dark theme toggle to the landing page
The landing page was dark only. A button in the top bar, shown on the
dashboard and on the /_floci/ui wait view, switches between a dark and a
light theme. With no choice made the page follows the OS colour scheme,
including a change while it is open; a choice is remembered in
localStorage under floci.theme, next to the news setting, and the page
still switches for the current view when storage is blocked. The theme
is set by the head script before the stylesheet paints, so a light page
does not flash dark on load.
The dark palette is unchanged. The light one keeps the same accent
family with every text colour at 4.5:1 or better against the page
backgrounds, and the five colours that were written as literals (logo
dot, button text, code snippets, error box, the copied border) are now
variables both themes set.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* feat(ui): name the emulator in the top bar and keep a page-view theme choice
The page will be shared by the other Floci emulators, so the top bar now
says which one serves it, floci-aws, next to the logo, and the page title
and the version pill's tooltip name it too.
A theme picked with the toggle while storage is blocked could be undone
by an OS colour-scheme change later in the same page view, because the
OS listener only checked the stored choice. The click is now remembered
in memory as well, so the OS is followed only until the user picks.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* chore(ui): pin the floci-ui console image to 0.7.0
The console image defaulted to floci/floci-ui:latest, and a cached
latest tag is never pulled again, so a machine kept whatever console it
first downloaded. The default is now the released 0.7.0 tag, in the
config default, application.yml and the three docs tables that list it.
FLOCI_SERVICES_UI_IMAGE still overrides it.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
A version published with no readme field was silently skipped in
checkRepublish's readmeByVersion map, so GetPackageVersionReadme answered
ResourceNotFoundException for a version that genuinely exists on Verdaccio.
pypi already records an empty string in the equivalent case (twine uploads
with no description field), so npm now does the same: every version in the
publish envelope gets an entry, with recordPublishedPackageVersionReadme's
existing null-to-"" normalization doing the rest.
Follow-up requested on #5644's approval.
A ${...} in a Resource pattern or a Condition value was matched as the text it
is written as, so a statement scoped to arn:aws:iam::*:user/${aws:username}
matched no user at all. AWS's own IAMUserChangePassword policy is written that
way and floci vendors it verbatim, so under enforcement it authorized nothing,
and it is not alone: 244 of the 1586 vendored managed policy documents carry a
variable, and of the 1635 occurrences in them 1443 sit in a Condition value
and 192 in a Resource. The Condition share is where the loss bites hardest,
since a variable that cannot resolve quietly drops a Deny that AWS honours.
The keys a variable resolves against arrived with #5568, which put
aws:username, aws:userid and aws:PrincipalType into the request context. This
is the other half of that work: without substitution the keys answer nobody,
and without the keys substitution has nothing to find.
Variables now resolve wherever the evaluator matches a statement, which covers
every document it reads: identity policies, resource policies, session
policies, permissions boundaries, SCPs, and the Condition of a role trust
policy, whose own Version now reaches the condition check. A trust policy is
the narrow case, since sts:AssumeRole is authorized before there is a session
to describe: that context carries aws:PrincipalArn, the account and region
keys, sts:RoleSessionName and sts:ExternalId, so a variable naming
aws:username, aws:userid or aws:PrincipalType finds nothing there, which
iam.md now says.
Two of the rules are easy to miss. Substitution is gated on "Version":
"2012-10-17", because under the older 2008-10-17, which is also the default
when the element is absent, the user guide says variables "are instead treated
as literal strings in the policy"; the version therefore rides on each parsed
statement, since statements from many documents are evaluated as one list. And
a variable with no value is not an empty string: in Resource the pattern "will
not match any resource", in NotResource that same rule excludes nothing, and
in a Condition the positive operators do not match while the inverted ones do,
which is what makes the Deny AWS documents for an unset principal tag fire.
The rest, also from the user guide: a variable resolves only in the resource
portion of an ARN, after the fifth colon; only with the string and ARN
condition operators, never Numeric, Date, Bool, IpAddress or Null; only for a
single-valued key, a multivalued one having no one value to stand in, which a
default does not rescue, since a default answers a key with no value rather
than one with several; and case-insensitively by key name, a name that holds
no space, the guide allowing one inside a quoted default and nowhere else. A
spaced name, an empty ${}, a missing brace and an unquoted default are the
forms the guide's policy checks call errors, and each stays the text it is.
${*}, ${?} and ${$} stand for a literal character, so the glob gained an
escape marker, honoured only on a pattern that came back from substitution and
stripped from whatever arrived in the policy: a document can write the marker
as a JSON escape, and reading it as one would turn a wildcard of the
document's own into a literal character and narrow the statement it sits in. A
resolved value is not escaped, matching AWS, whose policy checks warn that
variables "can be evaluated as effective wildcards".
Verified at this commit: 7442 tests across the 439 IAM, core, enforcement and
resource-policy classes the evaluator is reached from, Checkstyle and
docs-check clean. AWS's own IAMUserChangePassword document is attached to a
user and called on the request path, both of its patterns included, the second
scoping a user under a path. Each rule was probed by reverting it alone, which
is how two weak tests were found: a valueless variable beside a wildcard and
the operator restriction both needed a case whose answer flips. The escape
marker is probed from both sides, by letting the resolver keep one that
arrived in a policy and by honouring markers on every pattern rather than only
a substituted one, and each side fails a different case of the same test.
SesAddressSyntax, SesAddressLength, SesSendAddresses and SesEncodedWord
are stateless address parsing and validation that depend only on the
model and core packages. Only the entry points the send path calls are
public; the walker and the encoded-word helper stay package-private
inside the new package. No behaviour change.
RequestCertificate answers an explicit empty SubjectAlternativeNames
array with a 400 ValidationException, as ACM does: the API requires at
least one name in the list. CloudFormation certificate resources keep
accepting an empty list and request the certificate for the domain
name alone, as before.
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
GetLatestConfiguration and the legacy GetConfiguration compared the
type parameter of an Accept media range verbatim, quotes included. So
application/ion with type="AWS.AppConfig.FeatureFlags" did not match,
and a feature flag profile with variants came back as the stored JSON
instead of Ion. RFC 9110 section 5.6.6 makes a quoted-string parameter
value the same value as its token form.
The type value is now read as a token, or as a quoted-string without
its DQUOTEs and with each quoted-pair standing for the character after
its backslash (section 5.6.4). A quoted-string that is not closed, or
that has text after its closing DQUOTE, does not match. The media range
and the q weight are read as before.
Closes#5673
Signed-off-by: Jackson Price <59149601+jprice8@users.noreply.github.com>
* feat(opensearch): allow configuring a data volume for domain containers
* fix(opensearch): isolate configured storage and prepare bind mounts
Include account and Region from the domain ARN in configured volume
names and bind paths, preserving the optional deployment namespace.
Treat missing ownership markers as FLOCI_MANAGED and remove name-based
ownership inference. Retain explicitly operator-owned storage and use
persisted volume names for managed cleanup.
Reuse the storage helper container lifecycle to prepare bind-directory
ownership and owner write access from the selected image. Leave existing
files untouched, propagate preparation failures, and release reserved
ports when storage preparation fails.
Preserve Linux daemon path syntax on Windows while keeping native
Windows paths and named volumes working.
Consolidate OpenSearchDomainManagerTest setup, add regression coverage
and a Linux Docker integration test, and update configuration comments
and documentation examples.
Fix an existing bug where opensearch container names did not include
account or region id.
Disable stale connection validation for named-pipe endpoints because Docker may block while the HTTP client checks pooled connections. Keep the existing validation for TCP and Unix sockets.
Fix#5394
ContainerReachableEndpoint.baseUrl() took the port from floci.base-url, which
advertises the host-facing address. Under a port mapping such as
`docker run -p 4811:4566 -e FLOCI_BASE_URL=http://localhost:4811`, Lambda, ECS,
Flink, MWAA, EC2 and CloudFormation custom-resource containers got an
AWS_ENDPOINT_URL on port 4811, which is refused inside the Docker network where
Floci listens on 4566.
The port is now the one Floci listens on: quarkus.http.port, which defaults to
floci.port but can be overridden on its own, or floci.port when TLS is on,
since the HTTP server then moves to a loopback-only internal port and
TlsProxyServer serves clients on floci.port. URLs returned to host clients
still come from base-url.
ContainerReachableEndpointTest covers the embedded DNS and Docker host paths,
a custom listen port and hostname, quarkus.http.port overridden alone, and
TLS; ContainerLauncherTest asserts a launched function gets the listen port
when base-url advertises another. SidecarContainersProfile sets floci.port and
quarkus.http.port alongside the test port.
Closes#4987
* fix(partitions): source the China CloudFront suffix and GovCloud API Gateway zones
Two values listed as open questions have a published source in the China and
GovCloud user guides, so they become vendored facts in aws/region-facts.json
instead of a commercial constant.
A generated CloudFront distribution domain name ended in cloudfront.net in
every partition. The China guide's CloudFront page names the default domain
there as *.cloudfront.cn
(https://docs.amazonaws.cn/en_us/aws/latest/userguide/cloudfront.html), and
the commercial suffix is the one in the example name of the botocore
CloudFront model (Distribution$DomainName, DistributionSummary$DomainName).
floci.services.cloudfront.domain-suffix loses its cloudfront.net default and
becomes optional: unset, the suffix follows the request's partition, with the
commercial one where a partition has no CloudFront; set, it applies in every
partition as before. CloudFront distributions and streaming distributions,
Cognito and AppSync custom domains and edge-optimized API Gateway domains all
resolve it through CloudFrontEdgeDomain.domainSuffix.
A regional API Gateway custom domain reported one placeholder hosted zone id in
every region. The GovCloud guide's API Gateway page states the regional
endpoint zone for us-gov-west-1 (Z1K6XKP9SAGWDV) and us-gov-east-1
(Z3SE9ATJYCRCZJ)
(https://docs.aws.amazon.com/govcloud-us/latest/UserGuide/govcloud-abp.html);
those two regions now report it, and the generator resolves each region
through its description in partitions.json. No source gives the zone for any
other region, which keeps the placeholder and stays an open question.
The generator reads both sentences from either rendering of a guide page: the
page text, or the Markdown AWS serves at the same URL with .md, which escapes
the asterisk in the CloudFront sentence.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
* fix(partitions): require each sourced fact and resolve edge domains in the request's partition
The GovCloud API Gateway page parser accepted a page stating only one
region's regional hosted zone, so an edited guide would have dropped the
other zone from region-facts.json without failing. It now requires a zone
for every aws-us-gov region.
The region-facts self check validated cloudfrontDomainSuffix only when it
was present. It now requires the suffix for aws and aws-cn, and the
regional hosted zone for both GovCloud regions, as it already requires
consoleHost; a missing commercial suffix would otherwise have reached
the orElseThrow in CloudFrontEdgeDomain.domainSuffix at runtime.
CloudFrontEdgeDomain.create resolved its partition from the region alone,
falling back to the commercial one, so an AppSync or API Gateway custom
domain in a region no partition publishes (allowed under
allow-unknown-regions) took the commercial suffix and hosted zone in a
China deployment. It now takes the partition the caller's RegionResolver
resolves, which falls back to the deployment's partition, as the
CloudFront and Cognito paths already do.
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
---------
Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Supports npm, pypi, and nuget, matching AWS's own documented restriction
for this action (not maven, Swift, generic, Ruby, or Cargo, which carry
no readme in real CodeArtifact).
Neither npm nor pypi can answer this live after the fact. A real
Verdaccio packument GET hoists readme to the top level only, for the
single most-recently-published version, and drops the per-version field
from its own response entirely, even though a real npm client's publish
envelope genuinely sends one per version (confirmed against a live
Verdaccio 6.10.4 container with a captured real npm-publish fixture).
pypiserver has no description field anywhere in its model or its RPC2
route (confirmed by reading pypiserver's own source at the pinned
version), so it never had a live path to begin with.
Both formats are therefore captured at publish/upload time instead:
npm's per-version readme field is read off the real publish envelope by
NpmPublishEnvelopeScanner and recorded after a successful forward to the
Verdaccio sidecar, and pypi's is read off the upload form's description
field the same way it already was. Both go through the same
recordPublishedPackageVersionReadme method and the same
packageVersionReadmes account-scoped store, cleaned up on
DeleteRepository and DeletePackage the same way packageOriginConfigs
already is. nuget is accepted as a valid format but always 404s, since
nothing in Floci implements the real NuGet wire protocol and no nuget
package version can ever exist here.
Refactors validatePackageToken to delegate to a new non-throwing
isValidPackageToken, reused by the readme capture path (fed raw
publish/upload input, never through the JSON API's own validation) to
guard the same escape-collision invariant escapeKeySegment depends on.
Extracts the container-backed revision synthesis already used by
GetPackageVersionAsset into a shared helper so GetPackageVersionReadme
reports a consistent revision for the same version coordinate.
A Smithy RPC v2 call names its operation in the path, /service/<service>/operation/<operation>,
not in a Query Action or an X-Amz-Target header. Enforcement found no action for it, and an
unknown action is allowed, so under enforcement any known key could run any operation of SQS, SNS,
DynamoDB, Kinesis, Step Functions, CloudWatch or Marketplace over RPC v2, explicit denies included.
Enforcement also took the call's shape from the protocol claim, which the claim filter reads before
routing, while the CBOR endpoint dispatches whatever its route matched. The two disagree in
several ways:
- An unrecognised smithy-protocol value leaves the call unclaimed. With strict claiming off, the
default, it is still served, so an unsigned call was not refused.
- An X-Amz-Target header on the call named the operation it was checked as, while the path named
the one that ran.
- A path with a prefix before /service/ is claimed as RPC v2 while another route serves it.
The filter now reads the service and operation from the route the call reached, the values the
endpoint dispatches. It authorizes that operation as the action AWS checks for it, under the
serving service's namespace, and records the call's claim, so the unsigned refusal and the CBOR
error format apply whatever its smithy-protocol header says. A call on any other route is handled
as before.
The resources and condition keys a request names in its body were read only from JSON, and a CBOR
body fell back to a wildcard resource: a deny on one queue, table or stream did not apply, a grant
on one did not match, and a ForAllValues dynamodb:LeadingKeys condition granted every key. The
body is now read as CBOR when its content type says so, on the RPC v2 path and on the
x-amz-cbor-1.1 one, which had the same gap.