Implement DnsRecordSource SPI via Route53DnsRecordSource to decouple Route 53 resolution from EmbeddedDnsServer. Add DnsLookupHelper in core.common.dns for external IPv4 resolution via upstream forwarders with system fallback, shared by Route53DnsRecordSource for CNAME and ALIAS chasing. Discover private hosted zones via Route53Service and support in-zone chasing, built-in Floci suffixes, and EC2 internal names. Authoritatively resolve A records within private zones to prevent upstream query leakage. Wire EKS cluster containers to embedded DNS via specBuilder.withEmbeddedDns().
An MQTT publish ran every matching topic rule action on the Vert.x event loop serving the connection before fanning the message out, so a slow action stalled every client on that loop and delayed delivery to subscribers.
The broker now stores the retained message, records the publish, sends the PUBACK and fans out on the event loop, and hands topic rule evaluation to a single-thread worker executor of its own. IoT Data Publish still evaluates its rules before it returns. At most 1,000 evaluations are pending; beyond that a publish is still delivered but its rules are skipped, with one warning until the backlog drains. A state reset or a broker shutdown skips the rules still waiting, and an MQTT publish received during the reset or while the broker is stopped runs none.
* fix(elbv2): probe the target group's HealthCheckPort instead of always the traffic port
The health checker always probed each target on its traffic port, so a target
group whose HealthCheckPort names a separate port (an app serving traffic on
one port and its health endpoint on another) was marked unhealthy even though
its health endpoint answered. AWS probes HealthCheckPort when it is a port
number and the target's own port when it is traffic-port, the default.
Health state stays keyed by the traffic port either way.
* fix(elbv2): reject a HealthCheckPort that is not traffic-port or a port from 1 to 65535
* fix(cognito): fire PreTokenGeneration when the token endpoint redeems a code
Managed login and federated sign-in both mint their tokens at
POST /oauth2/token, which called generateAuthResult directly and so never
invoked the pre token generation trigger. A pool whose trigger adds claims
got them from InitiateAuth but not from a hosted-UI sign-in, so an
application that authorizes on a custom claim rejected every token a browser
obtained while the same user's tokens from InitiateAuth were accepted.
Redemption now mints through a hosted-auth path that fires the trigger with
triggerSource TokenGeneration_HostedAuth, which is what AWS uses for a
sign-in through the hosted UI, for a pool's own users and federated users
alike. The authorization request's nonce is applied after the trigger's
claims so a trigger cannot displace it; AWS likewise does not let this
trigger override nonce.
* fix(cognito): pass the requested scopes to the hosted-auth trigger
Review feedback. The authorization code stores the scopes the authorize
request asked for, but the hosted-auth trigger call sent an empty list, so a
V2 lambda that branches on requested scopes had nothing to branch on. Thread
the code's scopes through to the trigger event. The other call sites keep
sending an empty list, which is what their non-OAuth flows carry.
Also replace the em-dashes in the new comments, per AGENTS.md.
* fix(cognito): narrow the trigger's scopes to the client's allowed set
Review feedback. An authorization request names its own scopes and nothing
checks them against the client's AllowedOAuthScopes when the code is issued,
so a stored code can carry a scope the client may not use. Passing those
straight through meant a V2 trigger could grant claims, or add scopes, from a
scope the client was never entitled to request.
The hosted-auth path now narrows the requested scopes to the client's allowed
set before the trigger is told about them, dropping the rest the way AWS
ignores a scope that is not associated with the client. The narrowing lives in
the service method rather than at the call site, so every caller gets it.
* style(cognito): brace the new conditionals
Review feedback. AGENTS.md requires braces in all conditionals, and the four
early returns in the claims-merge helpers omitted them.
A presigned POST was authorized against the signing principal's identity
policies alone, so a same-account caller that only the bucket policy named was
denied. The IAM filter now resolves the applicable resource policies on that
path too, letting either policy provide the grant while an explicit deny in
either still wins and cross-account access still requires both.
That resolution now also carries the global condition keys
(aws:PrincipalAccount, aws:ResourceAccount, aws:RequestedRegion) filter()
already supplies for every other enforcement path, instead of only
aws:PrincipalArn, so a conditional bucket-policy statement is judged
consistently between the two enforcement paths.
Per-action, header-derived keys (s3:RequestObjectTag/* from x-amz-tagging)
are deliberately not resolved here: a presigned POST's outer HTTP headers are
not covered by its signed policy document and do not correspond to any tag
S3Controller actually applies to the object, so trusting one would let a
caller satisfy a tag-scoped grant condition without the object ever carrying
that tag.
Closes#4243
Signed-off-by: Matheus Oliveira <matheus.6148@gmail.com>
Add DynamoDbRuntime and a DynamoDbBackendLifecycle seam so the emulator lifecycle starts, resets and stops only the selected backend.
Native start initializes the engine before persisted stream consumers and schedules the TTL sweep, which never ran because its bean was unused.
Reset gains a checkReset preflight that runs before anything is stopped or cleared, and native reset now drops streams, item caches, idempotency tokens and forwarder queues.
Reset also pauses the TTL sweep and waits out in-flight zero-ETL writes before Floci storage is cleared.
Shutdown stops the Lambda DynamoDB poller, the Redshift zero-ETL consumer and the Kinesis forwarding drains before the final flush, and the Redshift consumer is now Resettable.
* fix(cloudformation): delete UPDATE_FAILED resources on DeleteStack
A failed update whose rollback cannot restore a resource leaves it
UPDATE_FAILED with its physical id and the stack in
UPDATE_ROLLBACK_FAILED. DeleteStack only walked CREATE_COMPLETE,
UPDATE_COMPLETE and DELETE_FAILED resources, plus UPDATE_FAILED ones
whose provisioner opted in, so every other failed resource was skipped
without an event and the stack still reached DELETE_COMPLETE, leaving
the role, log group or bucket behind.
Delete every UPDATE_FAILED resource that has a physical id. Delete a
CREATE_FAILED resource only when the provisioner marked its entity as
created by the stack, as the create rollback does, since a failed
create can name an entity that existed before.
Closes#4467
* test(cloudformation): clean up the outside log group when the test fails
* docs(cloudformation): list the resource statuses DeleteStack deletes
* fix(cloudformation): mark a failed nested stack the operation created as stack-owned
A nested stack whose child fails during creation came back CREATE_FAILED
with the child's stack id but no ownership marker, so neither the create
rollback nor DeleteStack deleted the child stack.
* test(cloudformation): clean up the stack, role and log group when the test fails
* docs(cloudformation): update the hasPendingRollbackCleanup javadoc now that DeleteStack no longer calls it
* fix(cognito): expire auth challenge sessions
InitiateAuth and RespondToAuthChallenge session tokens for SRP, custom
auth, and USER_AUTH never expired, so an abandoned challenge session
lingered in memory forever and could still be completed long after
AWS would have rejected it. Track when each session was issued and
reject expired ones with the NotAuthorizedException Cognito returns
in that case, purging expired entries whenever a new one is created.
AWS defaults AuthSessionValidity to 3 minutes (configurable 3-15 via
CreateUserPoolClient); UserPoolClient does not yet store a per-client
override, so every client uses the 3 minute default for now.
* fix(cognito): stamp custom auth tokens when they are issued
A CUSTOM_AUTH session's issue time was recorded before the
DefineAuthChallenge and CreateAuthChallenge triggers ran, so a slow
trigger shortened the session handed to the client. The issue time
also lived on the flow state shared across rounds, so minting the next
round's token refreshed the old token while it was still in the map.
Each custom auth token now carries its own issue time, stamped when it
is stored, and every issuance path (including both continuations)
purges expired tokens first.
* style(cognito): brace the custom auth session lookup
* test(cognito): use the shared MutableClock
* docs(cognito): document auth challenge session expiry
* chore: rerun CI
* chore: rerun CI
* fix(rds): honor requested port when restoring a cluster snapshot
Reserve an explicit RestoreDBClusterFromSnapshot port for the cluster endpoint and proxy, validate its AWS range, and reject local port collisions. Keep automatic allocation when Port is omitted.
* fix(rds): keep requested ports within published proxy range
* fix(rds): reject occupied requested ports and preserve handler calls
Subscribe checked only that an http/https endpoint carried a matching scheme, then Floci posted the SubscriptionConfirmation and every notification to it. An unauthenticated Subscribe therefore turned the emulator into a blind request forwarder against addresses only it can reach.
Resolve and screen the endpoint at Subscribe, which is where a name can be judged. At delivery, screen only an endpoint that names an address outright, which reaches a subscription stored before Subscribe began refusing them and costs no lookup. Deliberately no second resolution there: HttpClient resolves the name again when it connects and cannot be given the result of a check, so a lookup could never decide where the request goes.
Loopback and private ranges stay allowed, since delivering to a neighbouring container is the normal case, and a host that does not resolve yet is accepted as it is on AWS.
* refactor(dynamodb): add a stream reader and key native streams by table ARN
DynamoDbStreamReader is the engine-neutral way to read DynamoDB Streams.
DynamoDbApiStreamReader implements it over the selected DynamoDbOperations using the Streams wire API.
Native streams were keyed by region and table name, so same-named tables in two accounts shared one stream.
They are now keyed by table ARN, and ListStreams returns only the caller's account and region.
Streams of every account are restored from persisted tables at startup.
* refactor(dynamodb): move stream consumers onto the stream reader
The Lambda DynamoDB Streams poller reads through DynamoDbStreamReader: each tick renews iterators from committed progress for every readable shard, and reads a child shard only after its parent was read to its end.
It discards restart checkpoints only for a process-lifetime engine, and pins LATEST per shard via newestSequenceNumbers, replacing DynamoDbStreamService.latestSequenceNumber.
A read fills a batch from as many GetRecords calls as it needs, so a batch is not cut at the 1000 record GetRecords maximum.
EventBridge Pipes reads DynamoDB streams the same way, committing a batch only once it is delivered or sent to the DLQ, delivers the AWS stream record shape with eventSourceARN, and honors LATEST.
The Redshift zero-ETL consumer reads the same way, keeping per-shard progress in the integration (legacy checkpointSequenceNumber is ignored on load) and committing a batch only after it is written to the landing table.
It discards that progress at startup for a process-lifetime engine, and the writer now takes AWS stream records, so Redshift no longer uses DynamoDbStreamService or DynamoDbStreamRecord, whose SHARD_ID is now package-private.
Glue had no triggers: CreateTrigger and the rest answered InvalidAction.
Add CreateTrigger, GetTrigger, GetTriggers, ListTriggers,
BatchGetTriggers, UpdateTrigger, DeleteTrigger, StartTrigger and
StopTrigger.
StartTrigger runs an ON_DEMAND trigger's actions. An activated
CONDITIONAL trigger fires when a watched job run or crawl finishes in
the named state, evaluated after every Glue request, so a chain of
triggers completes within the request that starts it when runs finish
at once. Runs started by a trigger carry its TriggerName. SCHEDULED
triggers are stored and can be activated but do not fire on a timer.
Part of #4380
A number literal written with an exponent (1e5, 1E-3) or an integer beyond 64 bits failed to parse, so in the default lenient mode the rule fell back to a passthrough that ignored WHERE, and in strict mode CreateTopicRule was rejected.
The tokenizer now reads an optional exponent and such literals become decimals, following the JSON number syntax AWS IoT SQL uses for literals.
* fix(lambda): support async retries and dead-letter queue (DLQ)
- Add retry loop honoring MaximumRetryAttempts and MaximumEventAgeInSeconds in LambdaExecutorService
- Deliver original payload and message attributes (RequestID, ErrorCode, ErrorMessage) to SQS/SNS DLQ in AsyncInvokeDestinationRouter
- Give precedence to OnFailure destination over DeadLetterConfig
- Wrap EventInvokeConfig queries in RequestScopes.callAs for correct account partitioning
- Add comprehensive unit and integration tests covering retries and DLQ delivery
Closes#4194
* test(lambda): cover cross-account DLQ delivery
* fix(lambda): add missing async destination test helper
* test(lambda): allow async retry attempts in chain guard test
* fix(lambda): preserve async result on age expiry
A crawler could be defined but never run: StartCrawler answered
InvalidAction and a crawler stayed READY with no LastCrawl. Add
StartCrawler, StopCrawler, GetCrawlerMetrics, ListCrawlers,
BatchGetCrawlers, UpdateCrawlerSchedule, StartCrawlerSchedule and
StopCrawlerSchedule.
Crawls follow the crawler state machine without reading data and are
settled on read, as job runs are;
floci.services.glue.crawler-run-duration-seconds (default 0) can keep a
crawler RUNNING. UpdateCrawler and DeleteCrawler are refused while a
crawl runs, and DeleteCrawler removes the crawl history.
Part of #4380
* feat(backup): configure a vault — access policy, notifications and vault lock
CreateBackupVault worked, and then every write that configures the vault it
just created was unrouted. PutBackupVaultAccessPolicy, PutBackupVaultNotifications
and PutBackupVaultLockConfiguration all matched no route, so a vault could be
created but never given a policy, a lock or a notification target — which is most
of what a vault is configured for.
The two GET paths already existed as deliberate stubs that always threw
ResourceNotFoundException, on the reasoning that these are "never-configured" in
the emulator. That error contract was right and is kept for the genuinely
unconfigured case; what was missing was any way to configure one.
Adds the three PUTs, the three DELETEs, and real read paths for the two GETs:
PUT|GET|DELETE /backup-vaults/{name}/access-policy
PUT|GET|DELETE /backup-vaults/{name}/notification-configuration
PUT|DELETE /backup-vaults/{name}/vault-lock
Details worth knowing:
- Vault Lock has two modes and the difference is the point of the feature. With
ChangeableForDays the lock is governance mode: LockDate is set that far ahead
and the lock stays removable until then. Without it the lock is compliance
mode, immutable immediately. Modelling only the first would make a compliance
lock look reversible, which is exactly the property a caller sets one to get.
A locked vault also refuses DeleteBackupVault.
- The lock fields live on BackupVault because AWS returns them from
DescribeBackupVault. The access policy and notification configuration do not:
AWS exposes each only through its own Get, so they are held in their own
stores rather than as vault fields, which keeps DescribeBackupVault from
growing members real AWS does not send. Locked is a primitive so it is always
present, matching AWS and letting a client tell "not locked" from "not
modelled".
- BackupVaultEvents outside the documented set are rejected rather than stored.
An emulator that accepts a misspelt event and echoes it back lets a config
real AWS refuses pass a local test.
- Deleting an unset policy or notification configuration is a no-op, so a
Terraform destroy re-run does not fail, and both sub-resources are dropped
with their vault so a recreated vault of the same name does not inherit them.
Reported as #4103, found by running the Gruntwork Terraform corpus against
Floci: four roots in terraform-aws-data-storage fail on this and nothing else.
Tests: 16 new integration cases covering both lock modes, the round-trips, the
rejected event, the idempotent deletes and the recreate-under-the-same-name case.
61 Backup-related tests pass.
* fix(backup): correct the vault lock modes, the delete rule and the event list
Three corrections from review, all of them cases where the first version of this
branch was confidently wrong about AWS.
1. THE TWO LOCK MODES WERE INVERTED. ChangeableForDays PRESENT means compliance
mode — a lock date that far ahead, immutable on and after it. ABSENT means
governance mode — no lock date, removable at any time. The reference says so
directly: "If this parameter is not specified, you can delete Vault Lock from
the vault using DeleteBackupVaultLockConfiguration or change the Vault Lock
configuration using PutBackupVaultLockConfiguration at any time." The previous
revision had it the other way round, which turned AWS's freely removable
governance lock into a permanent one and its vault into an undeletable one.
2. A LOCK NO LONGER BLOCKS DELETING THE VAULT. A lock protects the recovery
points, not the vault shell: AWS deletes an empty vault even under a compliance
lock, and the pre-existing non-empty check is already the case AWS refuses. The
added check could therefore only ever fire where AWS succeeds — and it reached
outside this service, since BackupVaultCfnProvisioner deletes vaults during
stack teardown and tolerates only not-found.
3. THE EVENT LIST WAS 17 OF 30. Missing CONTINUOUS_BACKUP_INTERRUPTED, the three
RECOVERY_POINT_INDEX* values, the three EKS_* values and the six ACCESS_POINT_*
values. Since unknown values are rejected with 400, each missing one failed an
apply that AWS accepts. Rejecting is still right; the data was stale.
The tests asserted the inverted lock behaviour, so the suite could not have caught
any of this. Both modes are now pinned separately and in opposite directions, and
the gaps review named are covered: the cooling-off floor, the retention floors,
reconfiguring a governance lock in place, deleting an empty locked vault, the
object-bodied Policy branch, and the notification store being dropped with its
vault.
66 Backup-related tests pass, including the CloudFormation provisioner suites.
* style: use -- rather than an em dash in added prose
AGENTS.md forbids em dashes in all content and the conformance check flags
them. Five in lines this branch added, across the service, the notifications
model and the docs page. Upstream lines that already carry one are left alone.
* fix(backup): reject a non-integral vault lock retention instead of coercing it
longOrNull used JsonNode.asLong(), which silently accepts anything: 1.5
truncates to 1, true becomes 1, and the string "7" parses to 7. AWS rejects a
non-integral value for a long-typed member, so the emulator was letting a
request AWS refuses succeed against a number the caller never sent, and a
retention floor could be set from it.
Rejects with InvalidParameterValueException instead, matching the existing
shape in KinesisJsonHandler#optionalMaxRecordSize and
TimestreamInfluxDbValidation, which both refuse on !isIntegralNumber().
Found by Greptile on fork PR #16. Covered by a test that drives all three
coercions and requires each to 400.
* style(backup): import ChronoUnit instead of naming it inline
AGENTS.md requires used classes to be imported unless there is a genuine name
collision, and putBackupVaultLockConfiguration spelled
java.time.temporal.ChronoUnit.DAYS in full. There is no ChronoUnit collision in
this file.
Found by Greptile on fork PR #16, in its first review that saw the real 6-file
diff rather than the 132 files a stale base had been handing it.
* fix(backup): reject a retention value too large to represent, and free the order clash
Two follow-ups from review of the previous commit, both of which it got wrong.
THE COERCION CLASS WAS NOT CLOSED. isIntegralNumber() alone still let one
through: 99999999999999999999 IS an integral number, and longValue() truncates
it to 7766279631452241919, which then passed the retention checks as though the
caller had sent it. That is the same silent-acceptance the commit claimed to
fix, one rung up. Now guarded with canConvertToLong() as well, matching
KinesisJsonHandler#optionalMaxRecordSize, which pairs isIntegralNumber() with
canConvertToInt() for exactly this reason.
Proved by weakening the guard and running the ordered class: exactly one
failure, lockRejectsANonIntegralRetention, "Expected status code <400> but was
<204>" -- the vault lock silently set from the truncated number. Running that
test alone is not a valid control here: it 404s on a vault the earlier ordered
tests create, so it fails for the wrong reason and proves nothing.
THE NEW TEST REUSED @Order(136), already held by the retention-floor test.
Harmless in effect, since both only make requests that 400, but their relative
order was unspecified. Moved to the first genuinely free number rather than the
next one along, which was also taken.
* fix(backup): bound every Vault Lock day value at AWS's documented 36,500
AWS: "It must be a number no less than 3 and no greater than 36,500; otherwise,
an error will return." Only the floors were checked, which left two holes from
one root cause.
MinRetentionDays=40000 was accepted here and refused by AWS. That is the shape
this corpus exists to find: a Terraform configuration with changeable_for_days
= 40000 applies locally and fails for real.
Worse, Long.MAX_VALUE is a perfectly good long, so it survived the integral
check added in 5e1bed0ef -- that commit fixed representability, not the
documented range -- and reached Instant.plus(value, DAYS), which throws
ArithmeticException: long overflow. The only ExceptionMapper in the tree handles
AwsException, so it escaped as HTTP 500 rather than the documented 400. Bounding
the value makes the overflow unreachable rather than catching it afterwards.
The three floor checks become one requireDayRange so the range is stated once.
Both tests fail with the ceiling removed, which is the state before this commit:
the 40000 case and the Long.MAX_VALUE case each go from 400 to something else.
* docs(backup): stop the branch contradicting itself, and clear the order clash
Four corrections from review, all to things this branch introduced.
docs/services/backup.md:15 was changed here to "Delete an empty, unlocked
backup vault", which contradicts :132 ("A lock does not stop the vault being
deleted") and the code, where deleteBackupVault deliberately omits a lock check.
The AWS Vault Lock guide is with :132 and the code: the vault itself can be
deleted if it is empty. Line 15 was the wrong one.
BackupVaultCfnProvisioner's javadoc still said AccessPolicy, Notifications and
LockConfiguration "have no counterpart in the emulated vault". They have
counterparts now, which this branch added. The provisioner still ignores all
three, so a template declaring AccessPolicy reports CREATE_COMPLETE with nothing
attached; that is now stated as a gap in the provisioner rather than implied to
be a gap in the service. Wiring them through is separate work.
The lock log line printed "changeable for null day(s)" on a governance lock,
which is the mode where the value is absent by definition. It now names the mode.
The two tests added in the previous commit took @Order(141), which an existing
test already held -- the same clash 5e1bed0ef had to clear once. They move to the
end as 142 and 143, and the file now has no duplicate order. The pre-existing 140
declared between 136 and 137 is left alone: it executes correctly and moving a
method would be churn.
* fix(backup): accept an absent Policy on PutBackupVaultAccessPolicy
The PutBackupVaultAccessPolicy reference documents Policy as "Type: String,
Required: No", and we refused a request without one with HTTP 400. A call real
AWS accepts therefore failed locally, which is the exact divergence class this
branch exists to catch rather than introduce.
What AWS does with an omitted Policy is undetermined: the reference does not say
whether it clears the stored policy or stores an empty one, and we have not
measured it against real AWS. Clearing is the behaviour chosen here, on two
grounds. It leaves the vault carrying exactly the policy the request carried,
rather than silently retaining one the caller did not send, and the end state is
readable back through GetBackupVaultAccessPolicy, so a caller can tell what
happened. Storing an empty string would make that read return a value that is
not a valid policy document.
Present-but-empty stays an InvalidParameterValueException: an empty string is
supplied and unusable, which is a different fault from not supplying one.
The pinning test at Order(111) now asserts the clear, and it reads the policy
back through a separate GET after Order(110) has written one, so it fails if the
omission is refused and also if it is accepted as a no-op. Order(115) keeps the
old empty-document assertion.
* fix(backup): answer a missing notification parameter with MissingParameterValueException
PutBackupVaultNotifications lists MissingParameterValueException, "Indicates
that a required parameter is missing", in its Errors section, and we answered
InvalidParameterValueException for both an absent SNSTopicArn and absent
BackupVaultEvents. An SDK maps __type onto a typed exception, so a caller
catching the error AWS documents for this case never saw it.
Present-but-empty keeps InvalidParameterValueException, which is the deliberate
half of the distinction: "BackupVaultEvents": [] was supplied and is unusable,
which is not the same fault as not supplying it. A blank SNSTopicArn is now
treated the same way, where before it collapsed into the missing case.
The controller has to carry the distinction too: readStringList answers an empty
list for an absent member, so the service could not tell [] from absent. It now
passes null when the member is missing or null.
No new exception class or mapper was needed. AwsException takes the error code
as a string and jsonType() passes through any code not in its Query-to-JSON
remapping table, so MissingParameterValueException surfaces as HTTP 400 with
__type MissingParameterValueException. The test asserts that on the wire rather
than trusting it.
* fix(backup): quote the real Vault Lock day limits, and drop the invented MinRetentionDays ceiling
Two lines of this branch, one in BackupService and one in the test, attributed a
quotation to AWS that the PutBackupVaultLockConfiguration reference does not
contain: "no less than 3 and no greater than 36,500", presented as a single
ceiling covering every day value. The reference states three separate things,
per field:
ChangeableForDays "you must set ChangeableForDays to 3 or greater" and
"The maximum value you can specify is 36,500 days"
MaxRetentionDays "The longest maximum retention period you can specify is
36500 days"
MinRetentionDays "The shortest minimum retention period you can specify is
1 day", and no maximum at all
The fabricated sentence is replaced by those three, attributed to the field each
one belongs to. No claim about AWS appears here that is not read from the
reference; the floor of 1 on MaxRetentionDays is left in place but is no longer
presented as an AWS citation, because the reference does not state one.
MinRetentionDays no longer carries the 36,500 ceiling. The choice was to drop it
rather than keep it labelled as our own inference: applying an undocumented
maximum refuses a value real AWS accepts, which is the same divergence class the
Policy fix two commits back removed, pointing the other way. Nothing else
depends on the bound. Only ChangeableForDays reaches Instant.plus, so the
overflow the ceiling was also protecting against stays unreachable, and the
min-versus-max cross-check still applies when both are supplied.
requireDayRange takes a nullable ceiling, null meaning the reference documents
no maximum. Order(142) now asserts the ceiling on the two fields that have one
and asserts that MinRetentionDays 40000 is accepted and reads back, so the
dropped bound is pinned rather than merely absent.
* test(backup): pin the canConvertToLong guard with a value that wraps into range
The !n.canConvertToLong() half of the integral-number guard was load-bearing and
untested: deleting it left all 58 tests green. Order(140) fed it
99999999999999999999, which longValue() truncates to 7766279631452241919, and
that is above the retention ceiling, so the range check rejected the request
whether or not the guard was there. The test could not see the difference.
The value is now 18446744073709551623, which is 2^64 + 7: longValue() keeps the
low 64 bits and it wraps to 7, comfortably inside the valid range. Nothing
downstream rejects it, so the guard is the only thing standing between the
request and a lock configured from a number the caller never sent.
Verified by deleting !n.canConvertToLong() from the guard and re-running:
lockRejectsANonIntegralRetention fails, 204 where it expects 400. Restored, it
passes. Production code is unchanged apart from comments.
Also drops "#16" from the Greptile attribution in BackupController. On a fork PR
it is a live reference; reaching floci-io/floci it would auto-link to an
unrelated upstream issue. The comment's worked example is updated to the value
the test now uses.
* test(backup): cover the blank SNSTopicArn rejection, which no test reached
3c4e6321f split a blank SNSTopicArn out of the missing case and gave it its own
InvalidParameterValueException, and nothing exercised it: deleting the
snsTopicArn.isBlank() branch left all 59 tests green, so a vault would have been
configured to notify an empty topic ARN with no test noticing. It was also the
asymmetry with the blank-Policy case, which Order(115) does cover.
Order(122) now sends "SNSTopicArn": "" alongside a valid event list and expects
400 InvalidParameterValueException naming SNSTopicArn, which is the only request
shape that reaches that branch: absent is answered earlier by the missing case,
and a non-blank ARN passes both.
Verified by deleting the isBlank branch and re-running:
notificationsRequireATopicAndAtLeastOneEvent fails on the new case, 204 where it
expects 400. Restored, 59 pass. Test-only change.
* docs(backup): record the three vault decisions that lived only in javadoc
AGENTS.md asks for intentional deviations to be documented, and three of this
branch's user-visible decisions were reachable only by reading the source or the
commit log.
The omitted-Policy behaviour is the one a user is most likely to be surprised
by, and it is written with the same hedge the javadoc carries: AWS's behaviour
is undocumented and unmeasured, and clearing is the choice we took, not an
observed AWS behaviour. It is not upgraded to a measured claim here.
The other two are the MissingParameterValueException versus
InvalidParameterValueException split on PutBackupVaultNotifications, and the
per-field Vault Lock day limits, including that MinRetentionDays deliberately
carries no maximum because AWS documents none.
Documentation only. backup.md is hand-written, not generated, so docs-sync has
nothing to say about it; docs-check passes once this is committed, because its
last gate is git diff --exit-code over docs/.
* docs(backup): stop claiming AWS behaviour the reference does not state
"Deleting an access policy that is not set is a no-op, matching AWS: the
operation is idempotent" was an AWS attribution nobody had read. The
DeleteBackupVaultAccessPolicy reference lists ResourceNotFoundException among
this operation's errors and does not say what an unset policy does, so AWS may
well not be idempotent here. The no-op is kept, described as Floci's choice, and
the reference's silence is stated rather than papered over.
The same audit over everything these commits added turned up five more claims
that outran the reference. None was a fabricated quotation; each asserted an AWS
behaviour inferred from the reference rather than read in it.
Three inferred acceptance from silence: "no documented maximum" was written as
"inventing one would refuse a value real AWS accepts" in BackupService, "stricter
than AWS" in the test, and "would refuse a value real AWS accepts" in backup.md.
An undocumented limit is not an absent limit, so all three now say the bound is
a risk we decline to take, not a measured AWS acceptance.
Two inferred which error AWS picks. The reference names
MissingParameterValueException for a missing required parameter; it does not say
what AWS returns for a parameter that is present and unusable. "AWS answers them
differently" and "an error real AWS would not have returned" are now scoped to
what the reference actually names, with the present-but-unusable half called
Floci's reading.
Comments and documentation only. Verified mechanically: with comments stripped
and blank lines ignored, the executable content of BackupService.java,
BackupController.java and BackupIntegrationTest.java is identical to
3cb81fd41, 524 lines to 524 lines in the service.
* fix(backup): make the vault lock enforce something, and stop accepting values it cannot use
Six review findings on this branch, four of them one shape: state written that
nothing consumed. The lock is the clearest case. PutBackupVaultLockConfiguration
succeeded, DescribeBackupVault reported Locked, and every recovery point the lock
was supposed to protect deleted exactly as before, because deleteRecoveryPoint
read no lock field. getMinRetentionDays and getMaxRetentionDays had zero readers
anywhere in the tree. The lock was decorative.
Both directions of what a lock does now hold. DeleteRecoveryPoint refuses a
recovery point younger than MinRetentionDays while the vault is locked: Vault Lock
"prevents the deletion of recovery points before their retention periods expire".
StartBackupJob refuses a lifecycle whose DeleteAfterDays falls outside
[MinRetentionDays, MaxRetentionDays]: "backup jobs will fail if the lifecycle
policy of the backup plan is outside the vault lock's retention period". The second
is what gives MaxRetentionDays a reader at all, and it matters for the reason this
emulator exists: a configuration pairing a lock with a shorter plan lifecycle used
to apply cleanly here and fail its first backup on real AWS.
Governance mode enforces as compliance mode does, and the docs say so. Real AWS
lets a principal holding backup:DisableGovernanceRetention override a governance
lock; Floci does not model that permission, so it cannot grant the override.
Stricter for that one caller, identical for every other, and the safe direction: a
local test that deletes a protected recovery point and passes would be describing
behaviour that needs a specific permission to reproduce.
Two validation gaps, both the emulator being more permissive than AWS, which is
the one direction that costs a user real time -- it passes locally and the deploy
is where they find out:
- A Policy is now required to parse as a JSON object. The blank check accepted
any other string, so `not a policy` was stored, PUT reported success and GET
returned it unchanged. Syntax only; nothing here evaluates what a policy
grants, and PutBackupVaultAccessPolicy does not list
MalformedPolicyDocumentException among its errors.
- SNSTopicArn must be a JSON string. asText() turned the number 123 into the
nonblank string "123", which passed every present-and-nonblank check and was
stored as the topic. Same coercion already fixed in longOrNull on this branch,
in the other direction, and it gets the same answer.
Vault teardown now removes the sub-resources BEFORE the vault record, and
CreateBackupVault sweeps both sub-resource keys before taking ownership of a name.
There is no transaction across the three stores, so the order is load-bearing:
with the vault removed first, a concurrent recreate could be configured in the gap
and the deletes still to come would erase the new vault's configuration.
Stated plainly because the measurement is unflattering: the recreate test still
passes with the create-side sweep removed, since deleteBackupVault already covers
the sequential path. The interleaving the sweep exists for is not reachable from a
single-threaded HTTP test, so no test pins it. Keeping it is a judgement that the
race is real, not a claim that it is covered. Every other test here was measured
failing with its fix reverted -- four of the six do, and the fifth is the negative
control that must pass either way.
Two findings are documented rather than fixed, in docs/services/backup.md under
Not Yet Supported, because each is its own change and neither belongs in a
sub-resource PR:
- Notification delivery. The configuration is stored and reported; no vault
event is ever published to the topic.
- Access policy enforcement. The policy is stored and reported; no authorization
path consults it. S3 bucket policies are the only resource policies any Floci
service enforces today, so this matches the tree rather than being specific to
Backup. Said out loud because a stored-and-ignored policy is otherwise
indistinguishable from an enforced one.
* fix(backup): key vault sub-resources per vault, and stop an absent lifecycle bypassing the lock ceiling
Both findings from the second review round, and both were mine to own.
**An omitted lifecycle bypassed MaxRetentionDays.** The previous commit returned early
whenever DeleteAfterDays was missing, reasoning that indefinite retention cannot exceed a
maximum. That is backwards: retaining forever is the largest retention there is, so it
exceeds every finite ceiling, and dropping one member from the request was a one-line
bypass of the limit the lock exists to impose. An absent lifecycle is now refused when the
lock sets a maximum, and still accepted when it sets only a minimum, because a floor IS
satisfied by indefinite retention. The scoping is Floci's reading rather than a quotation:
the reference states the rule for a lifecycle outside the window and does not spell out the
absent case.
**The create-side sweep traded one race for a worse one.** Two creates of the same name can
both pass the existence check, so if a policy were applied against the first vault before
the second reached its sweep, the sweep would delete a live configuration while both creates
reported success. Removing a configuration that a caller had just successfully applied is
worse than the stale-record problem the sweep was there to prevent.
So the shared key is removed rather than policed. Sub-resources are keyed per vault
INCARNATION -- vault key plus creation date -- which means a new vault cannot see an old
vault's records, and cleanup for an old vault cannot touch a newer vault's. No sweep, and no
dependence on the order two stores are written in. The delete path still removes the vault's
own sub-resources, now because they are its own rather than because nothing else has claimed
them yet, and still dependents-first so any observable intermediate state is a vault without
configuration rather than a configuration without a vault.
Two vaults of one name within the same second would still collide on the key, which is why
the delete path does its own cleanup rather than relying on the key alone.
Tests: the absent-lifecycle refusal was measured failing with its guard reverted, and
aLockWithOnlyAMinimumStillAcceptsAJobWithNoLifecycle is its negative control -- refusing
there would refuse a request AWS accepts. subResourcesAreKeyedPerVaultIncarnationRatherThanPerName
pins the sequential behaviour and says in the test itself that it cannot pin the races,
which need two interleaved requests and are not reachable from a single-threaded HTTP test.
67 backup integration tests plus both CloudFormation backup suites pass.
* fix(backup): make CreateBackupVault atomic for a name, and take the parser by injection
Three findings from the third round, all correct.
**The sub-resource key was only as unique as the creation date.** Two creates of the same
name racing within one second could both find the name free, both write, and share a
sub-resource key, so the second vault could read configuration applied to the first.
AlreadyExistsException would never have fired either. The key was not the real problem: the
unsynchronised check-then-write was, and AWS's CreateBackupVault is atomic for a name.
Create and delete now hold a per-name monitor, following SecretsManagerService#lockFor and
KinesisService's append locks. That makes the existence check meaningful, which in turn is
what makes the creation date unique per name and the incarnation key sound. The javadoc says
so rather than leaving the key looking self-sufficient, and the delete path still removes its
own sub-resources for a record surviving any other way.
**The ObjectMapper came in through a field initializer**, against the AGENTS.md constructor
injection rule. Taken through the constructor now, like every other collaborator here. No
caller constructs BackupService by hand, so nothing else changes.
**Two tests spelled class names inline** rather than importing them. java.util.Map is
imported and used, and the policy request builds its body with Map.of instead of constructing
an ObjectMapper inline to serialise one string.
67 backup integration tests and both CloudFormation backup suites pass.
* test(backup): wait for a backup job to complete instead of sleeping
Three tests stood a fixed Thread.sleep(2000) in for a wait-on-condition, against a
job-completion-delay-seconds=1 test config. A 2x margin is not a guarantee: on a loaded
runner the job is simply still RUNNING when the sleep expires, and the failure then lands
on the assertion that follows -- State, RecoveryPointArn, or a delete's status code --
none of which is the behaviour under test. That is the worst shape of flake, because it
accuses the wrong code.
awaitJobCompleted polls GET /backup-jobs/{id} for COMPLETED, following the awaitility
idiom already used in 34 files here, AppSyncExecutionIntegrationTest.awaitSchemaSuccess
most closely: atMost 10s, pollInterval 25ms. It returns as soon as the job finishes rather
than always paying the worst case, so the ceiling can be generous without costing time.
The third site was inside a try/catch rather than a bare call, which is why a scan for the
two obvious ones misses it; all three are the same wait and now share one helper. Removing
them also drops two throws InterruptedException clauses.
Measured on this machine, same 67 tests passing either way:
before Tests run: 67, Failures: 0, Errors: 0 -- Time elapsed: 9.569 s
after Tests run: 67, Failures: 0, Errors: 0 -- Time elapsed: 5.922 s
Adds UpdateSAMLProvider, DeleteSAMLProvider, TagSAMLProvider,
UntagSAMLProvider and ListSAMLProviderTags, and adds tags to GetSAMLProvider.
UpdateSAMLProvider re-parses a new SAMLMetadataDocument the same way
CreateSAMLProvider does and replaces the stored entity ID and certificate.
The document is optional on the request: omitting it (metadata == null) is
a no-op, but an explicitly empty one is invalid input, the same as
CreateSAMLProvider already rejects it as; the two are distinguishable at
the wire level and were previously treated the same.
The update replaces the stored provider with a newly built one rather than
mutating the existing, already-published object's fields one at a time:
assertion verification (StsQueryHandler) reads a provider via find() /
findForAccount() without taking providerLock, so setting entityId and
certificate as two separate writes on the live object could let it
observe one field updated and the other not. Publishing a fully-built
replacement through the same ConcurrentHashMap-backed store means any
reader, synchronized or not, sees either the old provider intact or the
new one intact, never a mix.
DeleteSAMLProvider's existence check now runs inside the same lock as the
delete itself, not before it: two concurrent deletes could otherwise both
pass the check before either removed the provider, so the second returned
success instead of NoSuchEntity, and a delete racing a recreate of the
same ARN could remove the newly created provider instead of the deleted
one.
DeleteSAMLProvider itself does not check or update any role whose trust
policy still references the provider's ARN. This corrects an assumption
from the original gap-report plan (which expected a delete-blocked-while-
referenced check, by analogy with DeletePolicy's attachment guard): AWS's
own docs say the opposite, that deletion always succeeds and it is a later
AssumeRoleWithSAML against the now-dangling ARN that fails, not this call.
GetSAMLProvider and ListSAMLProviderTags both sort their tags by key,
matching AWS's own documented behavior for both, which the same wording
in ListInstanceProfileTags's docs already established the precedent for.
Also completes AwsQueryController's IAM_ACTIONS fallback set for every
SAML provider action, including the three pre-existing ones
(ListSAMLProviders, CreateSAMLProvider, GetSAMLProvider), none of which
were there before, and adds SDK-client coverage for the whole SAML
provider lifecycle to compatibility-tests/sdk-test-java/IamTest.java,
which (like the three pre-existing SAML actions) had none.
* fix(redshift): accept s3table log destination and reject mutual snapshot restore params
Closes#4242
* fix(redshift): preserve S3-table logging configuration and report status
Pass S3TableKmsKeyId and S3TableGranularity through EnableLogging, store them on Cluster, and serialize S3Tables in LoggingStatus responses.
* fix(redshift): validate S3-table logging settings
* fix(redshift): complete S3 table logging status
* refactor(dynamodb): route wire operations through a backend seam
Rename the native wire handlers to NativeDynamoDbJsonHandler and NativeDynamoDbStreamsJsonHandler.
Add DynamoDbOperations as the raw operation seam, plus typed DynamoDbItemAccess and DynamoDbTableAccess contracts.
Add NativeDynamoDbBackend behind the seam and DynamoDbBackendSelector as the one immutable selection.
Keep DynamoDbJsonHandler and DynamoDbStreamsJsonHandler as thin entry points that resolve account and region.
Add RequestScopes.callAsChecked and let AslExecutor delegate to it.
* refactor(dynamodb): route Java consumers through DynamoDbFacade
DynamoDbFacade hands out the selected item and table capabilities and is
now the one DynamoDB Resource Explorer provider in place of DynamoDbService.
CloudFormation, Step Functions, the IAM condition context and the Redshift
backfill call it with an explicit scope; the IoT dynamoDBv2 action writes as
the rule's owning account.
A job could be created but never run: StartJobRun and the other run
actions answered InvalidAction. Add StartJobRun, GetJobRun, GetJobRuns,
BatchStopJobRun, ListJobs and BatchGetJobs.
Runs follow Glue's state machine without executing the script. They are
settled on read, so floci.services.glue.job-run-duration-seconds (default
0, succeed at once) can keep a run RUNNING long enough to stop it or hit
MaxConcurrentRuns. DeleteJob also removes the job's runs.
Part of #4380
A DynamoDB Streams mapping created with StartingPosition LATEST is now
pinned after the stream's newest record at creation, so only later
writes are delivered. Previously every mapping without a checkpoint
started from TRIM_HORIZON.
The poll worker now re-reads the stored mapping after its fetch and
skips the batch when the mapping was deleted or disabled meanwhile. An
invocation still running when the mapping is deleted completes, but
its result is dropped: no retry state, no OnFailure destination send,
and no checkpoint write that would re-insert the mapping into the
store. This also covers a state reset racing an in-flight poll.
Refs #4311
* feat(cloudmap): resolve DNS namespaces and register ECS tasks in them
Cloud Map's control plane already accepted namespaces, services and
instances and read them back correctly, but nothing answered DNS for
<service>.<namespace>. A container that registered successfully still
failed to resolve its peers, and the gap only surfaced at application
runtime because every API call looked right.
The embedded DNS server now consults DnsRecordSource implementations
before forwarding a query upstream, and Cloud Map provides one: a DNS
namespace resolves to the AWS_INSTANCE_IPV4 of the instances registered
under it, one A record each. The SPI keeps the direction right, since
core must not import a service. Which instances answer follows Route 53:
the healthy ones while any instance is healthy, all of them when none
is, and at most eight records either way. HTTP namespaces do not
resolve, matching AWS, where they are reachable only through
DiscoverInstances.
An ECS service that declares serviceRegistries now registers each running
task as an instance of the named Cloud Map service, and deregisters it
when the task stops, mirroring EcsLoadBalancerRegistrar. The address is
the task's ENI address on an awsvpc task and the container's Docker
network address otherwise, which is the one a peer container can reach.
Alongside it the instance carries the metadata attributes the ECS
service discovery documentation lists: AVAILABILITY_ZONE, REGION,
ECS_SERVICE_NAME, ECS_CLUSTER_NAME and ECS_TASK_DEFINITION_FAMILY.
serviceRegistries stays raw: registryArn, containerName and
containerPort are the only members anything acts on.
* test(ecs): pin the Cloud Map registration hooks with a docker mode test
EcsServiceDiscoveryRegistrarTest drives the registrar directly, so removing
EcsService's calls to it left every ECS test green. The registration only runs
in docker mode, which the suite mocks out, so nothing covered the wiring.
The new test runs ECS unmocked under a profile, creates a service that declares
serviceRegistries, and drives one reconciler tick to launch a real container. It
asserts the Cloud Map name resolves to the task's ENI address while it runs, and
that stopping the task removes the instance and the answer. Commenting out
either hook fails it: the register hook on the resolve assertion, the deregister
hook on the instance one.
Security-group enforcement goes back to its shipped default of off for the
profile. The suite turns it on and its helper needs rootful Docker, which is a
requirement of security groups rather than of service discovery.
Also corrects the health status deviation note. An instance registered without
AWS_INIT_HEALTH_STATUS starts HEALTHY on AWS too, so the deviation is not the
initial status but that Floci never moves it: AWS registers an ECS task
UNHEALTHY and promotes it once the container health check passes, for a service
that declares HealthCheckCustomConfig.
* fix(cloudmap): retain DNS ownership and ECS registry targets
* fix(cloudmap): keep namespace apex queries authoritative
* style(dns): remove em dash from test heading
GetRepositoryEndpoint for format=npm now returns a working registry
endpoint: real npm/yarn/pnpm clients can publish to and install from it,
proxied straight through to a real Verdaccio instance rather than
reimplemented. Every request needs Authorization: Bearer <token> from
GetAuthorizationToken, matching npm's own _authToken config and, unlike
Maven's HTTP Basic support, Bearer only.
Unlike Reposilite, Verdaccio has no native concept of multiple named
repositories inside one instance, so each CodeArtifact repository gets
its own container instead of sharing one, started lazily on first use
and identified by a fresh id assigned at CreateRepository time so a
repository deleted and recreated under the same name never inherits the
previous one's packages. Each container is started with
VERDACCIO_PUBLIC_URL set to that repository's own proxy URL so package
metadata it returns (dist.tarball) points back through Floci instead of
the container's own internal, client-unreachable address.
VerdaccioSidecarManager implements the RepositorySidecarManager
interface CodeArtifactService already generalized DeleteRepository's
cleanup over, so a deleted repository's Verdaccio container is stopped
and removed the same generic way Maven's Reposilite storage is released.
The per-key container lifecycle (map of running containers, per-key
start lock, health poll, restart-on-unhealthy, stop-all) has nothing
Verdaccio-specific in it, so it is pulled out into PerKeyContainerPool
for a future per-repository sidecar to reuse directly.
CodeArtifactNpmDataPlane is a raw streaming proxy rather than a JAX-RS
controller, since npm's wire protocol has no fixed path shape the way
Maven's GAV layout does; Verdaccio already speaks that protocol
correctly, so this only needs to authenticate the request and forward
it. The publish/fetch integration test replays a real request the npm
CLI sent during manual verification, captured with a tiny Node.js
capture server, so it exercises the exact envelope shape (including a
real gzip tarball attachment) npm publish actually produces; the full
round trip was additionally verified by hand with the real npm CLI
against a live Floci instance.
* feat(rds): add and remove a subscription's source identifiers
SourceIds was write-once. CreateEventSubscription accepts the list and
ModifyEventSubscription has no SourceIds member, so
AddSourceIdentifierToSubscription and RemoveSourceIdentifierFromSubscription
are the only way to change it and neither existed.
Adding an id the subscription already carries is a no-op. The model declares
only SourceNotFoundFault and SubscriptionNotFoundFault for these operations,
so no fault fits a duplicate. Removing an id the subscription does not carry is
SourceNotFound, which is the fault that does fit.
* fix(rds): refuse a missing SubscriptionName as a parameter error
SubscriptionName and SourceIdentifier are both required by the model, and only
the identifier was checked. A missing name fell through to the subscription
lookup and came back as SubscriptionNotFound, telling the caller the
subscription does not exist when the request simply did not name one. The two
required members now fail the same way on both operations.
Also imports assertEquals in the new test rather than qualifying it inline.
* feat(ses): add v2 export jobs
CreateExportJob, GetExportJob, ListExportJobs and CancelExportJob render the
per-recipient timelines already stored at send time as CSV or JSON, through
the same aggregation BatchGetMetricData serves, so an export and a query of
one window cannot disagree.
Real SES writes the file into a bucket it owns and refuses a caller-chosen
S3Url, so Floci does the same and writes into its own S3 emulation, which is
what the presigned URL on a finished job resolves against.
The VDM gate answers BadRequestException here where message insights and
metric data answer NotFoundException, so SesAccountService takes the caller's
error shape and keeps one copy of the probed sentence.
* fix(ses): use the published concurrent-export quota and prove the reset test parks
* fix(ses): scope the export bucket per account and fix two row-count bugs
* fix(ses): make the reset drain test deterministic and document the presigner limit
* test(ses): assert the reset thread finished, since join returns on timeout too
BisectBatchOnFunctionError now splits a batch that fails with a function
error in half, keyed by checkpoint, until the poison record is isolated.
Splits do not consume the retry quota; throttles and partial batch
responses do not split.
A discarded batch whose OnFailure destination refuses the send is parked
at the persisted checkpoint and only the send is retried with backoff,
instead of checkpointing past a batch that was never delivered.
AWS::Lambda::EventSourceMapping now forwards MaximumBatchingWindowInSeconds,
MaximumRetryAttempts, MaximumRecordAgeInSeconds, BisectBatchOnFunctionError,
FilterCriteria, DestinationConfig and ScalingConfig to LambdaService, so a
stack-created mapping matches an API-created one. On UpdateStack each of
these that the template omits is sent as null, which clears it.
ParallelizationFactor and TumblingWindowInSeconds are not modeled and remain
ignored; the resource-type table notes this.
Fixes#4313
* feat(rds): manage event notification subscriptions
CreateEventSubscription, DescribeEventSubscriptions, ModifyEventSubscription
and DeleteEventSubscription were all missing, so the subscription resource
could not be created.
Constraints come from the model. A SubscriptionName under 255 characters, a
required SnsTopicArn, SourceType limited to the documented valid values, and a
SourceIds list that may only be supplied alongside the SourceType its ids
belong to. An omitted Enabled activates the subscription, which the model
describes only in the negative: a subscription that is not activated is
created but not active. Modify applies only the members the request names.
Nothing is published to the topic. A subscription is stored and reported back
and no RDS event reaches SNS through it. The docs say so.
* fix(rds): synchronize the event subscription methods and cite the SourceIds constraint
createEventSubscription checked for a duplicate name and then stored, so two
concurrent creates of the same name both passed the check and the second
overwrote the first with neither caller seeing SubscriptionAlreadyExist. The
four methods are synchronized now, matching the 48 other public synchronized
methods in this file and the find-then-throw-then-store shape of
createDbSnapshot.
The comment on the SourceIds coupling said only that the model states it,
which sent a reviewer to the operation documentation where it is absent. It
now quotes the constraint and says it lives on
CreateEventSubscriptionMessage.SourceIds rather than on the operation.
* fix(rds): keep a rejected modify inert, carry subscription tags, and page the describe
Four findings from the automated review, all confirmed against the model.
ModifyEventSubscription wrote SnsTopicArn before validating SourceType, so a
request carrying a new topic and an unmodelled source type answered 400 with
the topic already changed. The store returns the live instance, so a later
describe reported it. This is the same shape as the Lambda code signing bug in
#4286 and I did not carry the lesson across.
CreateEventSubscriptionMessage has a Tags member that was dropped on the
floor, and resolveTagHandle had no arm for an es: ARN, so a subscription could
neither be created with tags nor tagged afterwards.
DescribeEventSubscriptionsMessage has MaxRecords and Marker, and its output
shape has Marker. None were read or emitted, so a bounded page returned
everything with no way to continue.
The new test used var, which AGENTS.md prohibits, the same thing flagged on
#4286.
* fix(rds): bound MaxRecords and resume paging past a deleted marker
Two defects I introduced in the pagination added last round.
MaxRecords was unbounded. Zero built an empty page and then read its last
element, throwing IndexOutOfBoundsException, and a negative value produced
invalid bounds. The model documents minimum 20, maximum 100, default 100, and
handleDescribeEvents a few hundred lines up already enforces that range. An
omitted value now defaults to 100 rather than returning everything.
The marker resumed by looking for its own name, so a subscription deleted
between calls left the offset at zero and handed back the first page again.
Resuming at the first name strictly greater than the marker is stable under
deletion.
The test used MaxRecords 1, a value the model rejects, so it exercised a page
size real RDS never serves. It now creates 21 subscriptions and pages with 20.
* fix(rds): validate MaxRecords before the named-subscription shortcut
The range check sat after the early return for a named subscription, so a
request naming one alongside an out-of-range MaxRecords succeeded. Request
validation should not depend on which branch serves the read.
* fix(ec2): validate and expire IMDSv2 session tokens
PUT /latest/api/token accepted any TTL and tokens never expired. Require an
integer X-aws-ec2-metadata-token-ttl-seconds between 1 and 21600 (400
otherwise) and reject an expired or unknown token with 401, as IMDS does.
Requests without a token still use IMDSv1.
* test(ec2): use the shared MutableClock in Ec2MetadataTokenTest
Drop the test's private clock in favour of
io.github.hectorvent.floci.testing.MutableClock, which other tests
already share and which starts at the same instant.
* fix(ec2): reject an IMDSv2 token presented from another instance
A valid token won over the caller's IP, so container B presenting
container A's token received A's metadata, credentials included. The
docs say a token is not valid on other instances. Answer 401 when the
caller's IP maps to a different instance than the token's; an
unregistered IP still defers to the token.
* feat(lambda): manage code signing configurations
CreateCodeSigningConfig and its Get, Update, Delete and List siblings were
missing, so aws_lambda_code_signing_config and anything else that manages the
resource had nothing to call.
Adds the five, backed by a store. Constraints come from the model: an id of
csc- plus 17 characters, AllowedPublishers required with one to twenty signing
profile ARNs, a Description of at most 256 characters, and Warn as the default
UntrustedArtifactOnDeployment.
ListFunctionsByCodeSigningConfig now resolves the configuration instead of
answering every well-formed ARN with a 404. That answer was correct only while
no configuration could exist. A known one reports no functions, since
PutFunctionCodeSigningConfig is still not wired.
Nothing verifies a signature, so a configuration never gates a deployment. The
docs say so.
* fix(lambda): register the code signing config model for reflection
PersistedModelReflectionTest flagged it: a type reachable from persisted
storage needs @RegisterForReflection or native-image persistence breaks on
restart. The two nested shapes need it too.
* docs(lambda): name the ARN pattern as the reason the id alphabet is lowercase
The comment credited the id pattern, which is the looser of the two.
CodeSigningConfigId allows csc-[a-zA-Z0-9-_\.]{17} and CodeSigningConfigArn
ends in csc-[a-z0-9]{17}, so the ARN is what binds the alphabet. Anyone
reconciling the code against the old comment could widen it, still satisfy the
id pattern, and start emitting ARNs that do not conform.
Also imports List in the new test instead of writing java.util.List.of inline.
* fix(lambda): mint the code signing config ARN through AwsArnUtils
The ARN was assembled from a hardcoded arn:aws: prefix, so it named the
commercial partition whatever region the request carried. AwsArnUtils resolves
the partition from the region, which is what the partition-literals gate asks
for.
* fix(lambda): validate every member of an update before applying any
The store hands back the live instance, so validating and setting in turn left
an earlier member written when a later one was rejected. An update carrying a
valid Description and an empty AllowedPublishers answered 400 with the
description already changed, visible to the next GetCodeSigningConfig and
saved by the persistent and hybrid stores on their next write.
aRejectedUpdateChangesNothing sends that combination, and the same shape with
the policy as the rejected member, and asserts the description is unchanged
after each. It fails without the reordering.
* test(iot): 128 KB MQTT payloads on every transport, failing
* fix(iot): accept MQTT packets up to the AWS 128 KB payload limit
* test(iot): pin the 146 KB MQTT 5 packet limit with AWS maximum properties
Generates and downloads the account's credential report, the 23 columns
AWS documents for it, in CSV, Base64-encoded per the wire model. The
report is a single value per account, stored the same way accountAliases
and passwordPolicies already are, and regenerated only once the previous
one is older than 4 hours, matching AWS's documented caching window.
CSV content: every IAM user gets real password_enabled, password_last_used,
password_last_changed and access_key_1/2_active/last_rotated where Floci
already tracks that state, plus the documented placeholder values for what
it does not model (MFA devices, X.509 signing certificates, access-key
last-used date/region/service, and password_last_used itself, since
nothing in the codebase ever sets IamUser's passwordLastUsed field). The
root account row is present, as AWS always includes it, but is placeholder
throughout: Floci does not model root account credentials at all, the same
reason GetAccountSummary's AccountPasswordPresent and
AccountAccessKeysPresent are always zero.
password_last_changed needed a new LoginProfile field: UpdateLoginProfile
changes the password without touching LoginProfile's own createDate (its
meaning stays 'profile created'), so reading createDate for this column
would have kept reporting the original creation time after a password
change. passwordLastChanged is set alongside createDate initially and
updated whenever UpdateLoginProfile actually changes the password, falling
back to createDate for a profile persisted before this field existed.
additional_credentials_info is Floci's own wording, since AWS does not
document the exact text; in practice it is unreachable, since
CreateAccessKey already enforces the real 2-key-per-user quota.
Generating a report is effectively instant here, so GenerateCredentialReport
never actually returns INPROGRESS; a GetCredentialReport call right after
it always finds the report ready. The STARTED state and its description
for the no-report-exists case match AWS's own documented example response
verbatim; the report-expired case's wording is Floci's own, since AWS does
not document it.
Aggregates the per-recipient timelines already stored at send time, so the
batch metrics and GetMessageInsights cannot disagree about what a send
produced. Buckets are whole UTC days, the series is sparse rather than zero
filled, the end of the range is exclusive, and counting is per recipient.
SentEmail gains the configuration set the send resolved to, which the
CONFIGURATION_SET dimension filters on. The VDM gate moves into a shared
SesVdmGate so the two gated operations keep one copy of the probed message.
Metrics that need a real mailbox to act stay empty, as does TRANSIENT_BOUNCE,
since every bounce Floci derives is permanent.