* fix(dynamodb): add missing ConsumedCapacity for PartiQL's ExecuteStatement and BatchExecuteStatement
* fix(dynamodb): reject an invalid ReturnConsumedCapacity on PartiQL statements
* fix(dynamodb): charge the base table when an unkeyed LSI read selects an unprojected attribute
A health probe written without a Host header answered 500 on a healthy
emulator:
GET /_floci/health HTTP/1.0 -> 500
GET /_floci/health HTTP/1.1 + Host: localhost -> 200
Host is mandatory only from HTTP/1.1 on, so Vert.x answers 400 to a 1.1
request without one and exempts 1.0 by design. A 1.0 request then reached
the application with no authority anywhere: HttpServerRequest.absoluteURI()
is null, and UriInfo.getRequestUri() fails inside new URI(null). Every
host-routing filter reads the request URI, through RequestHost or directly,
so LambdaUrlRoutingFilter threw a NullPointerException before routing ever
reached a resource. Nothing about it was health-specific: every endpoint
answered 500 the same way.
MissingHostHeaderFilter is a pre-matching filter that fills in the missing
authority. For an origin-form target, which names no host anywhere, that is
the local socket the request arrived on, the address the client actually
reached. An address literal names no S3 bucket, Lambda function URL, or
custom domain, so the request routes path-style, which is what a client
sending no Host asked for.
An absolute-form target states an authority of its own, which RFC 9112
section 3.2.2 has the server route by, and it answered 500 for the same
reason: the authority vertx-web builds its absolute URI from is the Host
header alone. So GET http://bucket.s3.localhost:4566/key HTTP/1.0 takes the
bucket from the target and keeps routing to it. Asterisk-form names no host
at all and is left alone, as it is with a Host header.
The repair is the request URI rather than the Host header. Vert.x resolves
the authority once, in RoutingContextImpl.route(), before any handler runs,
and caches the absence, so a header set afterwards is never looked at again.
Rewriting the JAX-RS request URI is the same mechanism the virtual-host
filters already use to reroute a request.
HTTP/1.1 without Host keeps answering Vert.x's 400 with the message naming
the missing header.
* feat(elasticache): support single-node redis clusters in CreateCacheCluster
CreateCacheCluster refused every engine but memcached, telling callers to use
CreateReplicationGroup instead. Real AWS accepts Engine=redis and Engine=valkey
there as long as the cluster has one node, and that is exactly the call
terraform's aws_elasticache_cluster with engine = "redis" emits, so every such
example failed against Floci.
A single-node redis or valkey cluster is now provisioned the way a
cluster-mode-disabled replication group is: the same Valkey container, fronted by
the same auth proxy on a port from the same range, so the endpoint a describe
reports actually answers RESP. It is stored apart from replication groups, since
one created this way has none and must not appear in DescribeReplicationGroups.
NumCacheNodes greater than 1 is refused with the message a live account gives.
Following AWS, the cluster carries no ConfigurationEndpoint (that is memcached's
node discovery endpoint) and reports its node under CacheNodes when the request
sets ShowCacheNodeInfo, which is where terraform-provider-aws reads the port.
The memcached path is unchanged. ElastiCacheMemcachedIntegrationTest asserted the
old refusal with Engine=redis; it now asserts it with an engine ElastiCache
really does not have.
* fix(elasticache): address review findings
Cross-type id collision closed both directions through one provisioningIds
claim set (the claimed thing is one namespace: container name + proxy key);
wire code corrected to CacheClusterAlreadyExists; create request grown to
round-trip the optional members Terraform reads back, guarded by a
compat-terraform bats config asserting plan -detailed-exitcode after apply;
ListTagsForResource cluster arm brought to parity with the replicationgroup
arm without regressing memcached/member fall-through; standalone clusters
join getResources; create/delete responses no longer leak CacheNodes.
* fix(elasticache): correct review-round test assertion, bats port pin, docs note
The cross-type guard test asserted never() on a tryStart its own setup
legitimately performs — times(1), matching the sibling test. The single-node
bats config pinned port 6379, which the parallel bats runner's sibling
replication-group config fills first from the range base (the allocator
refuses rather than substitutes) — pinned to 6395. AtRestEncryptionEnabled
noted in docs as output-only on real AWS's CreateCacheCluster.
* docs(elasticache): the output-only note belongs to the single-node prose, not the CreateReplicationGroup row
AtRestEncryptionEnabled is a legitimate input member of
CreateReplicationGroupMessage; it is absent only from CreateCacheClusterMessage.
* fix(elasticache): reserve persisted ports on restore, cross-store id uniqueness, validate subnet group
Three findings from the PR review, all on the single-node cache cluster path.
Ports of records that survive a restart are now reserved before Floci serves
anything. Standalone cache clusters and cluster-mode-disabled replication groups
are not re-provisioned, but they still advertise the port they were given, and
nothing put those ports back into the in-use set: a create after a restart was
handed a port a live record still published, and the two then contended over one
reservation, so the first delete freed it and the next create took it again. A
delete now releases only a port this process actually reserved for that record,
since a restored record whose port was already taken advertises one it does not
own.
The id check spans all three stores that answer DescribeCacheClusters. A
standalone redis cluster, a Memcached cluster and a replication group can no
longer share an id in either direction. Both services read the same backends:
StorageFactory keys them by file path and hands the second caller the first
caller's instance, so no new wiring is needed for the two services to agree on
one namespace.
CacheSubnetGroupName must now name a subnet group that exists, instead of being
stored as a reference a describe reports and a caller cannot look up.
CreateReplicationGroup still does not make that check; it is called out in the
service and in the docs rather than changed here.
* style(elasticache): drop em dash in transient-field comment
* fix(elasticache): close the id and port gaps the delta review found
CreateReplicationGroup's duplicate-id check read only the group and redis
cluster stores, so a group could take the id of a live memcached cluster
while CreateCacheCluster refused the same collision the other way round.
Check the third store too, which is what makes the documented "an id is
taken across all three at once" actually hold.
Two port-reservation fixes alongside it. The claim on a new cache
cluster's port was recorded after the synchronized block that stores the
record, so a delete landing in the gap found nothing to release and
stranded the reservation; it now happens under the same monitor as the
put. And deleteReplicationGroup freed the group's port unconditionally,
while the cluster path has guarded that since the restore work went in: a
record restored from disk whose port was already taken advertises a port
it does not own, and freeing it hands a live record's port to the next
create. The holder set now covers both kinds, keyed by id, which is safe
because an id is unique across the stores.
* docs(elasticache): say which engines the subnet-group check covers
CreateCacheCluster with Engine=memcached routes to a create that takes
only the cluster id, so CacheSubnetGroupName is dropped on that path: not
checked, not echoed. The page claimed the check unqualified. Also name
CreateReplicationGroup in the id-uniqueness paragraph, now that it makes
the same check.
* test(elasticache): cover the ordinary group delete that frees its port
The two port tests around it both step past the create path: one deletes a
group written straight into the store, the other one restored after a
restart. So the claim recorded when a group is created in process had
nothing behind it, and dropping it would leave the suite green while every
DeleteReplicationGroup leaked its proxy port for the life of the process.
* fix(elasticache): claim the id on the memcached create path too
CreateCacheCluster for memcached checked the three stores for a duplicate id
and went straight on to start its container, without joining the in-flight
claim set the redis cluster and replication group paths take. No create path
persists its record until after container startup, so a memcached create and
a redis create for one id could both read three empty stores and both write,
leaving the id in two stores with DescribeCacheClusters reporting it twice
and the two containers and proxy registrations colliding under one name.
Move that set out of ElastiCacheService into an ElastiCacheProvisioningIds
bean both services inject, so the claim covers every engine, and take it in
the memcached path before the store checks with the same try/finally release.
A collision with an in-flight create is refused with the fault the store-hit
path already produces, CacheClusterAlreadyExistsFault.
* fix(elasticache): complete the CacheNode shape and correct the memcached fault code
DescribeCacheClusters returned a CacheNode carrying only an id, a status and an
endpoint. terraform-provider-aws dereferences CacheNodeCreateTime and
ParameterGroupStatus while adopting the resource without a nil check, so the
compat-terraform job created floci-tf-redis-single successfully and then died on
the very next refresh with "Unexpected nil pointer" naming both fields. The
endpoint was never the problem; the node shape was incomplete.
Both are stable metadata AWS returns on every available node, and both were
already known here: a single-node cluster's node was created with the cluster,
and its parameter group carries the same in-sync status already reported for the
cluster. CustomerAvailabilityZone is emitted from the cluster's AZ for the same
reason -- a node whose AZ disagrees with its cluster is a permanent plan diff.
Memcached returns early well above this block, so its wire output is unchanged.
Separately, the id claim added on the memcached create path threw
CacheClusterAlreadyExistsFault. The wire code is CacheClusterAlreadyExists -- the
Fault suffix is the botocore shape name, not the code an SDK matches on -- which
this branch had already established on the redis side and then contradicted.
Both memcached throw sites now use the wire code, including the pre-existing one,
and the five test assertions that pinned the wrong spelling are corrected.
* test(elasticache): stop the single-node fixture pinning the shared suite's port
The compat-terraform job runs every stack against one Floci, and this branch's
new elasticache-single-node-tf pinned port 6395 -- the same port main.tf already
pins for the replication group the `terraform` suite creates. ElastiCache
refuses a pinned port that is already reserved, by design, so the two stacks can
only both succeed if the first is fully destroyed before the second applies.
That is what the last run showed: elasticache_single_node failed its apply, so
its destroy never ran, 6395 stayed held, and the `terraform` suite then failed
with "Port 6395 is already in use by another replication group" -- a second
failure that reads like an allocator bug and is really a fixture collision.
Fixing the node shape removes the trigger but not the collision, which would
remain a teardown-ordering dependency between two independent suites.
6396 is free and inside the 6379-6399 proxy range.
* test(elasticache): name the extracted XmlPath instead of inferring it with var
Review follow-up: this was the only `var` in the file, and the type it hides
(io.restassured.path.xml.XmlPath) is the one a reader needs in order to follow
the getString/getInt calls immediately below it.
No behaviour change.
* style(test): import ArrayList and LinkedHashMap instead of naming them inline
AGENTS.md asks for imports rather than inline fully-qualified names.
ElastiCacheQueryHandlerTest had three: new java.util.ArrayList<>(...) and
two new java.util.LinkedHashMap<>(...). LinkedHashMap was already imported;
ArrayList is added.
On AWS a global table (version 2019.11.21) has no primary: the region it was
created in is one of its replicas, and DescribeTable lists it under Replicas
as ACTIVE next to the others. The CDK's TableV2 calls that table the default
replica and refuses a declared replica in the primary table's region
(aws-dynamodb/lib/table-v2.ts:280,394), which is why the CloudFormation
provisioner filters the deployment region out of its ReplicaUpdates reconcile.
Floci only knew the other regions, so a single-region
AWS::DynamoDB::GlobalTable described with no replicas and a two-region one
listed only the second.
TableDefinition.globalTableHomeRegion records the creating region once a
replica is added (UpdateTable ReplicaUpdates, Custom::DynamoDBReplica) or when
the GlobalTable provisioner calls the new idempotent ensureGlobalTable, and
DescribeTable appends it as an ACTIVE replica after the tracked ones with
GlobalTableVersion. A plain table has no home region and reports neither.
Follow-up from #4081: the javadoc still described the AWS default as covering a client persisted before the default was materialised into storage. Floci never stores that default, so it applies to every client with no ExplicitAuthFlows, not just a legacy one.
SimulateCustomPolicy evaluates requested actions and resources against a
standalone set of policy documents plus an optional permissions boundary,
reusing the same identity/boundary evaluation as SimulatePrincipalPolicy.
GetContextKeysForCustomPolicy and GetContextKeysForPrincipalPolicy list the
context keys referenced across a set of documents, or a resolved principal's
policies plus any extra documents supplied.
contextKeysReferencedIn collects every Condition operator's key, every
${...} policy variable named in a Resource pattern, and every one named in
a Condition value, in statement order, without sorting or de-duplicating:
AWS's own documented example response for GetContextKeysForPrincipalPolicy
repeats a key referenced by more than one statement. A variable's default
value (${key, 'default'}) is stripped to just the key name, and the three
single-character escapes (${*}, ${?}, ${$}) are excluded, since AWS
defines those as literal-character substitutions, not context-key
references. NotResource is not scanned: AWS documents policy variables as
usable only in Resource and in Condition values, never in NotResource,
Action or Principal.
Also completes AwsQueryController's IAM_ACTIONS fallback set for the three
new actions, matching SimulatePrincipalPolicy's existing entry there.
Known limitations, documented in iam.md: PolicySourceArn resolves a user or
role only, not a group (inherited from SimulatePrincipalPolicy); only one
PermissionsBoundaryPolicyInputList document is honored, matching AWS's own
stated limit; ResourcePolicy, ResourceOwner, ResourceHandlingOption and
OrderedOrganizationPolicyInputList are not evaluated; MatchedStatements,
ResourceSpecificResults and PermissionsBoundaryDecisionDetail are never
populated; ContextKeyType is accepted but not read, since the comparison is
driven by the policy's own condition operator.
AWS::IAM::InstanceProfile rejected any createOnly change on UpdateStack (a name
or Path change threw ValidationError). Both InstanceProfileName and Path are
createOnly, so a change should replace the profile.
- A rename creates the new profile under the new name; dropping the explicit
name mints a generated one; a Path change on an auto-named profile mints a
fresh name so the replacement does not collide with the profile it displaces.
The old profile is deleted once the update commits, or restored on rollback,
via ReplacementCleanup, the same path Ec2Instance uses.
- Whether the profile was created under an explicit name is recorded at create
time in a __Floci attribute (filtered from the published ones), not inferred
from the id's shape: a generated name loses its <stack>-<logicalId> prefix
past 128 characters, so a shape check would have replaced every auto-named
profile of a long-named stack on each update. A prior profile with no record
is kept.
- A Path change that keeps an explicit name is attempted with that same name, so
CreateInstanceProfile collides and IAM answers EntityAlreadyExists, exactly as
CloudFormation surfaces that update, rather than being rejected up front.
Match S3 behavior by requiring supported x-amz-checksum-* headers to be included in X-Amz-SignedHeaders. Return AccessDenied with HeadersNotSigned when a presigned request includes an unsigned checksum header.
* fix(kinesisanalytics): scope applications by account and region
* fix(kinesisanalytics): migrate legacy application lookups
Use the account-aware synchronized migration path for regional application lookups and listing. Reject foreign-account resource ARNs and cover legacy tagging migration.
A key that starts with a slash travels as a double slash on the wire
(PUT /bucket//email.txt) and the client signs that path verbatim, since
S3 never normalizes the canonical URI. Both signature filters rebuilt the
canonical request from the JAX-RS UriInfo path, which collapses the
consecutive slashes, so every such request was rejected with
SignatureDoesNotMatch under enforce-auth and, conversely, a signature
over the normalized path verified for the other object.
Both filters now take the path from the raw Vert.x request, the way
S3Controller already extracts the key. The virtual-hosted key extraction
also kept dropping the leading slash, because it compared the raw path
against the collapsed rewritten URI; it now accepts the collapsed form.
Closes#4123
Signed-off-by: Matheus André <matheusandr2@gmail.com>
* fix(rds): bind PostgreSQL IAM tokens to the published endpoint
The PostgreSQL proxy validated IAM auth tokens with the two-argument
validator, so a token generated for any host, port or region was
accepted as long as the signature and DBUser matched. The MySQL proxy
already checked the token against the endpoint it publishes. Thread the
same binding into the PostgreSQL handler and validate against it.
* fix(rds): carry account and resource ids in the proxy binding
RdsService now builds the proxy binding itself at every relay start
(instances, clusters, RDS Proxy relays and restart restores) from the
published endpoint, port, region, account and DbiResourceId or
DbClusterResourceId, so the auth proxy has everything rds-db:connect
is scoped to. The convenience startProxy overload that re-derived the
region from the relay key is gone along with it.
* feat(rds): authorize rds-db:connect when IAM enforcement is on
After the token signature checks out, the auth proxy now asks IAM whether
the token's principal may perform rds-db:connect on
arn:aws:rds-db:<region>:<account>:dbuser:<resource-id>/<db-user>, the
same check AWS runs. It only applies when services.iam.enforcement-enabled
is on; a caller IAM does not know keeps the filter's bypass. The client
still sees the engine's generic authentication failure, and the denial is
logged in AWS's wording so the cause is visible server-side.
* refactor(rds): rename RdsMysqlBinding to RdsProxyBinding
Both engines, Aurora clusters and RDS Proxy relays now validate IAM
tokens against it, so the MySQL-specific name was misleading.
* docs(rds): describe IAM token endpoint binding and rds-db:connect
* test(rds): cover a replayed IAM token in the JDBC compat suite
* fix(rds): accept IAM tokens generated for the loopback name of the endpoint
Floci advertises the name containers reach it by (host.docker.internal
natively, its own address in Docker), while a client on the host connects
to the same proxy over the loopback interface and generates its token for
localhost or 127.0.0.1. Binding tokens strictly to the advertised host
therefore refused every native client; the published port still has to
match, so a token for another instance on the same host is still refused.
The compatibility workflow sets FLOCI_SERVICES_RDS_ENDPOINT_HOST=floci as
it already does for Redshift, so the tests' tokens name what the
containerised Floci publishes.
* feat(rds): make the PostgreSQL IAM token endpoint binding opt-in
Refusing a PostgreSQL token generated for another hostname, port or
region matches RDS but breaks clients whose tokens name a different
host than the endpoint publishes, so the check now sits behind
services.rds.iam-token-endpoint-binding
(FLOCI_SERVICES_RDS_IAM_TOKEN_ENDPOINT_BINDING), off by default.
MySQL and MariaDB keep requiring the endpoint as before, and the
rds-db:connect check still runs whenever IAM enforcement is on.
The compatibility workflow turns the flag on so the replayed-token
case stays covered.
* fix(rds): refuse an IAM token that reaches the validator without a binding
Every proxy publishes a binding, so a token without one has nothing to
be checked against; validating its signature alone was a fail-open
path. The signature-only validate(token, user) overload and the MySQL
handleAuth overloads that passed no binding are removed; production
only ever used the ones that pass it.
* fix(rds): sanitize the rds-db resource named in the refused connection warning
The database user is part of that resource and comes straight from the
client's startup message, so it is stripped of control characters like
the other client-controlled values in the warning.
* docs(rds): call a refused IAM token the engine's ordinary authentication failure
The exact message differs per engine, and RDS PostgreSQL words it
differently from Floci's handler today, so the docs no longer promise
one wording.
* docs(rds): move the IAM token binding row into the RDS variables table
The row had landed above the page heading, where it rendered as a
stray one-row table; it now follows FLOCI_SERVICES_RDS_ENDPOINT_HOST
as it does on the RDS page.
* fix(rds): bind PostgreSQL IAM tokens to the endpoint by default
A stock Floci still accepted a PostgreSQL token generated for another
endpoint, the replay this change set out to close, and PostgreSQL and
MySQL disagreed about it in a way RDS never has. The endpoint check is
now on for every engine. services.rds.iam-token-endpoint-binding
(FLOCI_SERVICES_RDS_IAM_TOKEN_ENDPOINT_BINDING=false) stays as the
escape hatch for clients that generate tokens for a container name or
DNS alias the endpoint does not publish. The compatibility workflow no
longer needs to turn the check on.
* chore(ci): rerun after a Docker Hub rate limit failed shard 1
The SQS arm of the fan-out passed a literal 0 as the per-message
delaySeconds. On a standard queue a non-null value is an explicit
per-message delay and overrides the queue attribute, so a queue created
with DelaySeconds never withheld a published message, while a direct
SendMessage to the same queue did. SNS carries no per-message delay, so
the argument is now null and the queue default applies, as on AWS. FIFO
queues were unaffected: that branch ignores the argument.
* feat(appsync): execute APPSYNC_JS resolvers via a Node sidecar
A field with a resolver resolved to null: no data fetchers were registered, so graphql-java
fell through to its property fetcher on an empty root. This runs the resolver instead, for
UNIT and PIPELINE alike, over NONE, AWS_LAMBDA, RELATIONAL_DATABASE and AMAZON_DYNAMODB data
sources.
Resolver JavaScript runs in a Node sidecar container rather than in process. Floci's published
image is a Mandrel native executable, which carries no Truffle languages, so there is no
in-process JavaScript to embed; running real Node also means a bundle executes as written, ES
modules and all. @aws-appsync/utils is a shim the sidecar writes at boot rather than the
published package, so a resolver call never depends on npm being reachable.
The pipeline follows AppSync's: ctx.stash threads through every stage, each stage sees the last
as ctx.prev.result, runtime.earlyReturn stops everything, util.error fails the field with the
type the resolver chose, and util.appendError returns its errors beside the data. A data source
failure does not fail the field on its own: the stage's response() handler is called with
ctx.error set and decides whether to re-raise or suppress, which is why resolvers carry an
explicit if (ctx.error) branch.
VTL mapping templates are not executed. A VTL stage fails its field saying so rather than
resolving to null, since a null that means "not implemented" is indistinguishable from a null
that means "no rows".
Carries model/FunctionConfiguration and AppSyncService so it builds and tests standalone; both
are identical to the copies in the AppSync CloudFormation change and collapse on merge.
* feat(appsync): enforce the APPSYNC_JS subset before evaluating resolver code
The sidecar is real Node, so it accepted JavaScript AWS rejects: async functions, promises,
classes, try/catch, while loops, this, and imports of Node builtins. For an emulator that is
the worst failure available, since a local run green-lights resolver code that cannot deploy.
Imports are restricted by a module resolve hook rather than a source scan, so a dynamic import
of a builtin cannot slip past either. An async handler is caught before it runs and a handler
returning a promise after. The remaining constructs are found by scanning the source with
comments, strings and template text blanked first, so the same keywords inside them are not
flagged. A rejected resolver fails its field with errorType UnsupportedFeature and the line.
Enforcement is on by default and can be turned off with
floci.services.appsync.js-runtime.enforce-appsync-subset, which exists only so a false positive
cannot block someone whose code AWS does accept.
Checking real resolvers against it found a gap of the same kind in the other direction:
@aws-appsync/utils/dynamodb is a real module the shim did not provide, so valid code was being
rejected. It now implements get, put and remove; the helpers that compile a condition or update
expression throw by name rather than returning something the data source would mishandle.
Also from review: cap the /evaluate request body, keep integer precision in the DynamoDB NS
branch as the N branch already did, reject two SQL parameters bound to the same name instead of
letting the Data API report it, drop the container id and close the log follower in reset(), and
bound the docker probe in the integration test so an unresponsive daemon cannot hang CI.
* feat(appsync): add the js-runtime url knob and stop the sidecar through ContainerTeardown
Follows the sidecar contract the other managed containers use. floci.services.appsync.
js-runtime.url points the runtime at a Node server that is already running, in which case
ensureStarted skips container management entirely: nothing is created, adopted or stopped, and
the URL is probed with the short adopt budget so a wrong one says so instead of holding the
first resolver for the full start timeout. Same shape and meaning as floci.services.duck.url.
NodeAppSyncJsRuntime now implements ContainerTeardown, so EmulatorLifecycle stops the sidecar
with the other process-bound containers at a deterministic point rather than only through
@PreDestroy, which the interface documents as running too late for the final storage flush.
Teardown is a no-op for a pre-configured URL, since that server is not ours to stop.
* fix(appsync): serialize reset() and stop the sidecar it gives up on
reset() touched started, baseUrl, containerId and logStream without holding the monitor that
ensureStarted() and stopManagedContainers() both take. A failed evaluation could therefore clear
those fields in the window after a container had been created and its id recorded but before
started was set, dropping the only handle to a live container: teardown then saw a null id,
treated the sidecar as never started, and the container was leaked rather than stopped.
reset() is now synchronized on the same monitor, and reentrant so the callers already holding it
are unaffected. The failure path in post() goes through discardSidecar(), which stops and removes
the container before clearing the fields instead of forgetting it, since forgetting is what leaks:
nothing else holds the id. A pre-configured url owns no container, so teardown there stays a no-op.
The regression races eight failing evaluations against startup and asserts every container the
runtime created was also stopped. It needs a transport-level failure to reach the path: a 500 is
rethrown as an AwsException before it, so the stub drops the connection instead. Against the
previous reset() it fails with expected <[container-1]> but was <[]>.
* refactor(appsync): run resolvers through the GraphQL sidecar callback
out of Floci, which left this branch building DataFetchers for a schema that no
longer has any. Resolver execution moves onto the sidecar's batched resolver
callback instead, so the engine stays in the sidecar and the resolvers, the data
sources and the Node runtime stay here.
/v1/execute now carries a resolve block naming every planned coordinate that has
a resolver, with a callback URL and a token minted for that one operation. The
sidecar batches each execution level into one POST /appsync-resolve, which runs
the field's resolver and answers with a value or an error. denyFields still win,
so a denied coordinate is never listed and never reaches a resolver, and the
token stops working as soon as the operation returns.
AppSyncResolverExecutor takes a ResolverInvocation record instead of a
DataFetchingEnvironment. Every value it read off the environment is on the
record, so the pipeline, the data source invokers and the JS runtime are
unchanged. ResolverDataFetcher is gone: fields with no resolver are the sidecar's
own property fetcher again, and a resolver that disappears mid-operation falls
back to the source property rather than failing.
One AppSync behaviour does not fit the callback response, which carries a value
or an error per field and never both. util.appendError means report this and
keep the data, so those errors come back on the operation's session and are
merged into the response envelope, which keeps data and appended errors together
as AppSync returns them.
Also gives the sidecar container host.docker.internal on Linux, since it now has
to reach Floci back, moves the JS runtime image pin into application.yml so CI
prefetches it the way it does the sidecar pins, and puts the Docker integration
test on the shared AppSyncGraphqlSidecarProfile so it is namespaced and gated
like the other AppSync integration tests.
* ci(appsync): prefetch the Node image only on the shard that starts it
The js-runtime prefetch matched /appsync/, so all four shards pulled
node:22-alpine although only the shard carrying
AppSyncJsResolverDockerIntegrationTest starts that container. Every other test
in the package is a unit test. Matching the class name instead is three fewer
Docker Hub pulls per run, which is what this script exists to avoid.
* fix(appsync): keep null arguments and move the resolver callback under _floci
Two review points from #3422.
ResolverInvocation copied arguments and variables with Map.copyOf, which rejects
a null value, so getMessages(nextToken: null) threw out of the callback and
answered 500. That failed every field in the batch, not only the field carrying
the null. Both copies are now null tolerant, and an explicit null stays
distinguishable from an absent argument: it is present in ctx.args and null,
where an absent one is not there at all.
The callback moves from /appsync-resolve to /_floci/appsync/resolve, with the
EKS webhooks. A bare path is reachable as a path-style S3 request for a bucket
of that name, and an S3 bucket name cannot begin with an underscore, so the
prefix cannot be shadowed.
The null case is covered both ways: a unit test in ResolverCallbackResourceTest
that fails with a NullPointerException against the previous code, and three
queries in the Docker round trip covering an explicit null, its value reaching
ctx.args, and an absent argument for contrast.
* feat(ses): scan raw sends for the EICAR test file and keep it out of the mailbox store
The content scan now covers raw sends: the wire bytes are searched for the
plain and the base64-encoded signature before parsing, so a message the
lenient MIME parser cannot walk is still caught, and the parsed message is
walked part by part, decoding attachments, descending into forwarded
messages and decoding RFC 2047 header words. A candidate found on the wire
is confirmed by decoding the run around it, so a base64 near-miss of the
signature is not rejected.
A rejected record keeps only its source, its envelope and RejectReason;
subject, headers, reply-to addresses, bodies and raw data are dropped, and
the inspection endpoint lists it in neither the Simple nor the raw shape, so
the signature never reaches the mailbox store on disk. A MIME parse failure
logs the exception class only, since the message text could echo content.
* test(ses): pin that a rejected raw send publishes no parsed subject
The raw rejection test checked the header block and the recipient lists but
read commonHeaders only for the recipients, so a subject leaking back into
the event would have gone unnoticed.
Validate node group launchTemplate specifications against EC2 during
CreateNodegroup. Reject requests where neither or both of id and name
are supplied, or where the referenced launch template or version does
not resolve in EC2, with InvalidParameterException (400). Resolve
launch templates and construct nodegroup ARNs using the cluster's region
rather than the default region.
* perf(s3): reuse part ETags for the composite ETag on multipart completion
CompleteMultipartUpload hashed every part with MD5 again to build the
composite ETag. UploadPart already stores that MD5 as the part ETag, so
the completion now parses it instead.
* chore(s3): replace the java.util wildcard import in S3Service
AWS::DynamoDB::GlobalTable was provisioned as a plain table and its Replicas
property was ignored. Now the declared replica regions are reconciled onto the
table via the same applyReplicaUpdates the UpdateTable ReplicaUpdates path uses.
- Create adds every declared replica region; update diffs declared vs tracked,
adding new regions and removing dropped ones so an edited Replicas list
converges.
- The deployment region is served by the table itself and the service rejects a
replica there, so it is filtered out rather than tracked.
AWS::Route53::RecordSet was a name-only resource: it set a physical id and wrote
nothing, so the record never existed. Now the declared record is applied to its
hosted zone via ChangeResourceRecordSets and removed on stack delete.
- Validate the schema-required Type and Name, and reject a non-numeric TTL (the
schema types TTL as a string) with a ValidationError rather than letting a raw
NumberFormatException escape.
- Resolve the zone from HostedZoneId (a Ref resolves to the real id) or by an
exact name match against HostedZoneName. listHostedZonesByName is a starts-at
paginator, so the result is filtered to the zone whose name equals the request,
rejecting when none or more than one matches, rather than writing into whatever
zone sorts first.
- Apply the record as an UPSERT so create and update both converge; delete
reconstructs a matching DELETE change from the zone id and type recorded at
create time, tolerating a zone or record already gone.
- When an update changes the record's identity (zone, Name, Type or
SetIdentifier), remove the record the prior provision wrote so it does not
linger in the zone and later block the zone's own delete.
Ref stays the record name; no Fn::GetAtt attribute is published (Id remains
gapped, as before).
* feat(glue): add security configuration CRUD
Implement AWS Glue security configuration create, get, list, and delete operations with encrypted configuration round trips, account and region isolation, persistence, and integration coverage.
* fix(glue): close catalog encryption handler case
Close the PutDataCatalogEncryptionSettings switch arm so the merged security configuration cases compile.
* test(glue): cover empty security configuration lists
Restore coverage for the empty GetSecurityConfigurations response and keep the test setup aligned with the rebased GlueService constructor.
* refactor(glue): name security configuration length limit
Use a named constant for the documented 255-character security configuration name limit.
* fix(glue): serialize security configuration timestamps
The LogGroup and LogStream API shapes carry the creation timestamp as
creationTime, but both responses wrote it as createdTime, so SDK clients
and the CLI saw it as unset. Only the response key changes; the persisted
model field keeps its name so existing data is unaffected.
Closes#4084
Signed-off-by: Matheus André <matheusandr2@gmail.com>
* fix(dynamodb): add missing ConsumedCapacity to transaction responses
* fix(dynamodb): wait for an in-flight same-token transaction and free the token when it fails
* fix(dynamodb): reject an invalid ReturnConsumedCapacity on transactions before they run
Both are handler-backed but were gapped, so Fn::GetAtt resolved to the literal
"Logical.Attr" string instead of the real value. Publish SecurityGroup Id
(= GroupId) and Instance VpcId, and drop their gap rows. Instance State stays
gapped, as there is no stable value to publish for it.
GetRepositoryEndpoint for format=maven now returns a URL real Maven clients
(mvn deploy, mvn dependency:get, Gradle) can publish to and resolve from
directly, backed by a shared Reposilite sidecar container started lazily on
first use. A CodeArtifact repository maps to its own Reposilite repository,
provisioned automatically and never reused even across delete/recreate of a
same-named repository, so a fresh repository can never inherit a previous
one's artifacts.
Adds GetAuthorizationToken (a token scoped to a domain, with the 900-43200s
custom range; 0 falls back to 12 hours) and requires it on every Maven proxy
request, either as the password of HTTP Basic credentials, the form AWS's
Maven guide configures with username aws, or as a Bearer token. Maven
requests are not SigV4-signed, so the region and account come from the token.
Also enforces AWS's 5 GB asset size quota on the Maven endpoint, matching the
existing PublishPackageVersion check. Artifacts do not survive a Floci
restart; the service page documents this as a known limitation.
A user pool client created without ExplicitAuthFlows was treated as allowing every auth flow, where AWS defaults such a client to ALLOW_REFRESH_TOKEN_AUTH, ALLOW_USER_SRP_AUTH and ALLOW_CUSTOM_AUTH. USER_PASSWORD_AUTH against a no-list client succeeded on Floci and is refused on AWS.
Apply that default at auth time, in the existing gate added by #3974. CreateUserPoolClient, UpdateUserPoolClient and DescribeUserPoolClient keep storing and returning exactly what was normalized, empty when unset, matching AWS: Terraform's Cognito acceptance tests confirm the empty read-back for both an omitted list and an explicit empty one, and materialising the default into storage would fail Terraform apply with an inconsistent-result error.
Tests and compatibility fixtures that created a no-list client and then signed in with a flow outside the default now enable that flow on their client.
Adds SessionCredential.ecsTaskArn and IamService.registerEcsTaskRoleSession/
sweepOrphanedEcsTaskRoleSessions, mirroring the EC2 instance-session pattern
(registerEc2InstanceSession/sweepOrphanedEc2InstanceSessions): a task-role
session lives in the same session store as any other temporary credential,
tagged by the exact task ARN it was minted for, and none of it survives a
Floci restart since no ECS task does either.
Nothing calls these yet. First piece of ECS task-role credential vending,
split out on its own since the rest (the credential issuer, its endpoint,
and how tasks reach it) is substantial enough to review in separate pieces.
TagInstanceProfile and UntagInstanceProfile already existed; the read side
was missing. Mirrors ListUserTags's response shape, and sorts the result
by tag key to match the documented AWS behavior.
Also adds the instance-profile tag actions to AwsQueryController's
IAM_ACTIONS fallback set, completing the Tag/Untag/List triple already
present there for users, roles and policies.
Covers the trio in the SDK compatibility suite (compatibility-tests),
which previously had no instance-profile tagging coverage.
Bind-mount the hot-reload host directory at /var/task read-only, as /var/task is in AWS Lambda, and, when no allow-list is set, refuse the host root, /var, /proc, and anything under /run or /var/run, where the Docker socket lives or can be reached. Move the no-allow-list warning onto StartupEvent, beside NetworkExposureGuard, so it reaches an operator who has not called Lambda yet.
An application in an ECS task, the AWS SDK integrations that read task
identity, and the aws-for-fluent-bit init process all expect
ECS_CONTAINER_METADATA_URI_V4 to resolve. Under Floci it was never set,
so any of them fell back or failed.
AWS serves the endpoint on the link-local address 169.254.170.2, which a
local container cannot be given. Floci serves the same paths on its own
port instead: clients read the environment variable rather than the
address, so nothing has to know the difference.
The id is minted per container before the container is created, the way
the ECS agent mints one, because the container's own environment has to
carry the URI and so it cannot be derived from the Docker id the daemon
returns afterwards. EcsService.findByMetadataId resolves an id back to
its container and task.
The task document carries Cluster, TaskARN, Family, Revision, the
statuses, Limits in vCPUs, the pull timestamps, AvailabilityZone,
LaunchType, ServiceName for a service's task, VPCID for an EC2 task,
and, on Fargate, ClockDrift and EphemeralStorageMetrics. Floci has no
clock drift and does not meter the disk, so those report a synchronized
clock and zero usage. An awsvpc container's Networks object describes
the task ENI and the subnet it sits in; a local ENI has no DHCP option
set behind it, so the gateway, the resolver and the search domain are
derived the way a real VPC assigns them.
The stats paths read the daemon when the request arrives and return
Docker's own ContainerStats document, plus the network_rate_stats the
agent adds. Docker reports cumulative counters only, so the rates are a
delta across two consecutive samples, which is also why AWS documents a
container as having to run for about a second before its stats appear. A
container with no running Docker container behind it reports an empty
document rather than an error.
Because that pair costs a collection tick, task/stats samples the task's
containers in one pass: every stream is opened before any of them is
waited on, and the waits share one deadline. A sidecar polls that path
for network metrics, so the response has to cost about one tick however
many containers the task has, not one tick per container.
TagResource, UntagResource and the Create* operations accepted any number
of tags with keys and values of any length. Match the AWS WAFv2 contract:
at most 50 tags per resource (WAFLimitsExceededException), keys of 1-128
and values of up to 256 characters restricted to the documented character
set (WAFInvalidParameterException with Field/Parameter/Reason).
Closes#4035
The current CloudFormation registry schemas changed the readOnlyProperties
of six resource types, and CfnSchemaCoverageTest, which only runs where the
schema corpus is present, has failed against them since.
AWS::Events::Rule now declares RuleName, and AWS::RDS::DBSubnetGroup and
AWS::RDS::DBParameterGroup declare DBSubnetGroupArn and DBParameterGroupArn.
The provisioners set all three; until now Fn::GetAtt on them resolved to the
literal LogicalId.Attribute string. The two RDS models already carry the ARN.
AWS::RDS::DBInstance now declares StorageOperationStatus and
StorageOperationPercentProgress, which Floci does not emulate, so both are
recorded as gaps. AWS::CertificateManager::Certificate and
AWS::Route53::RecordSet no longer declare Id, so their gap rows go.
AWS::EKS::Nodegroup Ref returned the bare nodegroup name, but AWS returns the
composite "<clusterName>/<nodegroupName>" id. Publish that as the physical id
(Ref) and the readOnly Id attribute, and drive delete from the stored
ClusterName and NodegroupName attributes rather than parsing the physical id.
Removes the EKS Nodegroup Id gap row now that the attribute is set.
Comment-only cleanup of the CloudFormationResourceProvisioner thin dispatcher,
no behavior change:
- Replace the last 5 em-dashes in method comments with commas, per the docs
style rule (no em-dashes anywhere).
- Drop the stale and mislabelled section headers the per-service migration left
behind (the empty CloudWatch Logs / Auto Scaling / EKS / Pipes headers, and
the ApiGateway (V1) / CloudFront headers that no longer head that code), and
reposition the single Helpers header above the actual private helpers.
On UpdateStack the EC2 Instance provisioner kept a reused instance unchanged,
ignoring mutable property edits and never replacing on a createOnly change.
- Reconcile InstanceType and SecurityGroupIds in place on a reused instance via
ModifyInstanceAttribute / ModifyInstanceGroups. UserData and IamInstanceProfile
have no in-place Ec2Service path yet, so they stay a follow-up.
- Force replacement on a changed PrivateIpAddress or AvailabilityZone. Both are
createOnly and are not applied to the instance at launch, so the change is
detected against the value declared on the previous provision and recorded on
the resource, not the instance's auto-assigned value. A property with no
recorded prior value is not treated as a change, so adopting this does not
replace instances whose template did not actually change.
S3CfnProvisioner translated CorsConfiguration and VersioningConfiguration
and nothing else, and AWS::S3::BucketPolicy took a physical id and stopped,
so a stack reported CREATE_COMPLETE for a bucket with no lifecycle, no
public-access block, no default encryption, no tags and no policy.
PublicAccessBlockConfiguration, LifecycleConfiguration, BucketEncryption
and Tags are now translated into the XML their S3 API calls take and handed
to the same service methods, so they are validated and stored exactly as a
direct PutBucket* would be. The policy document has its intrinsics resolved
and is put on the bucket.
The policy's physical id is the bucket name, as the registry schema's
primaryIdentifier declares, and deleting the resource removes the policy,
tolerating a bucket the stack already deleted. The class javadoc names the
properties that are covered and those still dropped.
Closes#3947
AWS::IAM::User now applies its declared Tags on create and reconciles them
on update (added, changed and removed keys against the prior set), restoring
the prior tags through CfnRollback on failure.
Closes#3998
When a nested stack fails with no status reason of its own, as after an
UPDATE_ROLLBACK_COMPLETE, the parent's ChildStack event now says the
nested stack rolled back or failed with its terminal status instead of
"failed: null". Cover the changeset create and update rollback paths,
asserting the parent's ResourceStatusReason, and restore the @Test on
the nested-output regression test.
Add a deterministic regression test: a nested stack resource that
fails to create must roll the parent back rather than report
CREATE_COMPLETE with its Fn::GetAtt output left as the raw literal.
It fails on the pre-#3609 matching logic and passes on main.
#3609fixed#3854. The volatile on Stack.status stays as a documented
invariant (the deploy thread writes status last); it is not the fix.
Refs #3854
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
The WAFv2 API reference documents WAFNonexistentItemException with HTTP
status 400, but WafV2Service raised it with 404 at every throw site
(resource lookups by id/name, ARN lookups for tags, logging configuration,
permission policy and web ACL association). Align all seven sites with the
documented status and cover the ARN-based lookups in the integration test.
Closes#4034
Signed-off-by: Matheus André <matheusandr2@gmail.com>
Build the stored and mounted hot-reload path from its segments joined with a forward slash, so a JVM whose default separator is a backslash does not hand Docker a path it cannot use.
* feat(eks): serve pod identity credentials on 169.254.170.23
* fix(eks): safely handle cluster arn and initialize test cluster in pod identity integration test
* test(eks): configure fixed test port for pod identity docker integration test
* fix(eks): isolate pod routing and restore webhook timeout
Add ContainerSpec.linkLocalIps and ContainerBuilder.withLinkLocalIp so a
container can be given link-local IPv4 addresses on its Docker network
endpoint. docker-java does not expose NetworkingConfig on create, so the
endpoint is reconnected with LinkLocalIPs while the container is still in
the created state, before it starts. A failed attach removes the container.
Taken from #2987, adapted to the current ContainerSpec and create flow.
Co-authored-by: jkvw-del <j.kvw@mejortechnologies.com>