Commit Graph
39 Commits
Author SHA1 Message Date
Kenshin Okinaka d8243b8803 feat(lambda): support ScalingConfig.MaximumConcurrency on SQS event source mappings (#490)
* feat(lambda): support ScalingConfig.MaximumConcurrency on SQS event source mappings

Wire-level support for ScalingConfig on CreateEventSourceMapping,
UpdateEventSourceMapping, GetEventSourceMapping, and
ListEventSourceMappings:

- New ScalingConfig model carrying MaximumConcurrency (Integer, nullable).
- Create and Update parse ScalingConfig from the request, validate range
  (2-1000), reject non-SQS event sources with InvalidParameterValueException.
- Response includes ScalingConfig only when a cap is set; omitted when
  null, matching AWS behavior.
- Update with an empty ScalingConfig clears the cap (AWS reset semantics).

The value is persisted on the EventSourceMapping but not yet enforced at
invocation time — the SQS poller today serializes to one concurrent
invocation per ESM regardless. Real parallel dispatch capped by
MaximumConcurrency is a follow-up (Scope B).

Tests:
- EsmIntegrationTest: 6 new cases covering round-trip, below/above range
  rejection, non-SQS rejection, omission when unset, add-then-clear via
  update.
- LambdaEsmScalingConfigTest (SDK compat): 5 cases verifying SDK typed
  ScalingConfig round-trips, InvalidParameterValueException on range
  violations, and add/clear lifecycle via update.

* fix(lambda): reject non-integer MaximumConcurrency and ScalingConfig on non-SQS sources

- parseScalingConfig now detects fractional values (e.g. 2.5) and
  returns InvalidParameterValueException instead of silently truncating.
- Empty ScalingConfig ({}) on a non-SQS event source is now rejected.
  Previously the non-SQS check only fired when MaximumConcurrency was
  non-null, so an empty ScalingConfig on Kinesis / DynamoDB Streams
  slipped through.
- Two new integration tests cover both cases.

* fix(lambda): tighten ScalingConfig input validation

- Reject non-object ScalingConfig (e.g. "foo", []) with 400 instead of
  silently treating it as absent. In update paths this previously cleared
  an existing cap unintentionally.
- Reject non-numeric MaximumConcurrency (e.g. string "7"). AWS expects a
  JSON number on the wire; the previous toString + parseInt path accepted
  strings that real AWS would reject.
- Use longValue() before range-checking to avoid intValue() overflow on
  large inputs (e.g. 5000000000) that would produce a negative value and
  a misleading error message.
- Two new integration tests: string MaximumConcurrency and non-object
  ScalingConfig.

* fix(lambda): add NaN/Infinity guard and expand ScalingConfig test coverage

- parseScalingConfig now explicitly rejects NaN and Infinity rather than
  letting them fall through to longValue() with a misleading error.
- The post-range non-SQS guard was flagged as dead code by the reviewer
  but is in fact reachable (non-SQS + valid numeric MaximumConcurrency).
  Retained and confirmed by the existing @Order(43) test.
- New tests: update range validation (below/above on PUT), and list
  with mixed ScalingConfig presence across ESMs.
2026-04-17 00:16:55 -05:00
Conor Heine 4d1f8b4907 test: fix CloudFormationVirtualHostTests.java (#467) 2026-04-15 15:35:38 -05:00
Dmitriy Polomoshnov 25f360002e fix: DynamoDB expression evaluation, UpdateExpression paths, and ConsumedCapacity (#197)
* fix: replace regex-based DynamoDB expression evaluation with AST parser
* feat: add ConsumedCapacity in DynamoDB responses and GSI throughput in DescribeTable
* test: add DynamoDB expression compatibility tests and fix rebase conflicts
2026-04-15 09:55:58 -05:00
TiM c2653db2e7 fix(kinesis): accept AWS SDK v2 CBOR content type (#457)
* fix(kinesis): accept aws sdk v2 cbor content type
* test(kinesis): move sdk v2 coverage to compatibility suite
2026-04-15 07:50:37 -05:00
Hector Ventura ea597c67d6 feat: implement local Data Lake stack (Athena, Glue, and Firehose) (#429)
* feat: implement local Data Lake stack (Athena, Glue, and Firehose)
* fix: adding athena, firehose and glue documentation
* fix: updating dataLateTest
2026-04-15 01:22:10 -05:00
Kenshin Okinaka fb26731131 feat(lambda): enforce reserved and per-region concurrency (#424)
* feat(lambda): enforce reserved concurrency at invocation time

Introduce LambdaConcurrencyLimiter using AtomicInteger + CAS. Acquire a
permit before invoke and release in finally for both sync and async
paths. DryRun skips enforcement. Functions without a reserved value are
not enforced in this step (account-pool enforcement will follow).

Reset inflight counters when a function is deleted to prevent leaks.

* test(lambda): use JUnit Assertions in LambdaConcurrencyLimiterTest

AssertJ is not on the unit-test classpath; switch to the Jupiter
assertions already used by sibling tests.

* feat(lambda): enforce account-wide concurrency pool and validate Put

Extend LambdaConcurrencyLimiter with an account-shared unreserved pool
sized as accountLimit - Σreserved. Functions without a reserved value
now share this pool; exhaustion returns TooManyRequestsException.

PutFunctionConcurrency rejects values that would leave less than
unreserved-concurrency-min (AWS default: 100) available, matching AWS's
LimitExceededException behavior.

Config: floci.services.lambda.account-concurrency-limit (default 1000)
and floci.services.lambda.unreserved-concurrency-min (default 100).
Docs and controller javadoc updated accordingly.

* feat(lambda): rehydrate reserved concurrency and handle throttle in pollers

On startup, LambdaService walks functionStore.listAll() and re-registers
reserved values with the limiter so validatePut and the unreserved pool
see the correct totals before the first Put of the session.

SQS/Kinesis/DynamoDB Streams pollers now catch TooManyRequestsException
explicitly. SQS lets messages return via visibility timeout; Kinesis and
DynamoDB Streams skip advancing the shard iterator, so records are
redelivered on the next poll.

* test(lambda): add SDK compatibility tests for concurrency enforcement

Verify end-to-end wire behavior: LimitExceededException on Put that
violates unreserved-min, TooManyRequestsException on Event invoke when
reserved=0, and DryRun bypassing the concurrency gate.

* fix(lambda): close concurrency races in limiter and rehydrate

- Recompute cap inside the unreserved CAS loop so concurrent setReserved
  does not leave permits granted above the live pool.
- Replace validatePut + setReserved with a single validateAndSetReserved
  guarded by a reservedLock; concurrent Puts for different functions
  can no longer each pass validation against stale totals.
- Rehydrate only $LATEST entries so published versions do not
  double-count into totalReserved().

* fix(lambda): address PR review feedback

- Partition limiter state by region. AWS Lambda concurrency is per
  account-per-region; functions in different regions no longer share
  the same reserved totals or unreserved pool.
- PutFunctionConcurrency and DeleteFunctionConcurrency now roll back
  the limiter update if functionStore.save() fails, so limiter and
  persisted state stay consistent.
- Replace the awkward (InvokeResult) null cast in the DynamoDB Streams
  poller with a plain forward declaration.

* refactor(lambda): rename account-concurrency-limit to region-concurrency-limit

The limit applies per-region (AWS Lambda's "account-level" quota is
actually per-account-per-region). Rename the config key, field, and
accessor to match what the value controls, and clarify the doc note.

No functional change.

* fix(lambda): O(1) region total and compare-and-rollback on save failure

- Maintain per-region AtomicInteger running total of reserved values,
  updated under reservedLock on every mutation. acquireUnreserved reads
  the cap in O(1) without iterating the map, eliminating the weakly-
  consistent partial-sum window that existed when reads happened off
  the lock while writes were serialized.
- Replace unconditional rollback with rollbackReservedIfExpected: the
  limiter only restores the previous value if the current entry still
  matches what the caller wrote, so a concurrent successful Put cannot
  be clobbered by an earlier request's rollback after its save fails.

* docs(lambda): scrub remaining account-wide wording and document drain semantics

Replace lingering "account-wide" / "account pool" phrasing with
per-region terminology in the controller javadoc and unit-test comment.
Two references remain by design: EmulatorConfig and the lambda service
doc quote AWS's own "account-level" label to explain the renamed key.

Also fold two follow-up review items into this change:
- Replace fully-qualified AwsException / InvokeResult references in the
  SQS, Kinesis, and DynamoDB Streams pollers with normal imports.
- Document that reducing or clearing a reserved value does not kill
  already-inflight invocations, mirroring AWS behavior and causing a
  brief drain window where total inflight may exceed the region limit.

* fix(lambda): serialize Put/Delete per function and preserve busy inflight

- Wrap PutFunctionConcurrency and DeleteFunctionConcurrency in a
  per-function lock so concurrent requests for the same ARN can't
  interleave the limiter update and the store save in a way that
  leaves them out of sync.
- Retain the inflight counter on reset when permits are still open,
  so an ARN recreated under load sees the remaining inflight rather
  than starting fresh and briefly allowing more than reserved capacity.
  Idle counters (value 0) are still dropped to prevent leaks.
- Tests now close acquired permits via try-with-resources and cover
  both the retain-while-busy and drop-when-idle reset behaviors.

* test(lambda): close all permits via try-with-resources

Close the acquire() result in regions_areIndependent so the test leaves
no inflight state behind and accurately asserts both the exhausted and
recovered cases.

* perf(lambda): avoid regex split in regionOf on the invoke hot path

regionOf() runs on every acquire/release. Replace String.split(":"),
which uses regex and allocates an array, with a single pass that finds
the fourth ':' segment and returns a substring — same semantics, no
allocation beyond the returned region string.

* fix(lambda): keep per-function lock map and tighten compat assertion

- deleteFunction no longer removes the per-function entry from
  concurrencyOpLocks. Removing it could race with a concurrent
  Put/Delete still synchronized on the old lock object, letting the
  next request create a fresh lock and run in parallel — defeating
  the very serialization the map provides. The map grows by one
  Object per deleted function, acceptable for a local emulator.
- LambdaConcurrencyTest now asserts the wire-level error identity
  (400 status + "LimitExceededException" errorCode) for the Put
  rejection. The Lambda SDK v2 model does not declare a typed
  LimitExceededException class, so wire-level assertions catch
  protocol-fidelity regressions more precisely than the previous
  generic LambdaException check.

* fix(lambda): retain inflight counter on reset and allow over-committed reductions

- reset() no longer drops idle inflight counters. The previous
  counter.get()==0 + remove pattern races with a concurrent
  acquireReserved that has already obtained the AtomicInteger
  reference and is about to increment it: a successful remove
  between those two moments would leave the next acquire to
  allocate a fresh counter and silently undercount inflight,
  permitting reserved over-subscription.
- validateAndSetReserved now allows any value <= the function's
  current reservation unconditionally. Reductions cannot worsen
  unreserved capacity, so blocking them in an already over-committed
  state (e.g. after lowering region-concurrency-limit at runtime)
  prevented operators from recovering. Increases still go through
  the unreserved-min check.

* fix(lambda): take per-function lock in deleteFunction

A concurrent deleteFunction + Put/DeleteFunctionConcurrency for the
same ARN could interleave the limiter reset and the store delete,
leaving the limiter holding (or clearing) state for a function the
store no longer knows about. Wrap the limiter+store mutations in the
same lockForConcurrencyOp(arn) used by the concurrency endpoints.

Tighten the surrounding comment so it describes the current code
rather than the lock-removal call that earlier revisions used to have.

* test(lambda): wire a real concurrency limiter into the test constructor

The package-private LambdaService constructor used by unit tests passed
null for concurrencyLimiter, so the null-guards in
putFunctionConcurrency / deleteFunctionConcurrency / deleteFunction made
those paths silently skip validation and limiter bookkeeping under tests.
That hid divergence from production behavior.

Construct a default LambdaConcurrencyLimiter (AWS defaults: 1000 / 100)
in the test ctor so the same enforcement runs in unit tests.

* test(lambda): cover concurrent PutFunctionConcurrency for the same ARN

Verify that the per-function lock in LambdaService serializes racing
Puts so the limiter and the functionStore always agree on whichever
write landed last. 50 iterations across two threads against the same
function exercise the lock discipline and assert store/limiter
consistency on every iteration.

* docs: document reserved concurrency config keys

- docs/services/lambda.md: drop redundant "(enforced at invocation)"
  from the PutFunctionConcurrency table entry (the admonition below
  already explains enforcement); add region-concurrency-limit and
  unreserved-concurrency-min to the Configuration YAML sample.
- docs/configuration/application-yml.md: mirror the two new keys in
  the top-level reference sample so every known lambda setting is
  discoverable in one place.

* refactor(lambda): address review feedback (A)

- LambdaServiceTest.concurrentPutFunctionConcurrency now asserts against
  limiter.totalReserved(region) instead of getFunctionConcurrency(), which
  read the same field as the value under test. The new assertion actually
  proves the limiter and the persisted store stayed in agreement.
- Expose a package-private concurrencyLimiter() accessor on LambdaService
  so tests can inspect limiter state without reflection.
- Drop unused Permit.NOOP: the reserved=null path now runs through
  acquireUnreserved and always returns a real decrement closure.
- Document the intentional unbounded growth of the inflight counter map
  (race avoidance on reset) and concurrencyOpLocks (race avoidance on
  deleteFunction). Both are acceptable for a local emulator workload.

* test(lambda): add rehydrate, multi-ARN race, and qualified-invoke coverage

- LambdaServiceTest.rehydrateConcurrency_restoresReservedFromStore
  prepopulates a LambdaFunctionStore with reserved values, builds a
  fresh LambdaService over it, and verifies totalReserved(region) goes
  from 0 to the expected sum after the @PostConstruct hook runs.
- LambdaServiceTest.multiArnPutFunctionConcurrency_respectsRegionTotalUnderContention
  races two Puts on different ARNs that would together push the region
  below unreserved-min. reservedLock must let exactly one win; the
  other must fail with LimitExceededException and the limiter's total
  must reflect only the winning reservation.
- Compat LambdaConcurrencyTest.invoke_withVersionQualifier_stillHonorsReservedOnLatest
  publishes a version, sets reserved=0, and invokes with the qualifier
  set. Today Floci drops the qualifier and routes to $LATEST, so the
  reservation throttles the call. This test locks the behavior in: a
  future qualifier-routing change must either copy the reservation onto
  the snapshot or key the limiter off the base ARN to keep it green.

* refactor(lambda): idempotent permits, warn on malformed ARN, more tests

- Wrap acquire()/release() counter closures in an AtomicBoolean guard so
  a double-close of a Permit can never drive the inflight counter
  negative. Future callers that mix try-with-resources with explicit
  close, or that add retry logic around invoke, stay safe by default.
- regionOf() now warns once per unique malformed input instead of
  silently coalescing everything into "unknown". The first occurrence
  is logged so a bug that passes a bare function name into the limiter
  is debuggable without spamming the log.
- New LambdaServiceTest.putFunctionConcurrency_rollsBackLimiterIfSaveFails
  injects a failing LambdaFunctionStore and verifies the limiter total
  is restored when functionStore.save throws.
- New LambdaServiceTest.deleteFunction_preservesInflightPermitUntilItCloses
  holds a permit through a deleteFunction call and asserts the inflight
  counter stays live until the permit is closed.
- New LambdaConcurrencyLimiterTest.permit_closeIsIdempotent locks in the
  double-close guarantee.
2026-04-14 01:09:22 -05:00
TiM 38eb0125a9 refactor(test): narrow Lambda dispatch probe to transport-level exceptions (#395)
* refactor: narrow exception handling to transport-level failures only

The broad catch(Exception) in the Lambda dispatch probe and warmup
swallowed all errors, masking real service regressions as skipped tests.
Narrow to specific transport-level exceptions so only environment
unavailability (timeout, connection refused) triggers a skip:

- Java probe: SdkClientException + ConnectException (not all Exception)
- APIGW warmup: HttpTimeoutException + ConnectException
- Go invoke: net.Error via errors.As (not any error)

Unexpected service errors now propagate as test failures.

* fix: remove unreachable ConnectException catch in lambda probe

AWS SDK wraps all transport-level failures (ConnectException,
ApiCallTimeoutException, etc.) in SdkClientException, so the
separate ConnectException catch was unreachable and broke compilation.

* fix(compat): use unique_name in s3-notifications.bats to avoid parallel collisions

Parallel bats workers could share the same $(date +%s) timestamp,
producing identical bucket/queue/topic names. One worker's
put-bucket-notification-configuration would overwrite another's,
and the round-trip read would return zero filter rules. Switch to
unique_name which appends the shell PID.

* fix(compat): use unique_name in kms and ses bats to avoid parallel collisions

Same class of flake as s3-notifications.bats. Under --jobs 4, parallel
bats workers sharing a $(date +%s) timestamp produce identical alias
names (kms) and identity names (ses), causing cross-worker interference.
2026-04-13 21:49:26 -05:00
Hector Ventura 91071aaae7 feat: implement Amazon MSK service with Redpanda orchestration (#419)
* feat: implement Amazon MSK service with Redpanda orchestration
* fix: adding missing msk service on the test
2026-04-13 20:22:37 -05:00
Hector Ventura cfe48dfabe fix(iam): enforce iam when it turned on (#411)
* fix: iam enforment feature
* fix: adding iam enforment test
* fix: adding iam enforment and update documentation
2026-04-13 14:21:47 -05:00
TiM 0c8395244a test(compat): gate Lambda dispatch tests on container availability (#387)
Tests that invoke Lambda with REQUEST_RESPONSE depend on Docker-in-Docker
for container execution. When DinD is unavailable in CI, these tests time
out instead of skipping. Add a shared memoized probe
(TestFixtures.isLambdaDispatchAvailable) that creates a throwaway Lambda,
invokes it with a 30s timeout, and caches the result per JVM. Tests that
need real dispatch now skip cleanly via Assumptions.assumeTrue.

Java: ApiGatewayV2ExecuteTest, LambdaLongPathTest, S3NotificationsTest
Go: lambda_test.go Invoke subtest
2026-04-12 22:06:41 -05:00
TiM 9ffb26497d test(elasticache): SDK compat suite for replication groups and users (#370)
* test(elasticache): add SDK compat suite

New ElastiCacheTest drives Floci through the AWS SDK v2
ElastiCacheClient surface. First SDK-level compat coverage for this
service.

Covers:
- CreateReplicationGroup / DescribeReplicationGroups /
  DeleteReplicationGroup lifecycle
- CreateUser / DescribeUsers / ModifyUser / DeleteUser lifecycle
- duplicate group / user rejection (AlreadyExistsException shapes)
- missing group / user retrieval (NotFoundException shapes)
- proxy port allocation via direct TCP connection using raw Socket
  (Lettuce is already in sdk-test-java/pom.xml:118 if a real Redis
  client is needed later)

Run separately from the internal Phase 3 integration test so
SDK-contract failures don't tangle with server-logic bugs in review.

* fix(test): add user-group association step for scoped auth validation

Tests now associate user with group via ModifyReplicationGroup before
authenticating. Verifies pre-association rejection, then post-association
success.

* fix(test): document userGroupIdsToAdd deviation in ElastiCache compat suite

Floci treats userGroupIdsToAdd as raw user IDs because UserGroup
resources are not yet implemented. Documented as known deviation
so the test is explicit about exercising current behavior.

* fix(test): replace Java 21 getFirst() with get(0) for Java 17 compat

CI targets Java 17; List.getFirst() requires Java 21.

* fix(test): use proxyHost() and relax exception types for emulator deviations

* ci: re-trigger after flaky ApiGatewayV2ExecuteTest timeout
2026-04-12 21:04:35 -05:00
Hector Ventura e3e8903ffa fix(s3): implement S3 Control ListTagsForResource, TagResource, Untag… (#363)
* fix(s3): implement S3 Control ListTagsForResource, TagResource, UntagResource (#341)
* fix(s3): implement S3 Control ListTagsForResource, TagResource, UntagResource (#341)
2026-04-12 20:24:23 -05:00
TiMandHector Ventura e2680cf5f5 test(apigatewayv2): execute-api dispatch compat suite (#372)
* fix(apigatewayv2): fix route matching for path-parameter routes

routeKeyMatchesPath() used String.replace() on Pattern.quote() output,
which performs literal string matching. Path-parameter placeholders like
{id} and {proxy+} were wrapped in \Q...\E by Pattern.quote(), making
them invisible to the replace() calls. All parameterized routes silently
failed to match.

Rewritten to iterate over placeholders with a regex Matcher, quoting
only the literal segments between them. {param} maps to [^/]+ and
{proxy+} maps to .+ as before.

* test(apigatewayv2): add execute-api dispatch compat suite

New ApiGatewayV2ExecuteTest exercises the v2 execute-api dispatch
path end-to-end: create HTTP API, deploy a Lambda backend via
LambdaClient, wire integration/route/stage/deployment, then invoke
through the execute-api URL and assert the Lambda response flows
back through the gateway.

Scope (per PLAN_FLOCI_2 Phase 7 prerequisite decisions):
- pins current dispatch behavior where stage existence and deployment
  status are NOT checked before dispatch (see
  ApiGatewayExecuteController.java:842-847)
- JWT/token authorizer dispatch path only (REQUEST authorizer has no
  dispatch path today - out of scope)
- no mapping templates / request transforms (no layer exists in
  apigatewayv2/model/Integration.java)

Cross-service blame attribution: if this suite fails while the
existing LambdaTest compat suite passes in the same run, the failure
is on the gateway side.

Gated on Docker for the Lambda backend.

* fix(apigatewayv2): support ANY method and empty proxy in route matching

routeKeyMatchesPath now treats ANY as a wildcard that matches all HTTP
methods, matching AWS API Gateway v2 behavior. Also relaxed {proxy+}
regex from .+ to .* so /echo/{proxy+} matches /echo/ with an empty
proxy value.

* fix(test): skip Lambda-dependent execute tests when dispatch unavailable

CI may not support Docker-in-Docker for Lambda containers. Gate
dispatch and JWT+dispatch tests on the first dispatch response so
they skip instead of fail.

---------

Signed-off-by: Hector Ventura <hectorvent@gmail.com>
Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-04-12 20:23:40 -05:00
TiM 58c0ebbabd test(apigatewayv2): management API compat suite with deploymentId fix (#371)
* fix(apigatewayv2): propagate deploymentId when creating a stage

ApiGatewayV2Service.createStage was dropping the deploymentId field
from the CreateStage request, so stages were being created without
their stage->deployment linkage. The management API handler now
stores deploymentId on the Stage model.

Required for stage->deployment round-trip verification; surfaced by
the upcoming ApiGatewayV2ManagementTest which asserts GetStage
returns the deploymentId that CreateStage was called with.

* test(apigatewayv2): add management API compat suite

New ApiGatewayV2ManagementTest covering the control-plane CRUD
surface: API, route, integration, stage, deployment, authorizer
create/get/list/delete round-trips via ApiGatewayV2Client.

Scope:
- create/get/list/delete for each resource
- JWT authorizer shape (token path only)
- stage->deployment linkage (depends on the createStage
  deploymentId fix in the preceding commit)
- round-trips that assert response field shapes match the SDK model

Out of scope (intentional, per PLAN_FLOCI_2 Phase 2):
- No update endpoints - @PATCH/@PUT handlers do not exist in the
  v2 management block (ApiGatewayController.java:783-1020)
- No execute-api / dispatch / Lambda invocation - that is Phase 7
- No REQUEST authorizer coverage - no dispatch path exists today

* fix(test): assert deploymentId in getStages list response

Codex review flagged that the list endpoint assertion only checked
stageName but not deploymentId. Added filtered assertion to verify the
deployment reference survives the list round-trip.

* fix(test): use deploymentStatusAsString() for enum comparison

SDK returns DeploymentStatus enum, not a String. Using
deploymentStatusAsString() avoids type mismatch assertion failure.
2026-04-12 20:01:27 -05:00
TiM cc5508ffd4 test(rds): JDBC-based IAM auth compat suite for RDS proxy (#366)
* test(rds): add JDBC-based IAM auth compat suite

New RdsJdbcCompatTest drives a real JDBC connection through the RDS
proxy. IAM auth happens at the JDBC wire layer, not through RdsClient
management calls, so this is the only way to actually verify IAM
auth behaves against Floci.

Covers:
- create DB instance with IAM authentication enabled
- generate an auth token via the AWS SDK GenerateAuthenticationToken
  path and open a JDBC connection using that token as the password
- reject connections with a tampered/expired auth token
- proxy port allocation per instance, released on delete
- ModifyDbInstance toggling IAM authentication mid-lifecycle

Uses postgresql JDBC driver (already declared in
sdk-test-java/pom.xml:186). Gated on Docker being available so CI
jobs without a docker daemon skip.

* fix(test): address review findings for RDS JDBC compat suite

Restructure IAM toggle test to start with IAM disabled, verify
rejection, then enable via modify and verify success. Relax port
reuse assertion from exact equality to range check (7000-7099) to
avoid coupling to allocator implementation detail. Increase
connection timeout from 45s to 60s for Docker environments.

* fix(test): address round 6 review findings for RDS JDBC compat suite

Fix stale proxyPort after instance replacement (Codex + Gemini).
Restructure IAM tests: create with IAM enabled for positive tests,
add dedicated non-IAM instance test for negative case. Mark IAM
toggle-via-modify test as @Disabled since RdsAuthProxy.iamEnabled
is final and modifyDbInstance does not restart the proxy. Add
port-parameterized connection helpers for multi-instance tests.

* fix(test): assert old password rejection after ModifyDBInstance

Codex review flagged that the password-change test proved the new
password works but never verified the old one stops working. Add an
explicit assertion that connecting with the pre-modify password throws
SQLException before verifying the new password succeeds.

* fix(test): relax non-IAM rejection assertion to accept TCP-level refusal

When IAM is disabled, the proxy may reject at the TCP level ("connection
attempt failed") rather than the PostgreSQL auth level ("password
authentication failed"). Both are valid rejection modes.
2026-04-12 19:49:34 -05:00
TiM 14d51a4093 test(appconfig): edge case coverage for polling, deployments, empty configs (#365)
* test(appconfig): add edge case coverage for polling, deployments, empty configs

Extends both AppConfigIntegrationTest (internal Quarkus) and the
compat-suite AppConfigTest with five additional cases:

- stale configuration token is rejected with BadRequestException once
  a newer next-poll token has been issued
- syntactically invalid configuration token is rejected
- updated deployment is visible when polling with the next-poll token
  (create v2 hosted config, start deployment, confirm response body
  flips to v2 payload and Version-Label header updates)
- RequiredMinimumPollIntervalInSeconds is accepted in the start
  configuration session request but NOT enforced on subsequent polls
  (pins current Floci behavior per PLAN_FLOCI_2 Phase 1 decision:
  storing-but-not-enforcing is the behavior under test, enforcement
  would be a separate feature PR)
- empty configuration profile (no hosted config version, no
  deployment) returns an empty octet-stream body with empty
  Version-Label

No changes to AppConfigDataService or any main sources; this is
test-only expansion over existing scaffolding.

* fix(test): address review findings for AppConfig edge case tests

Document poll-interval 15s as known emulator deviation (AWS returns
the requested value, emulator always returns 15). Add explicit
nextPollIntervalInSeconds() assertions to the SDK compat test.
Clarify null vs "" Version-Label difference between SDK and HTTP
transport layers.
2026-04-12 19:48:36 -05:00
Hector Ventura 812ecf6880 fix(lambda): correct Function URL config path from /url-config to /url (#364) 2026-04-12 03:15:22 -05:00
Hector Ventura 093a465bde fix: merge branch 'main' of github.com:hectorvent/floci 2026-04-11 21:34:09 -05:00
Hector Ventura a987a44acd fix: adding missing lambda test 2026-04-11 21:33:47 -05:00
Hector Ventura 12775e836d fix(secretsmanager): resolve partial ARNs without random suffix (#360) 2026-04-11 21:30:42 -05:00
Hector Ventura 5129897946 fix(s3): include non-versioned objects in ListObjectVersions response (#359) 2026-04-11 21:26:12 -05:00
Hector Ventura fddb1c7bfd fix(cognito): correct HMAC signature computation in USER_SRP_AUTH (#358) 2026-04-11 21:06:43 -05:00
Hector Ventura 095eefc90b fix(eventbridge): implement advanced content filtering operators (#356) 2026-04-11 20:23:18 -05:00
Hector Ventura 101d45e2b0 fix(kms): implement real asymmetric sign/verify and GetPublicKey (#355)
* fix(kms): implement real asymmetric sign/verify and GetPublicKey

* fix(kms): implement real asymmetric sign/verify and GetPublicKey
2026-04-11 18:14:51 -05:00
Conor Heine a0ed51e9d1 feat: ecr (#337) 2026-04-11 09:59:05 -05:00
Kenshin Okinaka 3b6b5fb687 feat(lambda): add PutFunctionConcurrency stub (#325)
* feat(lambda): add PutFunctionConcurrency stub

Add PutFunctionConcurrency, GetFunctionConcurrency, and
DeleteFunctionConcurrency endpoints:

  PUT    /2017-10-31/functions/{FunctionName}/concurrency
  DELETE /2017-10-31/functions/{FunctionName}/concurrency
  GET    /2019-09-30/functions/{FunctionName}/concurrency

The stored ReservedConcurrentExecutions value is persisted on
LambdaFunction and echoed back, but it is not enforced at invocation
time — invocation slots in LambdaExecutorService / WarmPool are not
bounded, and the account-level concurrent execution limit is not
validated.

* fix(lambda): tighten PutFunctionConcurrency validation
2026-04-11 09:40:12 -05:00
Hector Ventura e4d8d44724 feat: adding appconfig service (#324)
* feat: adding appconfig service
* fix: unittest appconfig service
2026-04-10 02:43:08 -05:00
GitMarco 8bac81807e Fix(dynamoDB): handle null for Java AWS SDK v2 DynamoDB EnhancedClient correctly (#309)
* Fixes DynamoDB support for adding values to a list for the SET ... ADD query/command
* Revert "Fixes DynamoDB support for adding values to a list for the SET ... ADD query/command"
* fix(dynamoDB): support Java AWS SDK v2 enhanced client null values
* fix(dynamoDB): added compatibility integration test for DynamoDB EnhancedClient. Including suggestion for default host+port for test fixture, so `mvn test -q` can work even without setting the env variable set.
2026-04-09 17:53:48 -05:00
Fred PeñaandHector Ventura 04cbeb542f fix: Implement S3 Lambda notifications (#278)
* feat: Implement S3 Lambda notifications

Add support for S3 event notifications to AWS Lambda functions.
- Introduce `LambdaNotification` model to represent Lambda configurations.
- Update S3 controller to parse and serialize `CloudFunctionConfiguration` in notification XML.
- Implement logic in `S3Service` to extract Lambda ARN details and invoke functions upon matching S3 events.
- Add unit and integration tests for Lambda notification configuration persistence and event triggering.

* test(s3-notifications): Add S3 bucket notification compatibility tests

Introduces `S3NotificationsTest` to verify S3 event notifications for SQS, SNS, and Lambda targets.
Includes tests for notification configuration round-trip and Lambda invocation with object filters.
Adds `s3NotificationLoggerZip` to `LambdaUtils` for creating a test Lambda function.

Co-authored-by: Hector Ventura <hectorvent@gmail.com>
2026-04-08 23:11:20 -05:00
Hector Ventura 9ca82e5748 feat(eventbridge): add InputTransformer support and S3 event notifications (#294)
* feat(eventbridge): add InputTransformer support for rule targets

Support InputPathsMap + InputTemplate on EventBridge targets so events
can be projected to a subset of fields before delivery to SQS/SNS/Lambda.

- Add InputTransformer model with inputPathsMap and inputTemplate fields
- Parse and serialize InputTransformer in PutTargets / ListTargetsByRule
- Apply transformer in invokeTarget: extract JSONPath variables, substitute
  <varName> placeholders in the template
- Use Jackson JsonPointer for JSONPath resolution ($.a.b.c → /a/b/c)
- Add unit tests for extractJsonPath and applyInputTransformer edge cases
- Add integration tests covering full put/list/deliver/transform flow

Fixes #140
2026-04-08 16:23:59 -05:00
Hector Ventura 4724db97be feat: add KMS GetKeyPolicy, PutKeyPolicy and fix CreateKey Tags (#258 #259 #269) (#280) 2026-04-08 01:37:38 -05:00
Hector Ventura 5e8b39c1aa fix: resolve Cognito auth, token, and user lookup issues (#218 #220 #228 #229 #233 #234 #235) (#279) 2026-04-08 01:30:26 -05:00
Hector Ventura 6d5839bec8 fix(s3): versioning IsTruncated, PublicAccessBlock, ListObjectsV2 pagination, K8s virtual host routing (#276) 2026-04-07 22:57:33 -05:00
Conor Heine 13916913e8 fix: handle base64-encoded ACM cert imports (#248) 2026-04-07 13:20:27 -05:00
Hector Ventura 18bee5b278 feat(sfn): nested state machine execution and activity support (#254, #91) (#266) 2026-04-07 12:41:25 -05:00
Hector Ventura 37026b75f1 feat(secretsmanager): add support for BatchGetSecretValue (#115) (#264) 2026-04-07 12:41:06 -05:00
Hector Ventura 0ef6f87cba feat(lambda): add missing runtimes, fix handler validation, long path… (#256)
* feat(lambda): add missing runtimes, fix handler validation, long path extraction, and code signing config
* fix: removed unrequired go.sum and package-lock.json from compatibility test
2026-04-07 12:40:30 -05:00
Kenshin Okinaka 48b6ca3475 feat(scheduler): add EventBridge Scheduler service (#260)
* feat(scheduler): add EventBridge Scheduler ScheduleGroup CRUD

Introduces the scheduler service skeleton with ScheduleGroup CRUD over
the REST JSON protocol at /schedule-groups/{Name}. The default group is
lazily seeded on first access, mirroring the EventBridge default bus
pattern. Covers Create/Get/Delete/List, region scoping, name validation,
and the default-group delete guard.

* feat(scheduler): add Java SDK compatibility tests for ScheduleGroup CRUD
* feat(scheduler): add Schedule CRUD operations
2026-04-07 12:36:59 -05:00
Conor Heine eeefb729c4 test: move compatibility tests into this repo (#225)
* test: move compatibility tests into this repo
* fix: add StatisticValues parsing to CloudWatchMetricsJsonHandler
* fix: add missing required abstract methods to EmulatorConfig in EventBridgeSchedulerIntegrationTest
* test: add sdk tests for multipart S3 copy coverage
* fix: cover and fix smithy cbor and multipart s3 copy regressions
* test: migrate more test coverage to new folder
* test: add missing ec2 expectation in healthcheck test
* docs: update READMEs in `./compatibility-tests`
2026-04-06 09:35:53 -05:00