mirror of
https://github.com/floci-io/floci.git
synced 2026-11-24 06:20:24 -05:00
48b2139b4fbabb4fb30c71e9963bc78f614fa57f
222
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
7e4e3e8c50 |
feat(mwaa): add Amazon MWAA emulation backed by real Airflow (LocalExecutor) (#2086)
* feat(mwaa): add Amazon MWAA emulation backed by real Airflow (LocalExecutor)
Adds a new services/mwaa package following the EKS lifecycle pattern
(Controller/Service/EnvironmentManager, one Docker container-set per
resource, readiness polling) and the Neptune/ElastiCache proxy pattern
(MwaaWebProxy/MwaaProxyManager: Floci owns the host-facing port, the
backing container stays internal-only).
Each environment is backed by two real containers — postgres:16-alpine
for the metadata DB and apache/airflow:<version>-python3.12 running
LocalExecutor — with AirflowVersion genuinely selecting the image tag
(validated against a configured allow-list), unlike EKS's cosmetic-only
version field. MwaaWebProxy fronts the real Airflow webserver and
intercepts POST /aws_mwaa/cli, bridging it to a docker-exec'd `airflow`
CLI call and returning the documented {stdout, stderr} shape.
DAGs and requirements.txt sync from S3 on a poller, reusing the existing
S3Service in-process rather than a new AWS-facing surface. The Airflow
container is pointed back at Floci via LaunchedContainerAwsEnv (the same
mechanism Lambda/ECS containers already use), so a DAG's own boto3 calls
resolve against Floci instead of real AWS.
StartupScriptS3Path is supported end-to-end: fetched from S3 at create
time, injected before the container starts (create -> inject -> start,
mirroring EksClusterManager's config-injection sequencing), sourced
before migrate/scheduler/webserver so exported vars propagate. The
airflow user gets a passwordless sudo grant (verified against the real
image — sudo ships but isn't passwordless by default, and AWS's own
startup-script examples assume sudo just works), and a fixed set of
Floci-critical env vars (Fernet key, DB DSN, executor, AWS-SDK-redirection
vars) are snapshotted before and restored after the script runs, mirroring
real MWAA's reserved-environment-variable protection.
Verified end-to-end against real Docker (not just the mock=true unit
suite): environment reaches AVAILABLE, proxy pass-through and the CLI
bridge both work with real output, a DAG uploaded to S3 syncs and parses,
a second environment on a different AirflowVersion pulls a genuinely
distinct image, and delete tears down both containers/volumes and the
proxy cleanly.
45 new tests (unit + RestAssured integration, all against mock=true in
the default suite so Docker is never required for `mvnw test`); full
suite otherwise unchanged.
* fix(mwaa): hard-fail startup-script injection failures, release proxy ports on delete
Two issues from review:
copyFileIntoContainer swallowed every failure identically, including the
one case where that's wrong: a configured StartupScriptS3Path that fails
to copy into the container. The entrypoint's "if [ -f /startup.sh ]"
guard would silently skip it and the environment would reach AVAILABLE
having never applied the requested setup, contradicting the documented
intent of gating environment creation on startup-script failure (matching
real MWAA). copyFileIntoContainer now reports success/failure; the
startup-script call site checks it and throws, while DAG sync and the
best-effort sudoers grant keep their existing soft-fail behavior.
deleteEnvironment allocated a proxy port via PortAllocator on create but
never released it on delete, unlike every other service that uses
PortAllocator (Lambda, MSK, EC2, ECR) — repeated create/delete cycles
would eventually exhaust the configured proxy port range even with zero
MWAA proxies actually running.
* fix(mwaa): roll back allocated proxy port and containers on create failure
If startEnvironment() succeeded (containers running) but PortAllocator.allocate
or MwaaProxyManager.startProxy failed afterward, createEnvironment's catch
block set CREATE_FAILED without releasing the reserved port or stopping the
containers that had already started — leaking both on every such failure.
Mirrors NeptuneService.createDbCluster/rollbackDbCluster's already-proven
shape for this exact class of problem (container + proxy + port, partial
failure must roll back everything): a provisioned flag set only after every
step succeeds, and a try/finally that runs rollbackFailedCreate whenever it
doesn't — stopping the proxy (a no-op if it never started), stopping any
containers that did start (MwaaEnvironmentManager.stopEnvironment already
null-checks each container id, so it's safe for partial startup too), and
always releasing the port.
* fix(mwaa): correct CreateEnvironment error shape, namespace container names, add docs
Two items from maintainer review:
- Duplicate CreateEnvironment threw ResourceAlreadyExistsException, a shape the
operation doesn't declare (verified against the real botocore mwaa/2020-07-01
model: CreateEnvironment's only errors are ServiceUnavailableException,
ValidationException, InternalServerException) — SDK clients couldn't map it.
Now throws ValidationException.
- dbContainerName/airflowContainerName built names via raw string concatenation
instead of routing through ContainerStorageHelper.dockerName like every other
Docker-backed service (EKS, RDS, ...), so MWAA alone didn't participate in the
FLOCI_DOCKER_RESOURCE_NAMESPACE convention that keeps multiple Floci instances
sharing one Docker daemon from colliding. Both static methods now take the
EmulatorConfig and route through the shared helper; volume names inherit the
fix automatically since they're built by extending the container name.
Also adds docs/services/mwaa.md (mkdocs nav updated) following eks.md's
structure — operations table, mock/real mode, the web/CLI proxy, startup-script
behavior (sudo grant, reserved-variable protection), config reference, ARN
format, CLI/SDK examples, and an honest "Not Implemented" section covering the
known gaps already discussed on the PR (PluginsS3Path, cross-account container
naming, restart restoration).
|
||
|
|
b543aa4baa |
feat(lambda): support extra /etc/hosts entries on Lambda launch (#2073)
* feat(lambda): support extra /etc/hosts entries via FLOCI_SERVICES_LAMBDA_EXTRA_HOSTS * feat(lambda): support ipv6 addresses. --------- Co-authored-by: Florian Overfelt <joverfelt@meso-scale.com> |
||
|
|
78ba5b3457 | feat(iam): list entities attached to managed policies (#1808) | ||
|
|
aadc93e306 |
feat(rum): add CloudWatch RUM app-monitor service (#1797)
* feat(rum): add CloudWatch RUM app-monitor service
Adds a minimal CloudWatch RUM service (restJson1) covering the app-monitor
lifecycle — CreateAppMonitor, GetAppMonitor, UpdateAppMonitor, DeleteAppMonitor,
ListAppMonitors — backed by an in-memory store.
Previously restJson1 RUM requests (e.g. POST /appmonitor) fell through to the S3
path-style catch-all (@Path("/{bucket}")) and returned an XML error that
restJson1 SDKs (and the CDK AwsCustomResource used for RUM AppMonitor custom
resources) cannot parse. Literal /appmonitor and /appmonitors paths take JAX-RS
precedence over S3's /{bucket} template (the same mechanism eks/mq use), so the
routes win with no extra routing wiring.
Verified with aws-cli 2.33.18 against a dev-mode emulator: CreateAppMonitor
returns an Id, GetAppMonitor/ListAppMonitors round-trip, DeleteAppMonitor then
GetAppMonitor returns ResourceNotFoundException.
* fix(rum): make monitor updates atomic
* fix(rum): align app monitor lifecycle with AWS
* chore: retry flaky Node compatibility check
* fix(rum): address app-monitor review feedback
---------
Co-authored-by: abanna <abanna@users.noreply.github.com>
|
||
|
|
00d59b4963 |
chore: add an advisory open-PR limit notice (#2047)
The review backlog is long enough that a single contributor holding many open PRs makes it harder for any of them to get proper attention. This adds a nudge rather than a gate. On open or reopen, a workflow counts the author's open PRs and, above five, adds an `over-pr-limit` label and posts one comment linking their open PRs. It never closes a PR and never fails a check, both paths exit zero. Bots and maintainers are exempt, so dependabot can hold as many as it needs. The comment is posted at most once per PR via a marker, and the label is removed automatically when the author drops back under the limit. `pull_request_target` is used so the token can label fork PRs. The workflow never checks out or runs PR code, it only calls the GitHub API, so the elevated context is not exposed to untrusted input. The policy is documented in CONTRIBUTING.md and docs/contributing.md. Also drops the CONTRIBUTING.md edge-builds section, which described the `edge.yml` workflow removed in #691 and was the last reference to it, and fixes a stray character in the adjacent CI line. |
||
|
|
02385da37b |
feat(apigateway): support floci:override-id for v1 and v2 (#2045)
* feat(apigateway): support floci:override-id for v1 and v2 API IDs were generated randomly, so endpoint URLs changed on every recreate. v1 accepted an undocumented `_custom_id_` tag and echoed it back as a normal tag; v2 had no override at all. Other services already pin IDs through the reserved `floci:override-id` tag. Both CreateRestApi and CreateApi now accept `floci:override-id`, routed through ReservedTags.getOverride so the value is validated rather than used verbatim: non-blank, no whitespace or control characters, and no `/`, `?`, `#`, since those break the endpoint URL. Override keys are consumed rather than stored, so they no longer appear in the returned tags, and supplying either key to TagResource is rejected because an ID cannot change after creation. `_custom_id_` keeps working as a deprecated fallback and is now stripped the same way; `floci:override-id` wins when both are present so callers can set both during a migration. The key stays API Gateway specific: the shared strip and reject helpers are untouched, so KMS and Cognito still treat `_custom_id_` as an ordinary tag. Error code is BadRequestException, declared by CreateRestApi, CreateApi and TagResource on both services. The shared reject helper's ValidationException is declared by neither, which is why API Gateway gets its own guard rather than reusing it. Closes #1593 Co-authored-by: Marcel Herhold <herhold.marcel@gmail.com> * fix(apigateway): reject duplicate override ids with ConflictException CreateRestApi (v1) and CreateApi (v2) now return 409 ConflictException when the resolved API id already exists in the region, instead of silently overwriting the existing API, matching how KMS and Cognito treat duplicate override ids. --------- Co-authored-by: Marcel Herhold <herhold.marcel@gmail.com> |
||
|
|
86134e8c7f |
docs(cloudwatch): document Logs Insights subset and missing Logs actions (#2044)
docs/services/cloudwatch.md listed 14 of the 24 actions that CloudWatchLogsHandler dispatches. The handler is on the deferred_handlers allowlist in tools/docs/services.yaml, so the table is maintained by hand and had drifted as actions were added. Most notably Logs Insights (StartQuery / GetQueryResults / StopQuery, added in 1.5.31) was undocumented, leaving no way to discover which parts of the query language are implemented. Add the 10 missing actions and a Logs Insights section covering the supported commands, the field syntax, and how each kind of unsupported input degrades: a dropped filter stage returns every row, a >= or <= comparison is mis-parsed into a field name and returns none, a missing projected field becomes an empty string, and an unrecognised sort direction falls back to ascending. Also note the PutSubscriptionFilter and GetDataProtectionPolicy simplifications, document FLOCI_SERVICES_CLOUDWATCHLOGS_QUERY_COMPLETION_DELAY_MS in both the service page and the central environment-variable list, correct the MAX_EVENTS_PER_QUERY description, and add a start-query example. |
||
|
|
881c45b393 |
feat(ses): implement identity (sending authorization) policies for v1 and v2 (#1750)
* feat(ses): implement identity (sending authorization) policies for v1 and v2 Add the SES identity-policy APIs across both protocols, backed by one shared StorageFactory store (key policy::<region>::<identity>::<policyName>): - v1 Query: PutIdentityPolicy (upsert), GetIdentityPolicies, ListIdentityPolicies, DeleteIdentityPolicy (idempotent). - v2 REST JSON: CreateEmailIdentityPolicy (fails on duplicate), GetEmailIdentityPolicies, UpdateEmailIdentityPolicy (fails when missing), DeleteEmailIdentityPolicy. Behaviour and error shapes were verified against real AWS: the per-identity limit of 20, the v1/v2 create/update/delete strictness asymmetry, PolicyName constraints, and the shared v1<->v2 store. Floci stores and returns policies but does not enforce the authorization (Principal-account existence, Resource-ARN match) or gate sending on them. * test(ses): inject policyStore into the test SesService constructor Thread the identity-policy store through the package-private constructors as a parameter instead of hardcoding a new InMemoryStorage, matching every other store and keeping the test constructor aligned with the production wiring. |
||
|
|
836c162136 |
fix(core): stop unknown-service REST requests falling through to S3 (#1967)
* fix(core): stop unknown-service REST requests falling through to S3 REST requests whose SigV4 credential scope names a service Floci does not implement matched no JAX-RS resource and fell through to S3's path-style wildcard routes, surfacing as misleading NoSuchBucket XML and triggering SDK retry storms. Reject them with UnknownOperationException instead. The guard fires only on positive identification: a parseable SigV4 scope naming a service absent from the catalog. Unsigned, presigned, Bearer/Basic and SigV4a requests are untouched. Also declares the EKS read-only sub-resource lists the emulator does not model (ListAccessEntries, ListAddons, ListIdentityProviderConfigs, ListPodIdentityAssociations) as explicit routes, so they outrank the S3 catch-all and answer with each operation's model-exact empty result key, or ResourceNotFoundException for a missing cluster. Closes #1754 * fix(iam): normalise signing-scope aliases before IAM enforcement S3 accepts requests signed under the s3express scope, but IAM action rules, resource ARNs and condition keys are all keyed by the canonical signing name. An alias therefore resolved to no action, which IamEnforcementFilter treats as ALLOW, so policy-protected S3 operations were reachable without a policy check. Resolve the scope through the catalog before enforcement runs. Only aliases are rewritten: a service whose external key is not itself one of its credential scopes (CloudWatch Logs signs as logs) is left unchanged, as is any scope the catalog does not know. Also documents why SigV4a stays outside the unknown-service guard — its credential omits the region segment, so SigV4CredentialScope does not match it — and pins that with a test, since widening the pattern would silently start rejecting SigV4a traffic. Refs #1754 * fix(iot): declare the iot-jobs-data signing scope so its routes stay reachable The IoT Jobs Data Plane (GetPendingJobExecutions, DescribeJobExecution, StartNextPendingJobExecution, UpdateJobExecution) signs under iot-jobs-data while IotController serves its /things/{thing}/jobs routes. The scope was not in the catalog, so the unknown-service guard rejected requests to routes Floci does implement. The Go, Java and Python SDK compat suites all caught it on GetPendingJobExecutions. Audited the other sibling signing names for the same failure mode: ssmmessages, eks-auth, ecr-public, cognito-identity and aoss have no Floci routes, so rejecting those stays correct. Refs #1754 * fix(iam): scope alias normalisation to an explicit table Deriving the canonical scope from the descriptor's external key was wrong: the external key is a routing key, not an IAM namespace. SES routes under email and Bedrock Runtime under bedrock-runtime while their IAM namespaces are ses: and bedrock:, so ses, sesv2 and bedrock were rewritten onto prefixes AWS never issues. Every action would then resolve to null and enforcement would be skipped for those services — the same bypass the s3express fix closed. Replace the derivation with an explicit alias table holding the one case that genuinely shares a namespace, s3express -> s3, and sweep every scope the catalog declares in the test so any future rewrite has to be deliberate. Refs #1754 * fix(core): make the unknown-service guard configurable and verify scope coverage The guard is only as good as the catalog's scope list, and the iot-jobs-data miss showed the list can be wrong. Two changes so that is recoverable and detectable rather than a hard 404 nobody can work around. Gate the rejection behind floci.protocols.reject-unknown-service-scope, matching the other two abort paths in AwsProtocolClaimFilter, which are both already gated. It defaults to true so #1754 stays fixed out of the box; turning it off restores the previous fall-through for anyone blocked by a scope Floci has not enumerated yet. Add CredentialScopeCoverageTest, which walks botocore's models and fails when Floci routes most of a service's operations without declaring the name that service signs with. Removing iot-jobs-data from the catalog makes it fail with 'iot-jobs-data=2/3 routes served'. Thresholds are conservative because small services share generic templates, so it is a tripwire rather than a proof, and it skips where the gitignored botocore checkout is absent (CI runners). Refs #1754 * fix(iam): resolve the iot-jobs-data signing scope to the iot namespace Admitting iot-jobs-data to the catalog let the IoT Jobs Data Plane reach its routes, but IAM enforcement still saw the raw scope. Its policy actions live under iot: (iot:DescribeJobExecution and peers in the Service Authorization Reference), so the scope belongs in the alias table next to s3express. No behaviour change today: IamActionRegistry carries no iot rules at all, so every IoT request resolves to no action and is allowed through regardless. This makes the mapping correct ahead of those rules existing, rather than leaving a scope that would silently escape them. Refs #1754 |
||
|
|
f36598244d |
chore: welcome first-time contributors and surface the Slack invite (#1968)
First-time contributors' pull requests sit with no CI at all until a maintainer approves the workflow runs, and nothing on the PR explains the wait — recent ones went 10 to 12 days before anyone noticed they had never been tested. The Slack invite was reachable only from the bottom of the README (line 785 of 834). It appeared in neither CONTRIBUTING file, the pull request template, nor either issue template, so contributors arriving through those paths never saw it. Add a first-interaction workflow that greets a contributor's first issue or pull request; the pull request message leads with why the checks have not started, so the gate reads as routine rather than as neglect. Surface the Slack invite where contributors actually pass: the new-issue chooser via contact_links, the pull request template, and both CONTRIBUTING files. The workflow only posts a comment and never checks out or executes pull request code, so its pull_request_target trigger does not expose the elevated context. |
||
|
|
024d74e5c4 |
feat(cloudtrail): in-process CloudTrail with S3 data event emission (#1460)
* feat(cloudtrail): in-process CloudTrail with S3 data event emission
New service supporting CreateTrail / DescribeTrails / DeleteTrail /
UpdateTrail / PutEventSelectors / GetEventSelectors / StartLogging /
StopLogging / GetTrailStatus.
S3 ops (PutObject / GetObject / HeadObject / DeleteObject / ListObjects
/ GetObjectAcl) emit CloudTrail data events through a per-trail buffer.
The CloudTrailLogWriter scheduler flushes pending records as gzipped
JSON envelopes into the destination bucket at AWS-shaped key paths
(AWSLogs/<account>/CloudTrail/<region>/yyyy/MM/dd/<file>.json.gz) on
a configurable cadence (default 60s).
IAM-enforcement denials emit matching AccessDenied records by hooking
IamEnforcementFilter. IamActionRegistry now distinguishes
s3:GetObjectAcl / PutObjectAcl / {Get|Put|Delete}ObjectTagging from
their base ops via ?acl / ?tagging query parameters so the right
event names land in the trail.
Seeded AWSCloudTrail_FullAccess / _ReadOnlyAccess managed policies.
* fix(cloudtrail): return LatestDeliveryTime in GetTrailStatus after StartLogging
The sdk-test-java compatibility test asserts latestDeliveryTime() is
non-null immediately after startLogging. Seed it with the startLoggingTime
so the field is always present once logging has been started.
* fix(cloudtrail): emit SnsTopicARN alongside SnsTopicName in CreateTrail/UpdateTrail responses
Accept both SnsTopicARN and SnsTopicName on input (SnsTopicARN takes
precedence). Emit both fields on output so clients reading the current
field name (SnsTopicARN) get a non-null value.
* fix(cloudtrail): wildcard S3 ARN matching, trail name validation, LookupEvents
- matchesS3DataResourceArn: handle bare "arn:aws:s3", "arn:aws:s3:::*", and
"arn:aws:s3:::*/*" wildcard forms so trails configured via the AWS Console
"capture everything" selector actually record events (previously fell through
silently). Unit tests added to CloudTrailSelectorMatchingTest.
- createTrail: enforce AWS trail name rules (3–128 chars, start/end with letter
or digit, only letters/numbers/./_/-). Integration tests in new
CloudTrailNameValidationTest.
- CloudTrailJsonHandler: add LookupEvents stub returning an empty Events array,
matching upstream's addition in #1603.
* fix(cloudtrail): log empty catches, key selectors/logging by trail home region
- CloudTrailLogWriter.stop(): log at WARN instead of silently swallowing the
final-flush exception (AGENTS.md: never leave a catch block empty).
- CloudTrailService.putEventSelectors / getEventSelectors / startLogging /
stopLogging / getTrailStatus: use trail.homeRegion() as the storage key
instead of the request region. Previously a cross-region call (e.g. accessing
a trail by ARN from a different-region endpoint) stored selectors and logging
state in the wrong region's map, so trailsMatching() found an empty selector
list and logging never fired.
- S3Controller.emitCloudTrailEvent / IamEnforcementFilter.emitS3DenialIfApplicable:
replace empty inner catch blocks with LOG.tracev() so unexpected failures
during request-context extraction surface at trace level.
* fix(iam): distinguish bucket-level vs object-level ?acl / ?tagging IAM actions
resolveS3SubResourceAction was always mapping ?acl and ?tagging to object-level
actions (s3:PutObjectAcl, s3:GetObjectAcl, etc.) regardless of path depth.
A PUT /{bucket}?acl request requires s3:PutBucketAcl, not s3:PutObjectAcl —
callers with the correct bucket-level permission were incorrectly denied.
Fix: inspect the URL path after stripping the leading slash. When there is no
slash (or the path ends with one), the target is a bucket; otherwise it is an
object. Applies to all six variants: GetBucketAcl, PutBucketAcl,
GetBucketTagging, PutBucketTagging, DeleteBucketTagging (and their object
counterparts).
* fix(cloudtrail): re-queue records on flush failure instead of dropping them
drainPendingRecords atomically dequeues all records before the S3 write.
If serializeAndGzip or s3Service.putObject threw, those records were gone —
permanently lost before the re-throw reached flushAll.
Fix: wrap the serialize+write block in a try-catch that calls requeueRecords
before rethrowing. Records are added back to the tail of the queue and will be
retried on the next flush cycle. The new CloudTrailService.requeueRecords helper
also makes the re-queue path unit-testable independently of flushTrail.
* fix(s3): emit GetObjectAcl error record under correct event name
getObjectAcl was called inside the outer GET-object try block. On any
AwsException (NoSuchKey, AccessDenied, etc.) the catch at the bottom fired
and emitted a GetObject error record. CloudTrail consumers auditing ACL
errors would see the wrong event name.
Wrap the acl branch in its own try-catch that emits GetObjectAcl on both
success and failure paths, mirroring the pattern used by the other hooked ops.
* ci: retrigger
* fix(test): pass CloudTrailService and CurrentVertxRequest to IamEnforcementFilter constructor
* fix(cloudtrail): persist trail state via StorageFactory instead of volatile in-memory maps
* fix(cloudtrail): address review feedback on region, name lookup, and ACL detection
- S3Controller: use request region (from credential scope) instead of
getDefaultRegion() for CloudTrail event emission, matching the IAM
denial hook behaviour so allowed and denied calls land in the same trail.
- CloudTrailService.findTrail: name lookup now uses regionKey(region, name)
directly; ARNs still do a cross-region scan. Prevents two same-name
single-region trails from resolving ambiguously by map iteration order.
- TrailKey: add eventRegion field so multi-region trail events are written
to the correct S3 delivery path (CloudTrail/<eventRegion>/) rather than
always the trail home region. drainPendingRecords/requeueRecords now take
a TrailKey to carry all three dimensions.
- IamActionRegistry: fix isBucketLevel — trailing slash is a valid S3 key
character, so /bucket/folder/?acl is an object ACL request. Replaced the
endsWith("/") check with an index-based test. Add IamActionRegistryTest
cases for the folder/ regression.
* docs(cloudtrail): sync action table order with make docs-sync
|
||
|
|
095e167bae |
Nodegroups eks fargate eks (#1523)
* feat(eks): add nodegroups and fargate profiles * docs: sync generated action tables |
||
|
|
10f799a2b7 |
feat(ses): implement Contact CRUD for SES v2 (#1723)
* feat(ses): implement Contact CRUD for SES v2
Add the SES v2 Contact APIs under /v2/email/contact-lists/{name}/contacts:
CreateContact, GetContact, ListContacts (POST .../contacts/list),
UpdateContact, DeleteContact. Contacts carry per-topic subscription
preferences, an unsubscribe-all flag, and free-form attributes;
TopicDefaultPreferences is derived at read time from the list's topics.
Behaviour is verified against real AWS: validation order (Smithy enum ->
EmailAddress format -> list existence -> topic existence), AlreadyExists /
NotFound / invalid-topic / invalid-email error shapes, and the UpdateContact
semantics (TopicPreferences merge by topic name; AttributesData and
UnsubscribeAll replaced). Covered by a RestAssured integration test and an
AWS Java SDK v2 compatibility test.
* refactor(ses): resolve contact list once for reads and delete under lock
Address review consistency findings on the Contact CRUD read/delete paths:
- getContact/listContacts returned only the contact(s), so the controller
fetched the ContactList a second time to render TopicDefaultPreferences.
Between the two calls a concurrent delete could turn a successful read into a
misleading "List not found". The service now returns the resolved list
alongside the contact(s) (ContactWithList / ContactsWithList), so the read is
a single, consistent lookup.
- deleteContact re-checked list existence before acquiring contactMutationLock,
unlike createContact/updateContact which re-check inside it. Move the
getContactList check inside the lock so a concurrent deleteContactList
surfaces "list not found" rather than "contact not found".
|
||
|
|
97b64a1d3b |
feat: add AWS Lightsail emulation (#1583)
* feat(lightsail): add AWS Lightsail emulation * fix(lightsail): align error responses with AWS * fix(lightsail): address review edge cases * fix(lightsail): reject attached disk reattach * fix(lightsail): reject static ip reattach * fix: register lightsail docs handler |
||
|
|
321394fea0 |
docs: fill supported action descriptions (#1819)
* docs: fill supported action descriptions * docs(elb): describe listener default rule as non-deletable, not immutable The CreateListener row called the default rule "immutable", which contradicts the ModifyListener row (updates default actions) and the file's own note that the rule can be changed via ModifyListener. The rule cannot be deleted or reprioritized, but its action is mutable, so "non-deletable" is accurate. |
||
|
|
4a16266f48 |
feat(cloudformation): support UpdateTerminationProtection (#1692)
* feat(cloudformation): support UpdateTerminationProtection CDK bootstrap calls UpdateTerminationProtection on the CDKToolkit stack; Floci returned UnknownAction. Add it: a boolean enableTerminationProtection on Stack, a CloudFormationService.updateTerminationProtection(stackName, enabled, region) that sets and persists it, a handler returning the UpdateTerminationProtectionResult/StackId envelope, and the flag echoed as <EnableTerminationProtection> in DescribeStacks. Register the action in AwsQueryController's CloudFormation action set so the Query-protocol POST routes to CloudFormation instead of falling through. Adds an integration test toggling the flag and asserting it round-trips through DescribeStacks. * docs: regenerate action tables |
||
|
|
0e85ac92c7 |
feat(pipes): apply EventBridge Pipe enrichment before target delivery (#1658)
* feat(pipes): apply EventBridge Pipe enrichment before target delivery
PipesPoller delivered the raw source record straight to the target; pipe.getEnrichment() was
stored but never invoked. Implement the AWS Pipes source->filter->ENRICHMENT->target flow: when an
enrichment Lambda is configured, invoke it once with the filtered events (bare JSON array) and
forward its response to the target (null/empty response skips the target, per AWS). Also resolve
qualified Lambda ARNs (:$LATEST) in PipesTargetInvoker. Covered by PipesTargetInvokerTest.
* fix(pipes): deliver enrichment result to the target as an event array
EventBridge Pipes delivers events to a target as a batch (JSON array). The
enrichment path forwarded a single-object enrichment response verbatim, so a
target expecting an array (e.g. a Step Functions state machine with
InputPath "$.[0]") received an object and resolved null. Wrap a non-array
enrichment response in a one-element array before target delivery. Covered by
PipesPollerTest.asEventArray*.
(cherry picked from commit f160f66857c2362e3f1bad3bbfdb025396b281a0)
* fix(pipes): treat a target/enrichment Lambda FunctionError as failed delivery
invokeLambda (the Lambda target path) discarded the InvokeResult, so a target
Lambda that returned a FunctionError (unhandled exception, throttle) was treated
as a successful delivery and the source record was consumed. Surface it (throw)
so the caller routes the record to the DLQ. Also switch applyEnrichment's
FunctionError failure from a bare RuntimeException to AwsException, per the
service-layer convention. Covered by PipesTargetInvokerTest.invoke_lambdaTargetFunctionErrorThrows.
* fix(pipes): only array-wrap the enrichment response for Lambda targets
deliverEnrichedBatch wrapped the enrichment response in a JSON batch array before invoking
the target unconditionally. That is correct for a Lambda target (which expects an
SQSRecord[]-style batch) but corrupts every other target — a Step Functions execution, SQS
message, SNS publish or EventBridge event must receive the raw enrichment response. Gate the
wrapping on isLambdaTarget, matching the non-enrichment delivery path. Adds pollSqs tests for
both a non-Lambda (raw) and a Lambda (wrapped) target.
* fix(pipes): align enrichment empty/unsupported handling with AWS + document SQS-only wiring
Review feedback:
- applyEnrichment now also skips the target when the Lambda enrichment returns an
empty object {} or empty array [] (whitespace variants included), matching AWS;
a non-empty array such as [{}] still invokes the target.
- A non-Lambda enrichment type (API destination, API Gateway, SFN Express) now
fails the batch to the DLQ instead of silently delivering the unenriched payload.
- Documented that enrichment is currently applied only on the SQS source path
(Kinesis/DynamoDB Streams/Kafka bypass it) in code and docs/services/pipes.md.
- Generalized a comment that named a specific downstream consumer.
- Tests: empty {}/[] skip, [{}] invokes, unsupported type throws.
* docs: regenerate action tables
|
||
|
|
45ed00ebc7 |
feat(ecs): apply EFS access point POSIX ownership to shared local volumes (#1686)
* feat(ecs): apply EFS access point POSIX ownership to shared local volumes #1569 materialises an ECS task's efsVolumeConfiguration volume as a shared local Docker named volume (floci-efs-<fileSystemId>). Docker creates a named volume root:root 0755, so a task whose image runs as a non-root USER — as containers mounting an EFS access point typically do — cannot create files on it and fails with EACCES. Real EFS initialises an access point's root directory per RootDirectory.CreationInfo {OwnerUid, OwnerGid, Permissions} and applies the access point's PosixUser to all I/O regardless of the process uid. This change emulates that mechanism for the shared local volume, driven by generic config: - New floci.storage.efs.* block (owner-uid, owner-gid, root-permissions, setgid, init-image, mount-user, mount-group-add). Every value is empty/false by default, so a shared volume behaves exactly as before (a plain named volume, no ownership change) unless explicitly configured. - ContainerLifecycleManager.ensureSharedVolume(...) ensures the volume then, if ownership is configured, chowns/chmods the mount root once (run-once guard; optional setgid so subdirectories inherit the owner gid) inside a short-lived helper container. - ContainerSpec/ContainerBuilder gain withUser/withGroupAdd; wired into createContainerCmd.withUser and HostConfig.withGroupAdd. - EcsContainerManager initialises the EFS volume root via ensureSharedVolume before mounting it. Unit tests cover the no-op default (no helper container, no image pull), the one-off chown/chmod/setgid helper with the run-once guard, the builder round-trip, and the EcsContainerManager wiring. * fix(ecs): apply configured EFS PosixUser to containers mounting a shared volume Wire the previously-inert floci.storage.efs.mount-user / mount-group-add config into the ECS container spec: a container mounting an EFS-backed shared volume now runs under the configured uid[:gid] and adds the supplementary group, emulating the access point's PosixUser squashing. Without this a non-root image USER could not write a volume owned by owner-uid/owner-gid. Also add the floci.storage.efs.* section to application.yml (the source of truth for effective defaults) and correct the root-permissions Javadoc, which implied leaving it empty always skips volume init even when owner/setgid are set. * docs: regenerate action tables |
||
|
|
312fe377fc |
feat(ses): implement PutEmailIdentityConfigurationSetAttributes for SES v2 (#1698)
* feat(ses): implement PutEmailIdentityConfigurationSetAttributes for SES v2
Add the v2 PutEmailIdentityConfigurationSetAttributes API and wire an email
identity's default configuration set into the send path so its event
destinations fire. This includes Raw sends with no explicit FromEmailAddress:
the configuration set is re-resolved from the MIME "From" header once parsed,
so an omitted-sender Raw send still routes through the identity default.
Unknown identities surface the AWS-matched error message.
* test(ses): log instead of swallowing cleanup failures in the identity config-set compat test
* docs(ses): clarify default config-set precedence and clear-on-null semantics
* fix(ses): fail send when an identity's default configuration set was deleted
Per the SES Developer Guide, sending through an identity whose default
configuration set has been deleted fails with a bad-request error. The default
resolution was silently dropping the stale association; make it throw
BadRequestException ("Configuration set <name> does not exist.") to match AWS.
|
||
|
|
07476f09fe |
docs: regenerate action tables for docdb, elasticache, rds (#1765)
* docs: regenerate action tables for docdb, elasticache, rds * docs(docdb): clarify snapshots are a stub, not fully out of scope DescribeDBClusterSnapshots is listed in the action table (it returns an empty stub result), so narrow the Out of Scope note to snapshot creation/restore instead of claiming all snapshot operations are unsupported. |
||
|
|
de9a930e85 | docs: sync service action tables (#1769) | ||
|
|
7586a01cf9 |
fix(eks): let pods pull images pushed to the Floci ECR registry (#1762)
k3s containerd could not reach the emulated ECR registry: repository URIs embed localhost plus the host-published port, which resolves to the k3s container itself, and containerd requires a registries.yaml entry before it will speak plain HTTP to a registry. New clusters now get a generated /etc/rancher/k3s/registries.yaml, injected through the Docker API before the container starts, that mirrors every repository hostname the emulator can mint (the default account across the region catalog, plus the path-style form) to the registry container's in-network endpoint. Public registries are never matched, and any failure skips the mirror without aborting cluster creation. Opt out with FLOCI_SERVICES_EKS_ECR_REGISTRY_MIRROR=false. Closes #1761 |
||
|
|
7d70f64162 |
feat(docs): generate Supported Actions tables from handler source (#1641)
* feat(docs): generate Supported Actions tables from handler source The "Supported Actions" tables in docs/services/*.md were hand-maintained and drifted from the handlers. For example secrets-manager.md omitted RestoreSecret, which SecretsManagerJsonHandler dispatches, and acm.md listed RenewCertificate, which is not implemented anywhere in src/. Derive the action list from handler source so it cannot drift, while keeping the hand-written Description column: - tools/docs/regen_action_docs.py extracts actions from `case "X" ->` switch arms (including multi-label arms) and JAX-RS REST controllers, and rewrites only the rows between the <!-- floci:actions --> markers. Descriptions are preserved by action name; new actions get a "-" placeholder. PascalCase-only matching avoids picking up SCREAMING_CASE labels from non-action switches. - tools/docs/services.yaml registers 18 single-table switch services and lists the remaining switch handlers under deferred_handlers, so the new-service sentinel fires only on a genuinely unregistered handler. - make docs-sync / docs-check / docs-test, plus a Python-only CI workflow that gates on handler, doc, and tooling changes. - Migrate 18 service docs into marker blocks, reconciling real drift (adds RestoreSecret, ImportCertificate, and others; drops the unimplemented RenewCertificate). Revives the parser and CI gate from #738 by @ericbsantana and completes the description-preservation its spec described. REST-mode, mixed-mode, multi-table, non-tabular, S3, and ecr docs are deferred and tracked in deferred_handlers. * docs: drop standalone design spec from action-docs tooling Remove ideas/auto-generated-action-tables.spec.md and the four references to it (CONTRIBUTING.md, Makefile, regen_action_docs.py docstring, services.yaml). It was a planning artifact; the operational docs live in CONTRIBUTING.md and the tooling is self-documenting. The #738 / @ericbsantana credit is preserved in the PR description. * chore: address review on action-docs tooling - pin actions/checkout to v7.0.0 in docs-actions workflow to match the repo-wide bump (#1690), so dependabot does not immediately flag the new file - document in the generator docstring that a switch case label counts as supported purely by existing, so a per-action UnsupportedOperation stub would be a false positive (handlers here reject from the default arm) * docs: regenerate action tables against current handler source Resync the generated Supported Actions tables to handler source after rebasing onto the latest main: - cloudformation: add DescribeStackInstance and DescribeStackSetOperation now emitted by the handler, and keep the implemented StackSet descriptions - cloudtrail: add LookupEvents - firehose: add UpdateDestination - step-functions: add PublishStateMachineVersion, ListStateMachineVersions, DeleteStateMachineVersion - register the cloudcontrol handler in deferred_handlers so the strict unregistered-handler gate passes (no standalone action table yet) * fix(docs): prevent action-table generator from silently dropping actions Address the latest review pass on the action-docs tooling: - switch extraction now captures case arms whose labels wrap across lines (valid Java 14+ syntax). The capture group excludes only `{ } ;` boundaries, so it spans newlines between labels but stops at the arm's `->`. A wrapped arm was previously missed, and docs-check would stay green because the doc and the generated output agreed on the omission, defeating the whole drift-prevention guarantee. - REST extraction skips Javadoc / inline comments between a verb annotation and the method signature; such a line otherwise reset the lookahead and dropped the action. - parse_marker_block raises a descriptive error when a marker is not on its own line, instead of a bare "substring not found". - doc, source, and registry reads/writes are pinned to UTF-8 so generation is locale-independent (the docs contain non-ASCII text). - the docs-actions push trigger watches Makefile and the workflow file, matching its pull_request trigger. Adds regression tests for the multi-line arm and comment-skip paths (20 total). |
||
|
|
073e653d35 |
fix(docker): isolate managed resource containers (#1703)
* fix(docker): namespace managed resource containers * fix(rds): avoid containerized host path creation * fix(docker): isolate child container names * fix(opensearch): preserve legacy domain container names |
||
|
|
272e4136e5 |
feat(rds-data): adding data-api for postgresql (#1720)
* feat(rds-data): adding data-api for postgresql * Moving wrongly place test file under src/test |
||
|
|
f490bbefad |
feat(rds): add mock mode to create clusters and instances without Docker (#1655)
* feat(rds): add mock mode to create clusters/instances without Docker Floci backs RDS clusters and instances with real Docker containers and an auth proxy. In CI or environments without access to the Docker socket, CreateDBCluster/CreateDBInstance fail, so the resources never reach an available state. Add FLOCI_SERVICES_RDS_MOCK (default false), mirroring the existing mock mode of EC2/EKS/ECS/OpenSearch/MSK. When enabled, cluster and instance creation skip the container and proxy and are registered as AVAILABLE immediately with a localhost endpoint; delete and runtime restoration likewise skip all Docker calls. Non-mock behavior is unchanged. * fix(rds): make rebootDbInstance mock-aware In mock mode, reboot skipped the container restart (guarded by a null containerId) but still started a real TCP auth proxy, breaking the no-container/no-proxy invariant. Gate the container restart and proxy start on !mock so a mock reboot only flips status back to AVAILABLE. * fix(rds): give mock resources unique ports and gate delete proxy stop Address PR review: mock mode hardcoded proxyBasePort for every cluster and instance, collapsing all endpoints onto localhost:7001 and leaving usedPorts unreserved. Allocate a unique proxy port even in mock mode (still skipping the container and auth proxy), and preserve/reserve the persisted port on restore instead of resetting it. Also gate proxyManager.stopProxy on !mock in the delete paths, matching the reboot path. Add tests for standalone-instance deletion in mock mode and for distinct mock endpoint ports. * fix(rds): skip Docker volume name for mock cluster members and document mode switching Review feedback from #1655: - Cluster member instances created in mock mode no longer persist a volume name fabricated from the cluster's null volume id, which a later non-mock restore could try to reference. - Document RDS mock mode on the service page, including that switching FLOCI_SERVICES_RDS_MOCK over persisted state is best-effort in both directions, matching the other mock-capable services. |
||
|
|
38bf55d323 |
feat(core): claim wire protocols reactively per Smithy selection guide (#1712)
* feat(core): claim wire protocols reactively per Smithy selection guide AWS services will adopt additional wire protocols without advance notice starting April 2026, so the protocol must be identified per request rather than assumed per service. Adds a ProtocolClaimer that claims each request from its non-payload signals (Smithy-Protocol header, content type, X-Amz-Target, method, path) in Smithy precision order, exposed to downstream filters by a pre-matching claim filter and consumed by the service-enablement filter in place of its duplicated sniffing. Also fixes smithy-rpc-v2 path routing: the service segment AWS SDKs send is the target prefix (Kinesis_20131202, DynamoDB_20120810, ...), not the SDK serviceId, so rpcv2 service names are now derived from the catalog's target prefixes and the path-based CBOR dispatcher gains the missing Kinesis case. Opt-in strict mode (FLOCI_PROTOCOLS_STRICT_CLAIMING) rejects RPC-signaled requests that no supported protocol claims, including the recognized but unimplemented rpc-v2-json. Default wire behavior is unchanged. Refs #156 * fix(core): scope Smithy-Protocol content-type normalization to rpcv2 paths The normalization filter runs before the path-rewriting filters, so rewriting Content-Type on arbitrary paths erased the signal filters like S3VirtualHostFilter use to bypass non-S3 management traffic. Only normalize POST requests whose path matches the rpcv2 shape — the only requests the rpcv2Cbor claim can succeed for. |
||
|
|
e4ee6dd7de |
docs: correct service count to 68 and add missing IoT and S3 Vectors entries (#1716)
The documented count stayed at 66 while the catalog grew to 68 status-visible services: S3 Vectors (#1435) and IoT Core/IoT Data (#1359) were merged without services-matrix rows, so the Amazon MQ bump (#1642) was applied to an already stale number. Adds the three missing matrix rows, links the existing iot.md page, creates the missing s3vectors.md page, and updates the count in the README, docs/index.md, and docs/services/index.md. 68 is the catalog's status-visible service count, with IoT Core and IoT Data counted separately per the AppConfig/AppConfigData precedent. |
||
|
|
188854f2df |
feat(amazonmq): add Amazon MQ broker control plane backed by RabbitMQ (#1642)
* feat(amazonmq): add Amazon MQ broker control plane for RabbitMQ
* feat(amazonmq): provision RabbitMQ container with rollback
Back a broker with a real rabbitmq:3-management container, following the
MSK/ElastiCache container-manager pattern.
- RabbitMqManager starts the container, publishes AMQP (5672) and
management (15672) ports, and resolves the broker endpoints
- Service branches on the mock flag; real brokers stay
CREATION_IN_PROGRESS until a readiness poller observes the management
API answering, then flip to RUNNING
- Rollback on failed provisioning: the manager removes the half-built
container and the broker is persisted as CREATION_FAILED
- @PreDestroy stops containers on shutdown; DeleteBroker stops and
removes the container and its storage
Readiness probes the management UI root (no auth) to avoid RabbitMQ's
loopback-only guest user over Docker port mapping.
* feat(amazonmq): seed broker admin user and reject ActiveMQ-only User API
Amazon MQ's standalone User API (CreateUser/DescribeUser/ListUsers/
DeleteUser) applies only to ActiveMQ brokers; AWS rejects it for RabbitMQ
and directs callers to the RabbitMQ web console. CreateBroker now requires
exactly one broker user (validated against AWS password rules) which is
seeded into the container via RABBITMQ_DEFAULT_USER/PASS, sidestepping
RabbitMQ's loopback-only guest restriction.
* test(amazonmq): SDK compatibility test against live RabbitMQ broker
Adds AmazonMqTest exercising the real container path via the AWS SDK MqClient:
CreateBroker provisions a rabbitmq:3-management container, the broker
transitions to RUNNING once its management API answers, endpoints are
published, the ActiveMQ-only User API is rejected, and DeleteBroker tears the
container down. Uses JUnit Assumptions to skip cleanly when Docker is absent.
* fix(amazonmq): harden error handling, persistence, and shutdown teardown
- Redact the provisioning failure 500: log the cause, return a generic AWS
error envelope instead of leaking e.getMessage() (which can be null).
- Add @JsonIgnoreProperties(ignoreUnknown = true) to Broker, MqUser, and
BrokerInstance so old persisted snapshots survive field changes.
- Wire RabbitMQ container teardown into EmulatorLifecycle.onStop() via
RabbitMqManager.stopAll(), alongside the other container managers; the
service @PreDestroy now only stops the readiness poller.
* docs(amazonmq): add Amazon MQ service page and bump service count to 66
Adds docs/services/amazonmq.md, lists Amazon MQ in the services overview and
README service tables, and updates the "65 -> 66 AWS services" count across
docs/index.md, docs/services/index.md, and README.md.
* fix(amazonmq): reject RebootBroker unless the broker is RUNNING
RebootBroker unconditionally set the broker to RUNNING, so a non-RUNNING
broker (e.g. CREATION_FAILED, which has no backing container) was silently
promoted to RUNNING and never reconciled by the readiness poller. AWS allows
RebootBroker only on a broker in the RUNNING state; guard it and return a 400
otherwise, matching the Amazon MQ API ("You can reboot only a broker with the
RUNNING status").
* fix(amazonmq): close readiness-probe connection and log tolerated failures
isReady() opened an HttpURLConnection but never disconnected it; since the
probe runs every 2s per pending broker this leaked sockets. Disconnect in a
finally block, and log the tolerated failure at debug with broker/URL context
(AGENTS.md: no empty catch; avoid noise in hot paths) instead of swallowing it.
* fix(amazonmq): tear down broker container by deterministic name after restart
containerId is in-memory bookkeeping (intentionally not persisted, since the
Broker model is serialized straight to DescribeBroker and must not leak it).
After an emulator restart it is null, so stopContainer() previously returned
early and left the container running. It now falls back to the deterministic
container name (floci-amazonmq-{brokerId}) so an explicit DeleteBroker still
removes a container left over from a previous run. Documented the field and
added RabbitMqManagerTest covering both the id and name-fallback paths.
* fix(amazonmq): keep admin password in-memory only and fail loudly if absent
The admin password is a secret used solely to seed the RabbitMQ container at
create time. Persisting it (to make it survive a restart) would write the
credential in cleartext to amazonmq-brokers.json, which the project's security
rule prohibits. It stays in-memory only via @JsonIgnore; startContainer (the
only consumer, called from CreateBroker) now throws if the password is absent
rather than seeding a null credential. Added MqUserTest asserting the password
is never serialized and round-trips to null.
* fix(amazonmq): persist broker volumeId/accountId/containerId without leaking them
These internal fields were @JsonIgnore'd, so they were absent from
amazonmq-brokers.json. After a restart in persistent mode volumeId was null
(removeBrokerStorage could not locate the named volume, leaking it) and
accountId was null (the readiness poller wrote brokers via the non-account-aware
path). Unlike the admin password, these are not secrets, so they should persist.
Remove @JsonIgnore so they round-trip through storage, and build the
DescribeBroker response explicitly in the controller so they are still never
exposed to clients (matches MskCluster, which persists volumeId/containerId).
Adds BrokerTest (round-trip) and asserts the describe response omits them.
|
||
|
|
4f4e7be90e |
fix(iam): enforce STS session policies (#1636)
* test(iam): expose STS session policy S3 deny gap * fix(iam): enforce STS session policies ## Summary STS session policies were recorded on temporary credentials but IAM enforcement evaluated only the caller's identity policies. As a result, an assumed role with broad role permissions could still perform an action even when the inline `AssumeRole` session policy should have denied or narrowed it. This changes enforcement to evaluate the full caller context, including identity policies, session policies, and permission boundaries. It also keeps temporary-credential lookup account-independent so assumed-role sessions can be resolved after account routing moves the request into the role account, and it uses the resolved request account when building resource ARNs for policy evaluation. ## Type of change - [x] Bug fix (`fix:`) ## AWS Compatibility Incorrect behavior: STS `AssumeRole` accepted the standard inline `Policy` parameter, but later requests signed with those temporary credentials did not have that session policy applied by IAM enforcement. The fix matches AWS policy evaluation semantics: explicit denies in session policies participate in the deny pass, and a present session policy must also explicitly allow the request for the role's permissions to be effective. This preserves the existing Floci bypass behavior for unknown local credentials and the `test` root credential. ## What changed - `IamEnforcementFilter` resolves a `CallerContext` and evaluates the complete IAM context instead of identity-policy documents only. - `IamService` resolves STS sessions across account namespaces for caller context, caller ARN, account routing, and temporary secret lookup. - Enforcement resource ARN construction uses the request account already resolved by `AccountContextFilter`, so assumed-role credentials evaluate account-scoped resources against the role account. - IAM and multi-account docs now describe session-policy intersection and temporary-credential resolution accurately. - Java SDK compatibility coverage now checks that an assumed-role session policy deny overrides a role allow. ## Checklist - [x] `./mvnw test` passes locally - attempted; only failures were unrelated LambdaReactiveSyncIntegrationTest container startup Broken pipe errors - [x] Selected Java SDK compatibility tests pass locally - in `compatibility-tests/sdk-test-java`: `mvn -q -Dtest=IamEnforcementTest,IamTest,StsTest,S3Test test` - [x] New or updated integration test added - [x] Commit messages follow Conventional Commits * fix(iam): tighten cross-account session lookup |
||
|
|
3304184bd3 |
feat(ses): implement ContactList CRUD for SES v2 (#1638)
Add the SES v2 contact list management APIs (CreateContactList, GetContactList,
ListContactLists, UpdateContactList, DeleteContactList) under
/v2/email/contact-lists. A contact list holds subscription topics with
OPT_IN/OPT_OUT defaults. Matching real AWS, an account may hold at most one
contact list per region; a second create is rejected with BadRequestException
("A maximum of 1 Lists allowed per account."), a duplicate name with
AlreadyExistsException, and unknown lists with NotFoundException.
Covered by a RestAssured integration test and an AWS Java SDK v2 compatibility
test.
|
||
|
|
058e02630a |
feat(cloudformation): add StackSets with account-aware provisioning (#1551)
* feat(cloudformation): add StackSets with account-aware provisioning Implement CloudFormation StackSets so a template can be deployed across target accounts and regions, and make CloudFormation provisioning land resources in the correct account. Provisioning previously ran on a background executor thread with no request scope, so the downstream service calls fell back to the default account — a stack created by account B materialised its resources under 000000000000. executeChangeSet/deleteStack now run the provisioning under a synthetic request scope bound to the deploying account (the caller's account for a single stack, the target account for a StackSet instance), mirroring the pattern other background workers already use. Single-stack resources now land in the caller's account. StackSet actions are wired through CloudFormationQueryHandler and AwsQueryController: CreateStackSet, DescribeStackSet, ListStackSets, UpdateStackSet, DeleteStackSet, CreateStackInstances, ListStackInstances, DeleteStackInstances, ListStackSetOperations. CreateStackInstances drives the existing single-stack engine once per target (account, region), provisioning each instance into that account's namespace; the stack set, its instances and its operation history live in the administration account. Tests: an integration test deploying a StackSet from an admin account into accounts B and C asserts the resources materialise in B and C and are invisible to the admin/default account, exercises describe/list/operations and instance deletion, and covers the not-found / already-exists / not-empty error paths. A single-stack test asserts resources now land in the caller's account. Design aligned with maintainers in floci-io/floci#1550. * fix(cloudformation): await StackSet instance deletion; test UpdateStackSet Make the account-scoped deleteStack overload return its Future so DeleteStackInstances completes synchronously before the operation returns, rather than racing the async resource removal. Add integration coverage for UpdateStackSet re-applying the template to existing instances. * test(cloudformation): add SDK compatibility test for StackSets Adds an sdk-test-java compatibility test exercising StackSets through the real AWS SDK CloudFormationClient (CreateStackSet, CreateStackInstances, DescribeStackSet, ListStackInstances, ListStackSetOperations, DeleteStackInstances, DeleteStackSet). It asserts the management responses unmarshal cleanly and that instances provision into each target account's namespace (verified via per-account SQS clients), per the project's policy of validating management APIs with AWS SDK clients. Runs in the compatibility CI on pull requests. * feat(cloudformation): add DescribeStackInstance and DescribeStackSetOperation Complete the StackSets API surface with the singular describe operations: DescribeStackInstance (used by orchestration that polls a single instance's status) and DescribeStackSetOperation (companion to ListStackSetOperations). Covered by the integration test and the SDK compatibility test, which confirm the StackInstance / StackSetOperation response shapes unmarshal through the real AWS SDK. * feat(cloudformation): resolve TemplateURL and report StackInstanceStatus.DetailedStatus for StackSets StackSet create/update now resolve a TemplateURL (fetched from S3) in addition to an inline TemplateBody, matching how orchestration tools reference templates staged in S3. DescribeStackInstance and ListStackInstances now also report the nested StackInstanceStatus.DetailedStatus that AWS returns and that pollers read to determine when an instance operation has completed. * feat(cloudformation): derive StackSet operation status and honor RetainStacks Address review feedback on #1551: - Operation status is now derived from instance outcomes: CreateStackInstances and UpdateStackSet report FAILED if any instance fails to deploy, instead of always SUCCEEDED. deployInstance also recognizes a rolled-back create (ROLLBACK_COMPLETE, not *_FAILED) as a failed/INOPERABLE instance, which was previously mis-reported as SUCCEEDED. - DeleteStackInstances honors RetainStacks: when true, the instance is detached from the stack set but its underlying stack and resources are left in place. - UpdateStackSet now persists the refreshed instance records. Tests: RetainStacks retention and the FAILED-operation path; docs updated. * fix(cloudformation): restore account on active scope; log StackSets test teardown Greptile review on #1551: - runUnderAccount now saves and restores the previous account ID when it runs inside an already-active request scope, so it can't leave the overridden account behind on a reused thread. (Background workers normally have no active scope, so this only hardens the synchronous-caller path.) - CloudFormationStackSetsTest teardown no longer swallows exceptions silently; it logs them, per the AGENTS.md no-empty-catch rule. * fix(cloudformation): report a failed StackSet instance delete as FAILED deleteStackInstances awaited the underlying deleteStack via a helper that swallows the failure, then removed the instance record unconditionally and hardcoded the operation status to SUCCEEDED. A failed non-retained delete was therefore reported as a success with the instance silently dropped. await() now returns whether the future completed cleanly. On a non-retained delete failure the instance record is retained (marked INOPERABLE/FAILED) and the operation status is derived via deriveOperationStatus, so it reports FAILED — matching AWS, which does not detach an instance whose stack delete failed. Adds StackSetServiceDeleteFailureTest covering the failure, success, and RetainStacks paths. * fix(cloudformation): reject templateless CreateStackSet and restore interrupt in await CreateStackSet now rejects a request with neither TemplateBody nor TemplateURL (ValidationError, matching AWS) instead of storing a null template — which would otherwise make a later CreateStackInstances deploy empty stacks into every target account. Also handle InterruptedException separately in await(Future) and restore the thread's interrupt flag, so a shutdown signal to the backing ExecutorService propagates instead of being swallowed. Adds a CreateStackSet-without-template integration test. |
||
|
|
a27971c7d5 |
feat(ec2): publish security-group TCP ingress ports on the host (#1680)
* feat(ec2): publish security-group TCP ingress ports on the host For each TCP port opened to a CIDR source by an instance's security groups, start an alpine/socat sidecar that binds an allocated host port (default 30000-30999) and forwards to the instance container's IP, so the app is reachable from localhost. Forwards reconcile at launch, on authorize/revoke-security-group-ingress, and on ModifyInstanceAttribute group reassignment (previously ignored). Mappings persist and are restored across restarts. SSH is never re-forwarded; wide rules and per-instance totals are capped; disable with publish-security-group-ports=false. * fix(ec2): drop stale port mapping when sidecar recreation fails On restore, a failed socat recreation released the host port but left the appPort->hostPort entry in publishedPorts, so later reconciles saw the port as already published and never re-published it, and a later unpublish could double-release the host port. Remove the entry and persist on failure. Also null-guard portForwardManager.restore() for consistency with the setPersister guard. Adds a regression test. * fix(ec2): skip port-forward reconcile on non-running instances A reconcile queued by authorize-security-group-ingress could run after a concurrent stop/terminate had already cleared publishedPorts and removed the container; it then republished via the stale bridge IP, leaking an orphaned socat sidecar and a host port that nothing would release. Stop/terminate flip the instance state before their async unpublishAll, so guarding reconcileNow on the running state under the instance lock closes every window. Adds regression tests. |
||
|
|
fef03c6b0f |
fix(ec2): align AMI guest and launch template parity (#1597)
* fix(ec2): preserve launch template instance profiles * fix(ec2): skip networkd wait-online in AMI guests * feat(docker): add image registry override * fix(ec2): align launch template AMI parity * fix(docker): simplify registry base config handling * fix(docker): normalize registry base once |
||
|
|
d54a307ca9 |
feat(iam): enforce AssumeRole trust policies when enforcement is enabled (#1552)
* feat(iam): enforce AssumeRole trust policies when enforcement is enabled When floci.iam.enforcement-enabled is true, STS AssumeRole now evaluates the target role's trust policy (AssumeRolePolicyDocument) against the caller and returns AccessDenied if it is not permitted. Enforcement is off by default, so existing behavior is unchanged. Trust policies are principal-centric and carry no Resource element, so the identity/resource-oriented IamPolicyEvaluator cannot evaluate them. A focused AssumeRolePolicyEvaluator matches each statement's Action (sts:AssumeRole) and AWS Principal (account id, account-root ARN, exact principal ARN, or "*") against the caller, with explicit Deny taking precedence. The role is resolved in its own account (from the role ARN) via a new IamService.findRole overload, since roles are account-namespaced. Roles unknown to Floci stay permissive to preserve backward compatibility. Tests: unit coverage for the evaluator across principal/action/deny/malformed cases, plus an enforcement-enabled integration test asserting a permitted caller succeeds, an unauthorized caller is denied, and an unknown role stays permissive. * docs(sts): restore Configuration section and note NotAction limitation Greptile review on #1552: - Restore the FLOCI_SERVICES_STS_ENABLED Configuration section that was dropped when the Trust Policy Enforcement section was added. - Document that NotAction is not evaluated (a Deny with NotAction won't block). * fix(iam): honor NotAction in AssumeRole trust statements evaluateStatement only inspected the Action key, so a trust statement using NotAction returned NO_MATCH and was skipped entirely. A Deny that should block sts:AssumeRole (NotAction excluding some other action) was therefore ignored, over-permitting AssumeRole when IAM enforcement is enabled. Add actionApplies() mirroring IamPolicyEvaluator's Action/NotAction semantics: Action applies when any pattern matches, NotAction applies when none match. Covered by three new AssumeRolePolicyEvaluatorTest cases. * fix(iam): match an assumed-role caller against a role-ARN trust principal When a caller uses assumed-role temporary credentials, resolveCallerArn (rightly, for GetCallerIdentity) yields the STS assumed-role ARN (arn:aws:sts::ACCT:assumed-role/Role/session). enforceTrustPolicy passes that to the trust-policy evaluator, but role trust policies name the role's IAM principal ARN (arn:aws:iam::ACCT:role/Role) — the canonical form AWS resolves the session back to. So a legitimate role-to-role AssumeRole was denied. matchesAwsPrincipal now also normalizes an assumed-role caller ARN to its underlying IAM role ARN and matches the principal against that, while still matching an exact session-ARN principal. resolveCallerArn is unchanged, so GetCallerIdentity keeps returning the assumed-role ARN. Adds AssumeRolePolicyEvaluatorTest cases for role-ARN match, differing-role denial, and exact session-ARN match. |
||
|
|
398100100a | docs: add supported action description columns (#1639) | ||
|
|
f52b9209cf |
feat(iam): route assumed-role credentials to the target account (#1549)
* feat(iam): route assumed-role credentials to the target account Assumed-role temporary credentials (ASIA… keys) collapsed to the default account: account resolution only recognised 12-digit access key IDs and had no link to the STS session store. Cross-account "assume a role in account B, then provision" flows therefore landed resources in account 000000000000 instead of B. Add a SessionAccountLookup port in core.common, implemented by IamService, mapping a temporary access key to its account — the account in the session's role (or federated-user) ARN, or the caller account captured at mint time for role-less GetSessionToken credentials. AccountContextFilter now resolves with the precedence 12-digit AKID → session lookup → default, for both the Authorization header and the presigned X-Amz-Credential parameter. STS handlers record the caller account on every minted session, and SessionCredential gains an originAccountId field. The session lookup is account-independent, since sessions are keyed by a globally unique access key. IamService is now @Startup so AWS-managed policies seed under the default account at boot. Seeding is account-namespaced and AccountContextFilter now instantiates IamService to resolve the request account, so lazy seeding would otherwise bind managed policies to whichever account made the first request. Tests: unit coverage for resolver/filter precedence and session lookup, plus an integration test proving a table created with role-B credentials materialises in account B and is invisible to account A. * perf(iam): skip session-store scan for non-ASIA access keys Account resolution runs on every request. Gating the session lookup on the ASIA temporary-credential prefix keeps the common case (e.g. the 'test' default credential) off the session-store scan, which would otherwise grow with every issued session. * chore: re-trigger CI Unrelated flaky CodeBuildTest.batchGetBuilds_eventuallySucceeds; root-cause fix in floci-io/floci#1577. |
||
|
|
dcc90031c5 |
feat(cognito): add cognito overrides for client-id and secret. some b… (#1486)
* feat(cognito): add cognito overrides for client-id and secret. some boy-scouting * feat(cognito): update docs, clarify reserved tags and possible values. Throws exception when unknown reserved tags are used. * feat(cognito): reverted pom changes, align errorCode, use cleaned tag value * feat(cognito): fix region resolver initialization |
||
|
|
326b495496 |
feat(iot) Feature/issue 1038 iot core (#1359)
* feat: add IoT endpoint and thing registry * feat: add IoT thing tagging * feat: add IoT certificates and shadows * feat: add IoT MQTT broker * feat: upgrade IoT MQTT broker to Moquette 0.18 * feat: restore IoT reserved MQTT topics * feat: add IoT topic rules engine * feat: improve IoT thing registry compatibility * feat: complete IoT MVP 1 compatibility * feat: complete IoT MVP 2 compatibility * feat: finish IoT MVP 2 coverage * fix: disable IoT MQTT broker persistence * fix(docker): include vendored Maven artifacts in source builds * fix(iot): stabilize MQTT integration test sockets * fix(iot): verify MQTT test connections * fix(iot): use Paho for MQTT integration tests * fix(iot): use Vert.x MQTT broker --------- Co-authored-by: nathan <nathan@debian-dev-small.localdomain> |
||
|
|
54ba15c218 |
feat(ses): implement PutConfigurationSetDeliveryOptions for SES v1 (#1553)
* feat(ses): implement PutConfigurationSetDeliveryOptions for SES v1 The classic SES Query API action was unhandled — only the v2 REST path reached the existing setConfigurationSetDeliveryOptions service logic. Route the v1 action through SesQueryHandler and register it in the AwsQueryController SES action set. The v1 DeliveryOptions structure carries only TlsPolicy (Require/Optional); Floci stores the v2 canonical REQUIRE/OPTIONAL, so the handler normalizes the value before delegating to the shared, already-validated service. An all-null payload passes null to clear the block, mirroring the v2 path rather than persisting an empty object. Tests: v1 Query integration coverage (success, unknown set, invalid TLS policy) and an AWS Java SDK v1 compatibility test that writes Require via the v1 SesClient and reads it back as the canonical REQUIRE through v2 GetConfigurationSet, asserts an empty put clears the block, and asserts the modeled ConfigurationSetDoesNotExistException for an unknown set. * fix(ses): return v1 ValidationError for an invalid delivery-options TlsPolicy The v1 PutConfigurationSetDeliveryOptions surfaced the shared service's v2-style BadRequestException for an invalid TlsPolicy, so a v1 SDK could only map it to a generic exception. Validate Require/Optional (case-sensitive) in the v1 handler and throw the Smithy enum ValidationError AWS actually returns. Verified against real AWS: an invalid or wrong-case TlsPolicy returns ValidationError "1 validation error detected: Value at 'deliveryOptions.tlsPolicy' failed to satisfy constraint: Member must satisfy enum value set: [Optional, Require]". The v1 integration test now asserts that shape; valid Require/Optional still normalize to the canonical value for the shared service. |
||
|
|
86c4aae2e2 |
feat(pipes): support Kafka pipe sources and polling (#1260)
* feat(pipes): support Kafka pipe sources and polling Add EventBridge Pipes support for Amazon MSK and self-managed Kafka sources exposed via `smk://`. Introduce Kafka consumer management for bootstrap resolution, consumer group selection, topic validation, and safe reuse across poll cycles. Extend the Pipes poller and tests to filter decoded Kafka payloads, deliver the expected record shape, and commit offsets only after successful delivery. * fix(pipes): tighten Kafka validation and commit handling Clarify Kafka validation errors, avoid duplicate Kafka record transformation, commit delivered Kafka offsets per partition for non-Lambda targets, and remove reflective poller test access. * fix(pipes): stabilise Kafka poller event handling Use a consistent Kafka partition type, narrow JSON decode error handling, remove reflection from manager tests, and tighten no-commit assertions for failed Kafka delivery paths. * fix(pipes): preserve Kafka nulls and commit progress Preserve null Kafka key and value fields, encode Kafka headers consistently, and commit Lambda Kafka progress per partition so successfully processed records are not replayed after later failures. * fix(msk): align broker metadata and Kafka event payloads |
||
|
|
efacb37130 |
feat: Adds initial Elastic Beanstalk Query API support to Floci. (#1362)
* feat: add Elastic Beanstalk query API support feat: add Elastic Beanstalk query API support * fix(elasticbeanstalk): configure native-image runtime initialization * fix(elasticbeanstalk): align missing parameter errors and add application ARN * test(elasticbeanstalk): add Java SDK compatibility coverage |
||
|
|
398535ed55 | feat(core): add opt-in Private Network Access for CORS preflights (#1530) | ||
|
|
e24566c47b |
feat(ses): publish SNS notifications to identity feedback topics (#1540)
Wire SetIdentityNotificationTopic into the send path so a verified identity (or its parent domain) with a Bounce/Complaint/Delivery topic receives an Amazon SNS notification when a matching event occurs, independently of any configuration set. Previously the topic ARN was stored and only echoed back by GetIdentityNotificationAttributes. The notification uses the legacy notificationType payload format, which shares the mail/bounce/complaint/delivery blocks with event publishing but differs in three spec-mandated ways: the top-level discriminator is named notificationType instead of eventType; the mail object omits the tags field; and the original headers (headers/commonHeaders/ headersTruncated) are included only when the identity has headers-in-notifications enabled for the notification type. The sending identity is resolved from the bare email address (so a display-name Source yields a valid identity/<email> ARN), and SendRawEmail falls back to the MIME From header when Source is omitted, using that effective source consistently for the stored message, SMTP relay, and event publishing. RawMessageHeaders now parses the From address. Docs: documented the behavior in docs/services/ses.md. |
||
|
|
ad785f95f6 | feat(ec2): add Java-built Ubuntu AMI guest image (#1542) | ||
|
|
a6c6cf6de9 |
fix(floci-ui): report real sidecar-start failures instead of always blaming the image (#1544)
Pressing 'Open Floci UI' under Podman (docker-socket compat) reports every failure as a missing image and tells the user to 'docker pull floci-ui' — even when the image is present. The real causes (an unreachable Docker/Podman socket, a port clash, a daemon error) are hidden, which is especially confusing on SELinux hosts where the bind-mounted socket connect fails with 'java.net.BindException: Permission denied'. Classify the failure in FlociUiManager.describeStartFailure: - only a genuinely unavailable image (NotFoundException / docker-java's 'Could not pull image: ...' wrapper) keeps the 'docker pull' guidance; - an unreachable runtime (SocketException/BindException/ConnectException) points at the socket mount and SELinux relabeling; - any other daemon error is surfaced as-is (e.g. 'address already in use'). Also fix the Podman docs: use ':z' (shared relabel) rather than ':Z' on the shared Podman API socket, note it applies to the UI sidecar, and mention the '--security-opt label=disable' fallback. Add unit tests for the four classifications. |
||
|
|
7efb280dbc |
fix(ec2): VPC endpoint compatibility for AWS SDK/Terraform (#1476)
- emit routeTableIdSet/subnetIdSet items as plain text (AWS SDK for Go could not deserialize the wrapped form) - add DescribePrefixLists returning managed S3/DynamoDB prefix lists - honor private_dns_enabled (default true for interface endpoints) Adds Ec2IntegrationTest coverage and documents the new actions. |
||
|
|
2301db53c7 |
feat(ec2): add Network ACL support (#1473)
Implements CreateNetworkAcl, DescribeNetworkAcls (with vpc-id / default / association.subnet-id filters), CreateNetworkAclEntry, ReplaceNetworkAclEntry, DeleteNetworkAclEntry, ReplaceNetworkAclAssociation, and DeleteNetworkAcl. Every VPC is provisioned with a default NACL and each subnet is associated with it, so aws_network_acl and aws_default_network_acl work via Terraform. Adds Ec2IntegrationTest coverage and documents the new actions. |
||
|
|
7c04e8824c |
feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options (#1479)
* feat(ses): support v1 ConfigurationSet tracking and reputation-metrics options
Implement the SES v1 (Query) ConfigurationSet option operations that previously
returned UnsupportedOperation: CreateConfigurationSetTrackingOptions,
UpdateConfigurationSetTrackingOptions, DeleteConfigurationSetTrackingOptions, and
UpdateConfigurationSetReputationMetricsEnabled.
Tracking options require a verified domain identity, matching real AWS: an
unverified CustomRedirectDomain yields InvalidTrackingOptions, checked before
configuration-set existence. The domain-verification check is shared with the v2
PutConfigurationSetTrackingOptions path so the two surfaces stay aligned. Lifecycle
conflicts surface as TrackingOptionsAlreadyExistsException /
TrackingOptionsDoesNotExistException, matching the AWS SDK error mapping.
A v1-created configuration set now defaults reputation metrics to disabled, matching
real AWS (the v2 create path leaves them enabled). DescribeConfigurationSet now
returns ReputationMetricsEnabled and the trackingOptions block.
Add integration and AWS SDK v2 compatibility tests.
* fix(ses): match AWS errors for missing/blank tracking-options redirect domain
CreateConfigurationSetTrackingOptions / UpdateConfigurationSetTrackingOptions now
distinguish the two AWS validation outcomes instead of returning a single
InvalidParameterValue: an absent CustomRedirectDomain (no TrackingOptions member on
the wire) yields a framework ValidationError ("Member must not be null"), while a
present-but-empty CustomRedirectDomain yields InvalidTrackingOptions ("At least one
field of TrackingOptions must contain a value."). The Smithy member is optional, so
the previous required-field rejection was incorrect.
Add integration coverage for both cases.
* test(ses): renumber tracking-options test order to match source order
Align the @Order values so file order equals execution order (the missing/blank
domain validation cases now run at 11-12, the reputation-metrics cases at 13-14),
making the intended sequence easier to follow.
|
||
|
|
3f314dcb4e |
feat(codepipeline): add AWS CodePipeline emulation (#1469)
* feat(codepipeline): add AWS CodePipeline emulation * fix(codepipeline): align webhook and rollback response shapes |