mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
b988dc5d1ae523ac2d76abdcf71a1f8a48177ff9
324
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
b449ba2c29 |
feat(cloudmap): add AWS Cloud Map (servicediscovery) management API (#1217)
* feat(cloudmap): add AWS Cloud Map (servicediscovery) management API Implements the Route53AutoNaming_v20170314 JSON 1.1 service: namespace management (HTTP/public-DNS/private-DNS), services, instance register/ deregister, async operation tracking, DiscoverInstances/DiscoverInstancesRevision (honouring the data- host prefix), instance health status, and tags. Dispatched via AwsJson11Controller; storage through StorageFactory; config in EmulatorConfig + application.yml. Covered by an in-repo RestAssured integration test and an AWS SDK v2 ServiceDiscoveryClient compatibility test. * refactor(cloudmap): drop unused prefix variable in scanInstances |
||
|
|
4446404288 |
feat(appsync): Phase 2 — Schema Registry, Model Fixes, CRUDL completion & AWS Scalars (#1185)
* build: add graphql-java dependency
* feat(appsync): add and extend data models for Phase 2
- Add AdditionalAuthenticationProvider, DomainName, ChannelNamespace, ApiAssociation models
- Add 14 fields to GraphqlApi (apiType, visibility, owner, etc.)
- Change additionalAuthenticationProviders from raw maps to typed list
- Add 6 fields to Resolver (resolverArn, cachingConfig, maxBatchSize, etc.)
- Add dataSourceArn to DataSource
- Rename FunctionConfiguration.arn to functionArn
* feat(appsync): add service and controller changes for Phase 2
* feat(appsync): add service and controller changes for Phase 2
* test(appsync): add Phase 2 integration tests
Add ~60 new tests for:
- Model completeness (new fields, ARNs, functionArn rename)
- Domain names CRUDL + associate/disassociate
- Channel namespaces CRUDL + update
- Merged API associations CRUDL
- Enhanced metrics
- Schema registry parsing with AWS scalars and extensions
- Directive registration (aws_api_key, aws_subscribe, deprecated, unknown)
- Edge cases (null auth providers, maxBatchSize 0, cleanup on delete)
* test(appsync): add AWS scalar unit tests
Test all 17 AWS scalars:
- All registered in AppSyncScalarRegistry
- AWSDateTime, AWSJSON, AWSEmail parse valid/invalid values
- AWSTimestamp and AWSShort range validation
- AWSURL and AWSPhone format validation
* test(appsync): add SDK compatibility tests for Phase 2
Validate that the AWS SDK Java v2 can read:
- dataSourceArn() on CreateDataSource response
- resolverArn() on CreateResolver response
- functionArn() on CreateFunction response
- BadRequestException on invalid schema creation
* docs(appsync): add Phase 2 operations, schema registry, and AWS scalars documentation
- Add Domain Names, Channel Namespaces, Merged API Associations, Enhanced Metrics
- Document AWS scalar types (17 scalars with validation rules)
- Document AppSync directives (8 directives with locations)
- Update Not Implemented section with future phase references
- Add CLI examples for domain names and channel namespaces
- Update cascade delete to include channel namespaces and domain associations
* docs: add AppSync to service tables, env vars, storage config, and SDK README
- README.md: add AppSync to category table, detailed notes, and architecture diagram
- docs/index.md: add AppSync to supported services table, fix count to 52
- docs/configuration/environment-variables.md: add FLOCI_SERVICES_APPSYNC_ENABLED
- docs/configuration/advanced/application-yml.md: add appsync config block
- docs/configuration/storage.md: add AppSync per-service storage override
- compatibility-tests/sdk-test-java/README.md: add AppSyncTest to services table
* fix(appsync): reuse ObjectMapper and fix AWSJSON serialize for non-string values
AWSJSON scalar was creating a new ObjectMapper on every parseValue() call. serialize() used toString() which produces invalid JSON for Map/JsonNode results.
* fix(appsync): strip string literals and comments before unknown directive validation
The regex @(\w+) incorrectly flagged @ mentions inside GraphQL string literals and comments as unknown directives.
* fix(appsync): prevent silent overwrite on creates, validate required fields and input values
- Add existence checks on createDataSource, createResolver, createType,
createChannelNamespace, createMergedApiAssociation (→ ConflictException 409)
- Validate authenticationType is required on createGraphqlApi
- Validate typeName is required on createResolver
- Validate dataSourceName exists on createResolver and createFunction
- Prevent associateApi from silently overwriting existing association
- Enforce API key limit (max 2 per API)
- Fix expires parsing to accept ISO 8601 strings, throw on invalid values
- Fix castInt overflow detection
- Fix updateApiKey expires validation (was silently swallowing errors)
- Change InvalidNextTokenException to BadRequestException (AWS standard)
- Fix maxResults=0 to return empty page
- Fix getIntrospectionSchema to throw 404 instead of returning null
- Fix tags with null values (was producing literal string "null")
* test(appsync): fix cascade delete test to create data source before function, align with new validation
* refactor(appsync): remove dead code and unused hasSchema()
- Delete AppSyncDirectiveRegistry.java (100 lines, never used)
- Delete DirectiveValidator.java (45 lines, never called)
- Remove hasSchema() from SchemaRegistry (never called)
* fix(appsync): scalar null-safety, type validation, and DNS resolution
- Add null checks to 5 serialize() methods (AWS_TIMESTAMP, AWS_LONG,
AWS_INTEGER, AWS_BOOLEAN, AWS_FLOAT) to prevent NPE
- Fix AWS_TIMESTAMP parseValue() ClassCastException on String input
- Replace InetAddress.getByName() with regex in AWS IPAddress to
prevent DNS resolution (SSRF concern)
- AWSBoolean now rejects non-boolean values (matches AppSync behavior)
* refactor(appsync): centralize directive definitions in AppSyncDirective enum
- Add AppSyncDirective enum as single source of truth for directive
names and SDL definitions
- Update AppSyncSchemaParser to use enum instead of duplicated strings
- Eliminates 3 sources of truth (validateNoUnknownDirectives Set,
injectDirectiveDefinitions SDL, and formerly AppSyncDirectiveRegistry)
* perf(appsync): cache scalarMap in AppSyncScalarRegistry
- Initialize scalarMap once in constructor as unmodifiableMap
- Avoids recreating HashMap on every call (was called twice per
schema parse)
* test(appsync): add tests for scalar fixes and behavior changes
- Add tests for null-safety in serialize() (5 scalars)
- Add test for AWSTimestamp parseValue with String input
- Add tests for AWSIPAddress regex validation (IPv4, IPv6, invalid)
- Add tests for AWSBoolean rejecting non-boolean values
- Add test for scalarMap caching
* test(sdk): add AWS scalars schema creation test
Verifies that schemas with AWS scalar types (AWSDateTime, AWSJSON,
AWSIPAddress, AWSBoolean) parse correctly via the SDK.
* fix(appsync): correct API paths to match AWS documentation
- Channel namespaces: /v1/ → /v2/, channelnamespaces → channelNamespaces
- Domain association: /apis → /apiassociation
- Remove ListApiAssociations (not a real AppSync operation)
- Remove GetEnhancedMetricsConfig (not a real AppSync operation)
- Rename Merged API Association to Source API Association with correct paths:
- AssociateSourceGraphqlApi: POST /v1/mergedApis/{id}/sourceApiAssociations
- GetSourceApiAssociation: GET /v1/mergedApis/{id}/sourceApiAssociations/{id}
- ListSourceApiAssociations: GET /v1/apis/{apiId}/sourceApiAssociations
- DisassociateSourceGraphqlApi: DELETE /v1/mergedApis/{id}/sourceApiAssociations/{id}
* feat(appsync): add SourceApiAssociation models
Add SourceApiAssociation, SourceApiAssociationConfig, and
SourceApiAssociationSummary models to support merged/source API
association operations per AWS AppSync API Reference.
* feat(appsync): add ChannelNamespace support models
Add AuthMode, HandlerConfig, HandlerConfigs, Integration, and
LambdaConfig models for ChannelNamespace handler configuration
per AWS AppSync API Reference.
* fix(appsync): fix ApiAssociation and ChannelNamespace models
ApiAssociation: remove source/merged API fields, keep only domain
association fields (apiId, associationStatus, deploymentDetail,
domainName) per AWS AppSync API Reference.
ChannelNamespace: add missing fields (channelNamespaceArn,
codeHandlers, created, handlerConfigs, lastModified,
publishAuthModes, subscribeAuthModes, tags) per AWS docs.
* feat(appsync): add missing service methods and fix response models
- associateApi now returns full ApiAssociation object
- createMergedApiAssociation returns SourceApiAssociation
- createSourceApiAssociation returns SourceApiAssociation
- getSourceApiAssociation validates mergedApiId
- listSourceApiAssociations returns SourceApiAssociationSummary
- Add updateSourceApiAssociation method
- Add deleteMergedApiAssociation method
- ChannelNamespace: populate arn, timestamps on create/update
* feat(appsync): fix response formats and add missing endpoints
- associateMergedGraphqlApi: response key apiAssociation → sourceApiAssociation
- disassociateSourceGraphqlApi: returns 200 + body (not 204)
- associateApi: returns full ApiAssociation from service
- Add POST /v1/mergedApis/{id}/sourceApiAssociations/{assocId} (UpdateSourceApiAssociation)
- Add DELETE /v1/sourceApis/{id}/mergedApiAssociations/{assocId} (DisassociateMergedGraphqlApi)
* test(appsync): fix and add integration tests for new endpoints
- Fix associateSourceGraphqlApi: use mergedApiId and sourceApiAssociationStatus
- Fix deleteSourceApiAssociation: expect 200 with body (not 204)
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
* test(appsync): add SDK tests for missing operations
- Add updateDomainName test
- Add associateMergedGraphqlApi test
- Add updateSourceApiAssociation test
- Add disassociateMergedGraphqlApi test
- Fix test ordering for new domain tests
|
||
|
|
e36576c2a4 |
feat(ses): per-configuration-set sending toggle (v1 + v2) (#1193)
Add UpdateConfigurationSetSendingEnabled (SES v1 Query) and
PutConfigurationSetSendingOptions (SES v2 REST, PUT
/v2/email/configuration-sets/{name}/sending) to toggle email sending
on a single configuration set, complementing the existing
account-level UpdateAccountSendingEnabled / PutAccountSendingAttributes
toggle. The two APIs share state: both write
`ConfigurationSet.sendingEnabled` (Boolean, null/true = enabled).
Enforcement is centralized in SesService.validateConfigurationSet,
which is called by SendEmail, SendRawEmail, and SendBulkTemplatedEmail
(v1 and v2 paths). When the CS's sendingEnabled is false, the send is
rejected with SendingPausedException + "Sending is paused for
configuration set <name>" — matching the exact wire shape AWS returns
in production (verified via `aws sesv2 send-email` against an AWS
account with a disabled CS; both ErrorCode and Message reproduce as-is).
Read-back paths:
- v2 GetConfigurationSet returns SendingOptions: {SendingEnabled}
- v1 DescribeConfigurationSet with `reputationOptions` attribute
returns ReputationOptions/SendingEnabled (matches the AWS v1 wire
contract where SendingEnabled lives under ReputationOptions)
The v1 action is also added to AwsQueryController.SES_ACTIONS so that
action-name-based service routing recognizes it.
Tests
- SesConfigurationSetSendingOptionsV2IntegrationTest (13 cases): toggle
via both APIs, cross-API state sharing, SendEmail rejection with
SendingPausedException when disabled, read-back via Get/Describe,
bad-request validation, unknown CS returns 404 via v2.
- SesConfigurationSetSendingTest (SDK compat, 9 cases): AWS Java SDK
v2 marshalling of both APIs, with sendEmail rejection asserted as
`SendingPausedException` (the AWS SDK class corresponding to the
matched server-side error code).
Docs
- docs/services/ses.md: list both APIs in their respective tables.
|
||
|
|
6089d8ddc7 | feat: support Glue user-defined functions (#1187) | ||
|
|
2d30641479 |
fix(dns): resolve public hostnames from spawned containers (#1168)
Lambda/CodeBuild containers get Floci's IP as their only DNS, so all public-name resolution flows through Floci's embedded UDP/53 forwarder. The forwarder read responses into a hardcoded 512-byte buffer, silently truncating larger EDNS0 responses (e.g. CDN-backed hosts), so public lookups failed inside Lambda with ENOTFOUND/EBUSY. - Enlarge the forwarder receive buffer to 4096 bytes (EDNS0). - Forward across an ordered upstream list (resolv.conf + configurable public fallbacks), returning the first valid response; warn when all upstreams fail instead of dropping the response silently. - Append configurable fallback resolvers (default 8.8.8.8, 8.8.4.4) after Floci's IP on spawned containers' HostConfig.Dns, controllable via floci.dns.container-fallback-* / FLOCI_DNS_CONTAINER_FALLBACK_*. Closes #1110 |
||
|
|
19b0432b8c |
feat(ses): apply suppression list during send with per-CS SuppressionOptions override (#1109)
When SendEmail / SendRawEmail is called with a recipient on the
account-level suppression list whose reason matches the effective
SuppressedReasons (the configuration set's SuppressionOptions
override if present, else the account-level reasons), Floci now:
1. Emits a synthetic Bounce or Complaint event (per the suppression
reason) through the configured event destinations alongside the
always-emitted Send event.
2. Drops the suppressed recipient from the SMTP relay step, while
still delivering the message to non-suppressed recipients on the
same send.
The SendEmail API response (200 + MessageId), the stored SentEmail
(used by the LocalStack-compatible /_aws/ses inspection endpoint),
and the published event's mail.destination all continue to reflect
the original recipient list — matching how AWS reports the message
at the API and event layers.
This PR bundles two related pieces:
- The per-configuration-set SuppressionOptions block (Put endpoint +
GetConfigurationSet response shape + getEffectiveSuppressedReasons
helper). Mirrors AWS V2 PutConfigurationSetSuppressionOptions:
empty list = explicit "no suppression filtering" for this CS,
unset block = fall back to account-level reasons. The validation
message for the new endpoint matches the AWS V2 natural-language
form ("Reason <X> is invalid, must be one of [BOUNCE, COMPLAINT].")
which is distinct from the V1-style nested message returned by the
three older suppression endpoints; both forms were verified
against live AWS on 2026-06-03.
- The send-time filter + synthetic-event partitioning, plumbed
through getEffectiveSuppressedReasons so the override takes effect
per-send. collectSuppressedReasons and resolveSuppressionReason
now both take configurationSetName, hitting the per-CS override
when present and falling back to the account-level reasons
otherwise.
Per-recipient: when only some recipients are suppressed, the
non-suppressed ones still reach smtpRelay.relay() / relayRaw().
The relay is skipped entirely only when every recipient is
suppressed.
- Recipient suppressed with reason BOUNCE (and BOUNCE in the
effective reasons) -> synthetic Bounce event; not relayed.
- Recipient suppressed with reason COMPLAINT (and COMPLAINT in the
effective reasons) -> synthetic Complaint event; not relayed.
- Reason mismatch or address not on the list -> Send only; relayed
normally.
- Simulator-address recipients and suppression-listed recipients
are unioned into the same event's recipient list, deduplicated.
Tests
- SesConfigurationSetSuppressionOptionsV2IntegrationTest (16 cases)
for the CRUD + helper.
- SesConfigurationSetTest SDK compat (6 V2 cases) using
SesV2Client.PutConfigurationSetSuppressionOptions and the typed
SuppressionListReason enum (+ the WithStrings escape hatch for
the server-side validation path).
- SesServiceSmtpTest grows four cases pinning the send-time
override behaviour: empty list on the CS disables filtering and
the relay receives the address; BOUNCE-only override leaves
COMPLAINT-suppressed addresses unfiltered; a CS without an
override falls back to account-level (parity with no-CS sends);
raw-send mirrors the JSON-send path.
- SesEventPayload / SesEventPublishingV2IntegrationTest / further
send-path coverage from the original suppression PR is preserved.
- All 452 SES tests pass.
|
||
|
|
30a598f080 |
feat(kms): add GenerateRandom action (#1036)
- Add GenerateRandom action routing and handler in KmsJsonHandler - Add SecureRandom field, constructor overload, and generateRandom() method with bounds validation - Reject unsupported Recipient and CustomKeyStoreId fields - Add integration tests for happy path, boundaries, validation, and unsupported fields - Add SDK compatibility tests for Java, Python, and Node |
||
|
|
d7ddac73fe |
feat(appsync): AWS AppSync management API (Phase 1) (#1108)
* feat(appsync): add GraphQL API management service
Implement Phase 1 CRUDL management API for AWS AppSync.
Includes controller, service layer, and model classes for:
- GraphQL API lifecycle (create/get/update/delete/list)
- Schema creation and introspection
- Data Sources, Resolvers, Functions, Types, API Keys
- Tagging and Environment Variables
* chore(appsync): register service in config and catalog
Add AppSync service configuration (EmulatorConfig), service
descriptor (ResolvedServiceCatalog), YAML config entries, and
SDK test client fixture.
* test(appsync): add integration and SDK compatibility tests
AppSyncIntegrationTest: 44 tests covering CRUDL for all resources
GraphQL API, Schema, DataSources, Resolvers, Functions, Types,
API Keys, Tags, Environment Variables, and cascade delete.
AppSyncTest: AWS SDK v2 compatibility tests for management API
operations using the real AppSyncClient.
* feat(appsync): add typed enums for AWS API models
Add Java enums matching AWS AppSync API constants:
- AuthenticationType (API_KEY, AWS_IAM, COGNITO, OIDC, LAMBDA)
- DataSourceType (NONE, LAMBDA, DYNAMODB, HTTP, EVENTBRIDGE, ...)
- ResolverKind (UNIT, PIPELINE)
- ResolverRuntimeName (APPSYNC_JS, VTL)
- TypeFormat (SDL, JSON)
- SchemaCreationStatusType (PROCESSING, ACTIVE, FAILED, ...)
* refactor(appsync): align model types with AWS API reference
- DataSource.type: String → DataSourceType enum
- GraphqlApi.authenticationType: String → AuthenticationType enum
- GraphqlApi.logConfig: String → Map<String, Object> (structured)
- GraphqlApi.additionalAuthenticationProviders: Map → List<Map> (array)
- GraphqlApi.xrayEnabled: String → Boolean
- Resolver.kind: String → ResolverKind enum
- Resolver.ResolverRuntime.name: String → ResolverRuntimeName enum
- AppSyncType.format: String → TypeFormat enum
- SchemaCreationStatus.status: String → SchemaCreationStatusType enum
- ApiKey.expires: String → Long (epoch seconds)
* fix(appsync): correct ARN format, add enum validation, fix field types
- Function ARN: add missing region parameter
- Add parseEnum() helper for type-safe enum deserialization
- Reject invalid enum values with BadRequestException (400)
- Handle String/Boolean/Number coercion for xrayEnabled, expires
- Remove extra 'details' from StartSchemaCreation response
- Pass region to createFunction from controller
* fix(appsync): validate required fields on resource creation
Reject requests missing required fields with BadRequestException (400):
- CreateGraphqlApi: name required
- CreateDataSource: name and type required
- CreateResolver: fieldName and dataSourceName required
- CreateFunction: name required
- CreateType: name required
* test(appsync): add error handling, delete standalone, and cascade tests
Add 22 new integration tests (44 → 66 total):
- Error handling: missing name, blank name, invalid enum, missing required
fields for API/DataSources/Resolvers/Functions/Types (11 tests)
- Non-existent resource 404 tests for API, DataSource, Type (3 tests)
- Delete standalone: verify CRUD delete for Resolver, DataSource,
Function, Type, ApiKey with post-delete 404 confirmation (5 tests)
- Cascade verification: API delete cascades to DataSources and Functions;
Function delete does not affect resolvers (3 tests)
* feat(appsync): add pagination support for list endpoints
Add maxResults and nextToken query params to all list endpoints:
- ListGraphqlApis, ListDataSources, ListResolvers, ListResolversByFunction
- ListFunctions, ListTypes, ListApiKeys
Uses offset-based pagination with Base64-encoded tokens, following
the Pricing service pattern. Returns nextToken when more results
are available, null when all results have been returned.
* test(appsync): add pagination integration tests
Add 9 pagination tests (66 → 75 total):
- ListApis with maxResults returns subset and nextToken
- ListApis with nextToken returns second page
- ListApis without pagination returns all items
- ListDataSources, ListTypes, ListFunctions, ListApiKeys,
ListResolvers with maxResults
- Invalid nextToken returns 400
* fix(appsync): align SDK test with AWS SDK v2 model, extract type name from SDL
- Fix SDK test: use typeAsString() for enum comparison, remove apiKey()
field assertion, use functions() instead of functionConfigurationList()
- Extract type name from SDL definition when name is not provided
(matches real AWS CreateType behavior)
- Update integration test for type creation without explicit name
* fix(appsync): use extracted type name when definition-based extraction succeeds
The type name extracted from SDL definition was stored in a local
variable but not set on the AppSyncType object, causing createType
to return a type without name and making subsequent get/delete fail.
* refactor(appsync): inject RegionResolver instead of passing region as string
Follow the established pattern used by BackupService and PipesService.
Replace manual ARN string concatenation with regionResolver.buildArn()
and remove the hardcoded accountId field.
* fix(appsync): add functionId to Resolver model and fix listResolversByFunction filtering
The listResolversByFunction endpoint was incorrectly comparing
function.getName() with resolver.getDataSourceName(), which is not
the correct AWS AppSync relationship. Resolvers reference functions
via a functionId field, not by data source name matching.
- Add functionId field to Resolver model
- Handle functionId in createResolver and updateResolver
- Fix listResolversByFunction to filter by functionId
- Add listResolversByType method for per-type filtering
* feat(appsync): add global listResolvers endpoint
Add GET /v1/apis/{apiId}/resolvers to list all resolvers across all
types, matching the AWS AppSync API. The per-type endpoint
(GET /v1/apis/{apiId}/types/{typeName}/resolvers) is preserved.
- Add global listResolvers to controller
- Rename per-type endpoint to listResolversByType for clarity
- Add integration test for global listResolvers
- Update listResolversByFunction test to verify functionId-based filtering
* test(appsync): complete SDK compatibility tests for Phase 1
Add missing SDK v2 compatibility tests to match all Phase 1 operations:
- API Keys: updateApiKey, deleteApiKey
- Resolvers: updateResolver
- Types: createType, getType, listTypes, updateType
- Error handling: getNonExistentApi, getNonExistentDataSource,
getNonExistentType throw AppSyncException
Total SDK tests: 24 → 35. All operations in Phase 1 are now covered.
|
||
|
|
2c9e0bce7c |
feat(ses): support V1 ConfigurationSetEventDestination CRUD (#1111)
V2 SES already exposes ConfigurationSet event-destination CRUD via REST JSON; this PR adds the matching V1 Query actions (CreateConfigurationSetEventDestination / UpdateConfigurationSetEventDestination / DeleteConfigurationSetEventDestination) and extends DescribeConfigurationSet so V1 callers can round-trip their stored destinations. The service layer (`SesService.createConfigurationSetEventDestination` etc.) already had the persistence and validation logic, so most of the work is wire-format: parse V1 Query parameter shapes, render V1 XML responses, and route the new action names. - SesQueryHandler: three new Query actions plus `readEventDestination(params, prefix)` and `writeEventDestination` helpers. V1 wire field names use uppercase `ARN` / `NS` suffix variants (`SNSDestination.TopicARN`, `KinesisFirehoseDestination.IAMRoleARN` / `DeliveryStreamARN`, `CloudWatchDestination.DimensionConfigurations.member.N`) which are mapped onto the existing model classes; the `EventDestination.Enabled` default mirrors the V2 primitive-boolean default of `false` when omitted. - V1 event-type wire forms are lowercase camelCase (`send`, `complaint`, `renderingFailure`) while floci stores the V2 canonical form (SCREAMING_SNAKE). New `V1_EVENT_TYPE_TO_INTERNAL` / `INTERNAL_EVENT_TYPE_TO_V1` maps translate in both directions; unknown values pass through so the existing validate-against-VALID_EVENT_TYPES check still catches typos. - `handleDescribeConfigurationSet`: when `ConfigurationSetAttributeNames.member.N=eventDestinations` is requested, render the stored event destinations as a V1 XML block. Treat a null `ConfigurationSet.eventDestinations` list as empty when rendering, so a corrupted persisted JSON with `"EventDestinations": null` still produces an empty `<EventDestinations/>` container rather than NPE-ing. Other ConfigurationSet attribute names (trackingOptions, deliveryOptions, reputationOptions) remain unsupported and are silently ignored — they will land with their respective Put*Options PRs. The container is emitted even when the destination list is empty so the response depends only on the requested attributes. - `writeEventDestination`: skip destination blocks when required fields are blank (defensive belt-and-suspenders for any legacy state) and filter incomplete CloudWatch dimension members so partial members don't leak into the XML. - `SesService.validateEventDestination`: centralize required-field validation for SNS / Firehose / CloudWatch dimensions, so both V1 and V2 reject partial destinations at create/update time. Members with missing required fields now fail with a 400 `InvalidParameterValue` carrying the offending member index. - `AwsQueryController.SES_ACTIONS`: include the three new actions in the action-name → "email" service routing fallback so SigV4 requests whose credential scope doesn't pin the service still reach SES. Tests - `SesConfigurationSetEventDestinationV1IntegrationTest`: 15 cases covering create / describe-with-attribute / describe-without-attribute / describe-empty-attribute / duplicate / update / update-unknown / delete / delete-unknown / partial Firehose / partial CloudWatch dim / blank SNS TopicARN / action-name routing fallback when the Authorization header is absent. - `SesServiceEventDestinationTest`: 8 new unit cases for the centralized SNS / Firehose / CloudWatch dim validation, exercising validateEventDestination directly. - `compatibility-tests/sdk-test-java SesConfigurationSetEventDestinationTest`: extended to drive both V1 (SesClient) and V2 (SesV2Client) against a live Floci. Each protocol gets its own config set; nine new V1 tests mirror the V2 lifecycle plus partial-Firehose rejection. |
||
|
|
35211adc4a |
feat(ses): publish SES events to SNS configuration set destinations (#1106)
* feat(ses): publish SES events to SNS configuration set destinations Add SES V2 event publishing to SnsDestination targets configured on a ConfigurationSet. When SendEmail / SendRawEmail / SendTemplatedEmail / SendBulkEmail is invoked with a ConfigurationSetName, Floci builds the matching AWS-format event payload (a `mail` block plus an event-type- specific block) and publishes it to each enabled SNS destination whose MatchingEventTypes includes that event. Events emitted - SEND on every successful send. - DELIVERY / BOUNCE / COMPLAINT / REJECT when a recipient matches the corresponding AWS mailbox simulator address (success@ / bounce@ / complaint@ / suppressionlist@simulator.amazonses.com). - Per-event-type recipient lists (delivery.recipients, bounce.bouncedRecipients, complaint.complainedRecipients) are filtered to only the simulator address that triggered the event and emitted in their canonical trimmed form; mail.destination carries the full envelope. Wire-level fidelity - Event payload mirrors the AWS SES SNS notification format documented at https://docs.aws.amazon.com/ses/latest/dg/event-publishing-retrieving-sns-examples.html. - mail.tags includes user-supplied EmailTags / DefaultEmailTags / ReplacementTags (V2) and Tags.member.N / DefaultTags.member.N / Destinations.member.N.ReplacementTags (V1 Query). Each tag emits as {Name: [Value]}. - mail.headers[] appends user-supplied Content.Simple.Headers and Content.Template.Headers after the auto-emitted From/To/Cc/Subject; null/blank Names are rejected with "The header name must be specified." (BadRequestException 400). - V2 SendBulkEmail BulkEmailEntries accept ReplacementTags (merged by Name onto DefaultEmailTags) and ReplacementHeaders (merged case-insensitively per RFC 5322 onto DefaultContent.Template.Headers). - mail.sendingAccountId resolves from EmulatorConfig.defaultAccountId(). - ConfigurationSet existence is validated up-front on sendEmail / sendRawEmail / sendBulkTemplatedEmail — an unknown name fails fast with ConfigurationSetDoesNotExist (V2 controller remaps to NotFoundException 404, V1 returns 400) before any message is stored or relayed. Validation errors aligned with live AWS - EmailTags blank Name: BadRequestException 400 "The tag name must be specified." (V2) / InvalidParameterValue 400 same message (V1). - ConfigurationSetName not found: same error code, status, and message as AWS. Raw email handling - For V2 SendEmail with Raw content (and V1 SendRawEmail), when the caller did not provide Destinations, Floci falls back to To/Cc/Bcc parsed from the raw MIME via SmtpRelay.parseRawHeaders (extracted from the existing relay logic). MIME parsing is only invoked when needed (no explicit Destinations or event publishing active). Internal shape - New records: model/MessageTag (Name, Value, for EmailTags) and model/MessageHeader (Name, Value, for Content.Headers) — kept distinct from the resource-tag Tag (Key, Value). - SesEventPublisher dispatches to SnsService; non-SNS destination types log a warning and are skipped (Firehose / EventBridge / CloudWatch / Pinpoint), and missing SnsDestination.TopicArn likewise warns instead of silently dropping. Failures preserve the throwable in the warn log. Tests - SesEventPayloadTest covers mail/commonHeaders/headers/tags shape, per-event filtering, and the headers/tags propagation paths. - SesServiceMergeEmailTagsTest / SesServiceMergeHeadersTest pin Bulk Default vs per-entry merge semantics (tags by Name case-sensitive, headers by Name case-insensitive per RFC 5322). - SesEventPublishingV2IntegrationTest exercises Send / Delivery / Bounce / SendOnly / mixed-recipient / disabled-destination / V1-MIME-fallback / EmailTags / V1-Tags / Simple.Headers paths end-to-end through SES -> SNS -> SQS. - compatibility-tests/sdk-test-java/SesEventPublishingTest validates SendEmail with EmailTags/Headers and SendBulkEmail with per-entry ReplacementHeaders override using AWS Java SDK V2 clients. * fix(ses): address Copilot review on upstream PR #1106 - SesService.validateConfigurationSet: clarify the Javadoc — the helper always throws with httpStatus = 400, and the V2 controller's remapV1Exception is what turns ConfigurationSetDoesNotExist into NotFoundException 404. The previous "(404 in V2, 400 in V1)" hint read as if the helper itself picked the status, which is misleading. - SesController.parseEmailTagsArray: reject non-object entries with "<fieldName> entries must be JSON objects.", mirroring the existing parseHeadersArray check. Previously a string/number element would hit the blank-Name path and report a less specific message. - SesService.mergeHeaders / mergeEmailTags: also skip entries whose name is the empty string, not just null. Both parsers reject blank names at the boundary, but defending the merge helpers keeps them safe for direct callers (e.g., future tests) and matches the intent of the boundary validation. |
||
|
|
b74b02da4f |
fix(ec2): add missing subnet attributes and instance block device attachTime (#1087)
ModifySubnetAttribute only handled MapPublicIpOnLaunch; the other three AWS-defined attributes — AssignIpv6AddressOnCreation, EnableDns64, and MapCustomerOwnedIpOnLaunch — were silently ignored. Added them to the handler loop and to the Subnet model, and included them in the DescribeSubnets XML response alongside an empty ipv6CidrBlockAssociationSet element that AWS always returns. DescribeInstances was missing attachTime on blockDeviceMapping/ebs, causing SDK response shape validation to fail for callers that inspect that field. |
||
|
|
bd6ec2d5c6 |
feat(ses): add SES V2 configuration set event destination operations (#1079)
* feat(ses): add SES V2 configuration set event destination operations Implement CreateConfigurationSetEventDestination, GetConfigurationSetEventDestinations, UpdateConfigurationSetEventDestination, and DeleteConfigurationSetEventDestination on the SES V2 REST JSON API. Event destinations are stored on the configuration set; validation and error messages mirror the real AWS SESv2 responses. Includes REST integration, service unit, and AWS SDK compatibility tests. * fix(ses): return defensive copy from event destination getter and preserve order on update GetConfigurationSetEventDestinations now returns an unmodifiable copy so callers cannot mutate stored state outside the service. UpdateConfigurationSetEventDestination replaces the destination in place (by index) instead of remove+add, keeping the list order stable when a configuration set has multiple event destinations. |
||
|
|
0655be9d23 |
fix(ecs): reconcile task lifecycle when container exits naturally (#1078)
* fix(ecs): reconcile task lifecycle when container exits naturally ECS tasks stayed in RUNNING indefinitely after the underlying Docker container exited, causing `aws ecs wait tasks-stopped` to hang forever and exitCode to remain null. Fixes #889. The 5-second reconciler now also polls running task handles. When all containers for a task have exited, it atomically claims the handle (guarding against a concurrent explicit stopTask), closes log streams, removes the Docker containers, and transitions the task to STOPPED with stoppedAt and per-container exitCode populated. Explicit stopTask is also fixed: it now calls stopTaskAndCollectExitCodes to capture exit codes before the container record is removed, and propagates them to the ECS container model. An idempotency guard prevents double-decrement of runningTasksCount when stopTask is called on a task already transitioned by the reconciler. cleanupStoppedTask is used by the reconciler to avoid re-inspecting containers whose exit codes were already collected in the inspection pass. * fix(ecs): capture exit code after stop, not before stopTaskAndCollectExitCodes inspected containers before stopping them, so getExitCodeIfStopped returned null for still-running containers and the exit code was lost once stopAndRemove deleted the record. Split the operation into two phases: stop all containers first, then inspect exit codes, then remove. Containers already exited skip the stop call silently. |
||
|
|
f8a2f2d5c4 |
fix(apigw-v2): populate pathParameters in Lambda proxy event for HTTP API integrations (#1067)
* fix(apigw-v2): populate pathParameters in Lambda proxy event for HTTP API integrations
buildV2ProxyEvent never called extractV2PathParams, so pathParameters was always
absent from the Lambda event payload. Frameworks that rely on it for routing (e.g.
the tRPC AWS Lambda adapter via ANY /{proxy+}) failed with path routing errors.
Wire extractV2PathParams into buildV2ProxyEvent after the queryStringParameters
block, mirroring how dispatchHttpProxyV2 already uses it. Also relax the method
visibility to package-private to allow the new unit tests to call it directly.
* test(ec2): scope Ec2NetworkInterfacePaginationTest to its own VPC
DescribeNetworkInterfaces was called without a filter, so the tests
counted ENIs created by other concurrently-running sdk-test-java tests
(e.g. sdk-test-instance from Ec2DescribeNetworkInterfacesTest), causing
intermittent failures when test ordering meant those ENIs existed at
assertion time.
Adds a vpc-id filter helper scoped to the VPC created in @BeforeAll so
each test only sees the 6 ENIs it owns.
|
||
|
|
9d1e24a582 |
feat(kms) Add KMS Grant APIs (#1073)
* test(kms): add grant compatibility contracts * feat(kms): support empty ListGrants * feat(kms): add CreateGrant and persisted ListGrants round trip * test(kms): add create grant round trip coverage * feat(kms): add grant pagination, filters, and ListRetirableGrants * test(kms): add pagination, filter, and retirable grant coverage * feat(kms): add RevokeGrant administrative delete * test(kms): add RevokeGrant unit and integration coverage * feat(kms): add RetireGrant with token and key+grant retirement paths * docs(kms): document grant lifecycle operations and enforcement scope * fix(kms): include RetiringPrincipal in ListGrants response The handleListGrants handler was omitting RetiringPrincipal from the JSON response even when the grant had one set. This meant grants created with a retiring principal were invisible through ListGrants, while ListRetirableGrants worked fine. Adds the missing serialization to match the GrantListEntry AWS spec. |
||
|
|
55a90e8299 |
fix(ec2) Fix/1031 ec2 describe network interfaces (#1035)
* feat(ec2): add partial DescribeNetworkInterfaces (phases 1-3) Wire DescribeNetworkInterfaces into the EC2 query handler with ENI data derived from running instances. Covers: - Empty response skeleton - Basic ENI mapping (networkInterfaceId, subnetId, vpcId, groupSet, attachment) - Full field coverage (privateIpAddressesSet, EIP association, tagSet, availabilityZone, interfaceType, attachTime, deleteOnTermination) Remaining: filter support, pagination, error handling, Terraform compat validation (phases 4-6 for #1031). * feat(ec2): add filter support for DescribeNetworkInterfaces (phase 4) Support these filter keys: network-interface-id, subnet-id, vpc-id, group-id, status, private-ip-address, description, owner-id, mac-address, private-dns-name, tag:<key>, tag-key. Filters use AND semantics. No-match filters return HTTP 200 with empty networkInterfaceSet. * feat(ec2): add pagination and error handling for DescribeNetworkInterfaces (phases 5-6) - Add NetworkInterfaceListResult record for paginated responses - Implement offset-based MaxResults/NextToken pagination - Add Base64 token encode/decode for pagination cursor - Validate MaxResults range (5-1000) and MaxResults+NetworkInterfaceId conflict - Conditionally emit nextToken in XML response (only when truncated) - Add InvalidNetworkInterfaceID.NotFound for non-existent IDs - Add InvalidNetworkInterfaceID.Malformed for IDs not starting with 'eni-' - Track found IDs via HashSet for accurate NotFound detection * test(ec2): add DescribeNetworkInterfaces pagination, error, and multipage tests - 5 pagination validation tests (MaxResults range, param conflict, invalid token) - 1 pagination success test (MaxResults > available ENIs, no nextToken emitted) - 2 error handling tests (InvalidNetworkInterfaceID.NotFound and .Malformed) - 1 self-contained multipage pagination test (launches 5 extra instances, verifies MaxResults=5 truncation, NextToken continuation, final page cleanup) - All 87 Ec2IntegrationTest tests pass * test(ec2): add SDK and Terraform compat tests for DescribeNetworkInterfaces - Add Ec2NetworkInterfacePaginationTest with 4 scenarios: all 6 ENIs without pagination, MaxResults=5 truncation, NextToken continuation (no overlap between pages), and token re-use stability - Add eni_destroy.bats Terraform compat test verifying destroy succeeds on VPC+subnet+SG now that DescribeNetworkInterfaces is implemented - Add minimal Terraform config (VPC 10.0.0.0/16, subnet, SG) for ENI test * fix(ec2): align DescribeNetworkInterfaces MaxResults errors * test(terraform): make ENI destroy compat test runnable |
||
|
|
8fb07d2654 |
fix(s3): persist inline x-amz-tagging header on PutObject (#987)
* fix(s3): persist inline x-amz-tagging header on PutObject PutObject silently dropped tags supplied via the x-amz-tagging request header — the controller did not read the header and tags never reached the object store. Adds a header parameter, parses the URL-encoded key=value tag set (with 10-tag and 8 KB limits), and persists via the existing putObjectTagging path so behavior matches real AWS S3. * test(s3): add negative-path tests for inline x-amz-tagging header Cover malformed pair, empty key, duplicate key, >10 tags, and oversized header. Note in S3Controller that the InvalidArgument and BadRequest codes match observed real-AWS behavior even though they are not in the S3 Smithy service model --------- Signed-off-by: Hector Ventura <hectorvent@gmail.com> Co-authored-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
894b39f446 | fix(s3): avoid misrouting presigned PUTs with tagging (#932) (#995) | ||
|
|
70958b1091 |
fix(s3): omit body-description headers and user metadata from PutObject response (#948)
## Summary S3 `PutObject` was echoing the object's `Content-Encoding` (and `Content-Disposition`, `Cache-Control`, `x-amz-meta-*`) onto a response whose body is always empty. Real AWS S3 omits all of those on PutObject — they only belong on `GetObject` / `HeadObject`, where there is a body to describe. The user-visible symptom is `Content-Encoding: gzip` on the PutObject response: AWS SDK for Java v2's `Crc32Validation.decompressing` interceptor sees the header, wraps the empty stream in `GZIPInputStream`, and throws `EOFException` from `readHeader`. The object is stored correctly server-side, but every gzip-encoded `PutObject` through the SDK fails before returning — breaking, for example, Spring Cloud AWS's `S3Template.upload(...)` with gzip metadata. `S3Controller#putObject` now calls a new `appendPutObjectResponseHeaders(resp, obj)` that emits only the headers AWS returns on PutObject (storage-class when set, SSE when set, checksum, object-lock) and intentionally omits `Content-Encoding`, `Content-Disposition`, `Cache-Control`, `Content-Language`, `Expires`, and `x-amz-meta-*`. The shared `appendObjectHeaders` is untouched, so GET / HEAD / CopyObject — including the persistence behavior added by #56 / PR #57 — are unchanged. Closes #944 ## Type of change - [x] Bug fix (`fix:`) - [ ] New feature (`feat:`) - [ ] Breaking change (`feat!:` or `fix!:`) - [ ] Docs / chore ## AWS Compatibility Incorrect behavior: PutObject's response copied the object's persisted `Content-Encoding` / `Content-Disposition` / `Cache-Control` / `x-amz-meta-*` headers onto a response that has no body. Verified against real AWS S3 (`us-west-2`) with AWS CLI v2 (`aws-cli/2.27.58`) and AWS SDK for Java v2 (`software.amazon.awssdk:s3:2.42.24`). Eight `PutObject` scenarios were captured from botocore's `--debug` response-headers log, each with one additional request header. For every header this PR changes Floci's behavior on, the post-PR response matches AWS: | Request includes | Pre-PR Floci response | Real AWS response | Post-PR Floci response | |---|---|---|---| | `Content-Encoding: gzip` | emits `Content-Encoding: gzip` | omits | omits | | `Cache-Control: max-age=…` | emits `Cache-Control` | omits | omits | | `Content-Disposition: …` | emits `Content-Disposition` | omits | omits | | `x-amz-meta-owner: team-a` | emits `x-amz-meta-owner` | omits | omits | (`Content-Language` and `Expires` exist in the old `appendObjectHeaders` only via `ResponseHeaderOverrides`, and the PutObject path passes `ResponseHeaderOverrides.NONE`, so they were never actually emitted on PutObject responses.) Regression coverage, both layers: - New SDK-level test `compatibility-tests/sdk-test-java/S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` uses a real `S3Client` to `PutObject` a gzip-encoded object. Before the fix it throws the exact `EOFException → Crc32Validation.decompressing → DefaultS3Client.putObject` stack from #944; with the fix it passes. - Existing in-process `S3IntegrationTest#putObjectWithContentEncoding` gains assertions that `Content-Encoding`, `Content-Disposition`, and `Cache-Control` are absent from the PutObject response. Adjacent tests (`getObjectReturnsContentEncoding`, `headObjectReturnsContentEncoding`, `copyObjectPreservesContentEncoding`, and the Cache-Control / Content-Disposition equivalents) continue to assert those headers ARE returned on GET / HEAD / CopyObject — protecting the behavior fixed by #56 / PR #57. ## Checklist - [x] `./mvnw test` passes locally (4700 tests, 0 failures, 0 errors, 8 skipped) - [x] New or updated integration test added (RestAssured regression assertions in `S3IntegrationTest#putObjectWithContentEncoding`, plus new SDK test `S3Test#putObjectWithContentEncodingDoesNotBreakSdkDecompression` in `compatibility-tests/sdk-test-java`) - [x] Commit messages follow [Conventional Commits](https://www.conventionalcommits.org/) |
||
|
|
b71cf0f827 |
feat(neptune): Neptune control plane, Gremlin Docker backend, and SDK compatibility tests (#958)
Signed-off-by: Hector Ventura <hectorvent@gmail.com> Co-authored-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
e54a8e502c |
fix(sns): preserve per-entry MessageAttributes in PublishBatch (#891)
The Query-protocol handler for sns:PublishBatch was extracting Id, Message, Subject, MessageGroupId and MessageDeduplicationId per entry but skipped the per-entry MessageAttributes parsing loop that the single-entry sns:Publish handler already had. As a result every batched message reached subscribers (SQS, HTTP, Lambda) with an empty attribute map, even though the AWS API contract treats MessageAttributes as a first-class field on PublishBatchRequestEntry. This caused consumers that rely on attributes for metadata (e.g. CloudEvents binary content-mode: ce-type, ce-id, ce-source, …) to discard the messages because the routing headers were missing. Mirror the loop from handlePublish, parsing PublishBatchRequestEntries.member.N.MessageAttributes.entry.M.* per entry, and only attach the attributes map when non-empty so the SnsService receives the same shape as the single-Publish path. Adds: - Handler unit regression test covering attribute forwarding and per-entry isolation (entry without attrs must not inherit from sibling entries). - AWS SDK v2 compatibility test asserting end-to-end fan-out. Existing single Publish behaviour is unchanged. |
||
|
|
c426289879 |
fix(cognito): correct USER_SRP_AUTH PASSWORD_VERIFIER signature (#912)
* fix(cognito): correct USER_SRP_AUTH PASSWORD_VERIFIER signature
Server-side SRP-6a produced HMAC signatures that never matched what
AWS Amplify / SDKs compute, so USER_SRP_AUTH always failed with
NotAuthorizedException. Five independent bugs in the byte layout and
key-derivation chain:
1. SRP multiplier k: hashed N and g left-padded to N_BYTES (384 bytes).
Cognito/Amplify hash the minimal two's-complement representation
(385 bytes for N — sign byte prepended because MSB is set — and
1 byte for g = 2). k participates in both server B = k*v + g^b and
client S = (B - k*g^x)^(a+ux), so a divergent k breaks the protocol.
Use N.toByteArray() and G.toByteArray() directly.
2. Session key derivation: previously ran an undocumented "Caldera
interleaved hash" over S, then fed that into HKDF with a zero salt.
Cognito applies HKDF-Expand directly over S with the scrambling
parameter U as salt:
PRK = HMAC-SHA256(U_bytes, S_bytes)
T(1) = HMAC-SHA256(PRK, "Caldera Derived Key" || 0x01)
key = T(1)[0..16]
Inline that HKDF in computeSessionKey; drop interleaved hash + the
auxiliary hkdf() helper.
3. HKDF output length: helper returned 32 bytes; Amplify uses the first
16. Return Arrays.copyOf(t1, 16).
4. computeSignature double-HKDF: when sessionKey was already the final
HMAC key, computeSignature ran HKDF on it again. Use it as-is.
5. computeU / computeX byte layout: U was hashed with A and B
left-padded to N_BYTES; salt was decoded as raw hex bytes. Amplify
feeds the minimal two's-complement representation (with sign byte
for positive MSB-set values). Use BigInteger.toByteArray() for A/B
and round-trip the hex salt through BigInteger so a sign byte is
prepended when needed.
Verified by reproducing floci's exact server-side computation in
JavaScript using Amplify's byte conventions: the JS replay reproduces
floci's expected HMAC byte-for-byte (proving the server is internally
consistent) and the divergence from the client's claimed HMAC traces
entirely to k differing. After the fix, USER_SRP_AUTH end-to-end signin
from Amplify v6 (React Native) against floci succeeds.
Compat note: users whose verifier was stored under the previous
computeX with a salt whose first byte has the MSB set (~50% of
generate-salt outputs) will produce a different x and must reset their
password. New signups against this fix are interoperable with Amplify.
Also drops the now-unused padTo() helper.
* test(compatibility): add USER_SRP_AUTH round-trip tests for Node + Java SDKs
The existing CognitoSrpTest only validated that PASSWORD_VERIFIER was
returned by InitiateAuth; nothing exercised the full handshake. With the
server-side SRP math now spec-compliant, add end-to-end tests that prove
real AWS SDK clients authenticate against floci.
Java (sdk-test-java/CognitoSrpTest):
- Add step 4: compute PASSWORD_CLAIM_SIGNATURE from the challenge using
the AWS "Caldera" SRP variant, send RespondToAuthChallenge, assert
AuthenticationResult contains valid JWT id/access/refresh tokens.
- Helper math (computeX / computeU / computeK / calderaHkdf /
hmacSha256 / formatCognitoTimestamp) inlined since the AWS Java SDK
v2 does not expose a public SRP client.
Node (sdk-test-node/tests/cognito-srp.test.ts):
- New round-trip test using amazon-cognito-identity-js 6.3.16 — the
canonical JS SRP impl that @aws-amplify/auth wraps internally.
- Pool is provisioned via AdminCreateUser + AdminSetUserPassword so the
test doesn't depend on an email-delivered verification code.
- Validates tokens come back as well-formed JWTs.
Both tests pass against floci with the fix from the previous commit and
fail (CodeMismatchException / NotAuthorizedException) without it.
|
||
|
|
fd660e03ed |
fix(ec2): add missing instance response fields to fix Terraform nil pointer dereference (#871) (#883)
* fix(ec2): add missing instance response fields to fix Terraform nil pointer dereference (#871) The ENI <attachment> block was absent from Floci's RunInstances and DescribeInstances XML responses. Terraform provider AWS v5.x iterates network interfaces and reads iface.Attachment.DeviceIndex without nil-checking Attachment, causing a panic in resourceInstanceRead. Additional fields required by the provider were also missing: cpuOptions, metadataOptions, maintenanceOptions, enclaveOptions, hibernationOptions, privateDnsNameOptions, capacityReservationSpecification, stateReason, and blockDeviceMapping. - Add attachmentId and deviceIndex to InstanceNetworkInterface model - Populate both fields at ENI creation time in Ec2Service.runInstances - Emit <attachment> and <privateIpAddressesSet> inside each ENI item in instanceXml() - Emit all missing instance-level fields in instanceXml() - Add Ec2InstanceResponseShapeTest compatibility test (16 assertions) * fix(ec2): fix ec2 unit tests |
||
|
|
15720e2ee6 |
feat(apigateway): implement account management endpoints and models (#867)
* feat(apigateway): implement account management endpoints and models * feat(apigateway): enhance patch operation validation and update throttle settings defaults * feat(api-gateway): add account management operations to API Gateway v1 * feat(api-gateway): add compatibility tests for account management and update logic * feat(api-gateway): add missing import for assertions in account compatibility test |
||
|
|
647b170494 |
fix(dynamodb): honor legacy Expected condition in UpdateItem (#888)
UpdateItem was silently ignoring the legacy `Expected` parameter sent
by AWS SDK v1 clients, causing conditional writes to always succeed
regardless of the condition.
Two bugs fixed:
- `handleUpdateItem` never read the `Expected` field from the request
- `evaluateLegacyExpected` passed conditions directly to
`matchesKeyConditionPublic`, which reads `AttributeValueList`, but
the legacy wire format uses the singular `Value` field instead
The fix reads `Expected` and `ConditionalOperator` in `handleUpdateItem`,
validates mutual exclusion with `ConditionExpression`, fetches the
existing item before the update, and normalizes `{"Value": x}` →
`{"AttributeValueList": [x]}` before delegating to the condition
evaluator.
Closes #848
|
||
|
|
2608b8d6d6 |
feat(dynamodb): implement ExecuteStatement, ExecuteTransaction, BatchExecuteStatement (#864)
Adds PartiQL support for DynamoDB via a hand-rolled tokenizer and
recursive-descent parser that translates SELECT, INSERT, UPDATE, and
DELETE statements into existing DynamoDbService calls.
- DynamoDbPartiQLParser: tokenizer + AST (sealed interfaces) with
positional ? placeholder resolution from Parameters array
- DynamoDbPartiQLHandler: translates AST to GetItem/Query, PutItem,
UpdateItem, DeleteItem; always uses ExpressionAttributeNames to avoid
reserved-keyword conflicts; routes pk-only WHERE to Query (not GetItem)
when the table has a composite key
- DynamoDbJsonHandler: wires ExecuteStatement, ExecuteTransaction, and
BatchExecuteStatement; BatchExecuteStatement captures per-statement
errors without aborting the batch
- DynamoDbPartiQLTest: 13 compatibility tests covering INSERT, SELECT
(pk-only, range, projection, begins_with, ? placeholders), UPDATE
SET/REMOVE, DELETE, ExecuteTransaction, and BatchExecuteStatement
|
||
|
|
9a10f81fb7 |
feat(sns): support FilterPolicyScope=MessageBody (#863)
Parse the message body as JSON and evaluate the subscription filter policy against the parsed tree, with nested-key descent and type-aware rule matching (string/number/boolean/null values, array-value OR, exists/prefix/anything-but/numeric). Previously the scope was accepted but filtering was skipped, so all messages were delivered. Bodies that are not valid JSON fail closed. The body is parsed lazily once per publish, only when at least one subscription uses MessageBody scope, to avoid O(N-subscriptions) parses. The MessageAttributes scope evaluator is untouched. |
||
|
|
010bbd15cd |
feat(ses): add v2 PutAccountSuppressionAttributes (#853)
Implements PUT /v2/email/account/suppression so callers can change the account-level suppression list reasons (BOUNCE / COMPLAINT). Entries are persisted per region in ses-account-suppression.json via a new AccountSuppressionAttributes model. GetAccount's response is extended with a SuppressionAttributes object that carries the stored SuppressedReasons. The setting itself is metadata-only — floci does not synthesise bounce/complaint events so no auto-suppression is triggered; the configuration round-trips for SDK users and tooling that introspects account-level settings. Behaviour aligned with real-AWS verification: - SuppressedReasons accepts BOUNCE / COMPLAINT, validated against the AWS-canonical nested "Member must satisfy constraint: [Member must satisfy enum value set: [BOUNCE, COMPLAINT]]" wording (verbatim match against real AWS). - SuppressedReasons may be omitted (treated as empty list) or supplied as an empty array (clears the reasons) — both return 200. - Non-textual array members (JSON null, numeric, etc.) are rejected with BadRequestException. - Fresh regions report the AWS-default [BOUNCE, COMPLAINT] via GetAccount; an explicit PUT (including an empty list) overrides it. - The optional ValidationAttributes body field is accepted but not parsed (Tier S scope). Tests: - SesV2IntegrationTest gains nine cases covering store-and-list, clear-with-empty-array, missing field defaulting to empty, invalid Reason (with the AWS-canonical nested message asserted), non-array SuppressedReasons, JSON null array member, numeric array member, optional ValidationAttributes, and the default-on-fresh-region assertion in the existing getAccount case. - SesAccountSuppressionTest exercises the Java SDK round trip and an explicit empty list through SesV2Client; @BeforeAll captures the caller's existing SuppressedReasons and @AfterAll restores it with failures surfaced so a real-AWS run cannot silently leave the account with auto-suppression disabled. |
||
|
|
b5b863c386 | fix: broken compatibility-tests java (#857) | ||
|
|
3be62bc1d8 | chore: release 1.5.16 | ||
|
|
b6619f8646 | fix(floci-core): remove aws sdk from floci project (#846) | ||
|
|
e725f38ac7 |
feat(s3): full SelectObjectContent evaluator with floci-duck integration (#835)
- Add recursive WHERE evaluator: AND, OR, NOT, LIKE, BETWEEN, IN, IS NULL, >=, <=, <> — replaces single-regex implementation - Add JSON Lines and JSON array input support - Add cross-format output (CSV→JSON, JSON→CSV) - Emit real BytesScanned / BytesReturned stats - Route CSV (USE headers) and JSON through floci-duck when available; fall back to Java evaluator in standalone mode - Route Parquet S3 Select through floci-duck (existing) - Move FlociDuckManager to services/floci/ and introduce FlociDuckClient as a shared duck HTTP client for Athena and S3 Select - Promote CsvParser to core/common and consolidate AthenaService.splitCsv() - Add compatibility tests: S3SelectTest (19 tests via S3AsyncClient) Signed-off-by: Hector Ventura <hectorvent@gmail.com> |
||
|
|
3bf16e3fb9 |
fix(sqs): FIFO ReceiveMessage returns multiple messages per group per call (#785)
* fix(sqs): FIFO ReceiveMessage returns multiple messages per group per call
A FIFO ReceiveMessage call may legitimately return multiple messages
from the same MessageGroupId, in insertion order, up to
MaxNumberOfMessages. Floci was capping each call at one message per
group, which in practice limited tests to 1-2 messages regardless of
how many were queued and broke ordering tests for high-throughput
("fair") FIFO queues distributing across groups.
The cross-call group lock is unchanged: a group with an in-flight
message from a previous call is still blocked until that message is
deleted or its visibility expires. Only the within-call constraint
was wrong.
Existing tests that asserted the buggy "one per group per call"
contract have been updated to assert AWS-correct behavior.
Refs #768.
* test(sqs): address PR review feedback on FIFO multi-message tests
- Loosen cross-group ordering assertions in FIFO receive tests:
FIFO only guarantees ordering within a MessageGroupId, not across
groups, so assert group1 messages are in-order relative to each
other and group2 message is present without fixing its position.
- Rename fifoQueue_groupLockBlocksAcrossCallsButNotWithin to
fifoQueueGroupLockBlocksAcrossCallsButNotWithin to match the
test class's lowerCamelCase convention.
* test(sqs): add FIFO partial-drain unlock and compat coverage
Address review feedback on PR #785:
- SqsServiceTest: add fifoQueueGroupUnlocksAfterAllInFlightMessagesDeleted
covering the most common consumer pattern — drain less than a full
group in one call, delete the in-flight messages, then receive the
remainder. Verifies the group lock unlocks once all in-flight
messages from that group are deleted.
- sdk-test-java SqsTest: add fifoReceiveReturnsMultipleMessagesFromSameGroupInOneCall
as the first FIFO test in the compatibility suite. Sends 3 messages
to a single MessageGroupId and asserts a single ReceiveMessage with
MaxNumberOfMessages=10 returns all three — closes the gap noted in
the review and provides a regression guard against real AWS.
|
||
|
|
4d2a99506a |
feat: add ListTagsForResource, TagResource, UntagResource for Step Functions (#767)
* feat: add ListTagsForResource, TagResource, UntagResource for Step Functions Implements the SharedTagsController TagHandler pattern for SFN state machines and activities. Adds tags field to StateMachine and Activity models, tag CRUD methods to StepFunctionsService, and a new StepFunctionsTagHandler that registers the 'states' service key. Closes #766 * feat: cover JSON 1.0 SDK wire path for SFN tag operations Add ListTagsForResource, TagResource, UntagResource cases to StepFunctionsJsonHandler for AWS SDK (awsJson1.0) compatibility. The REST /tags/{arn} path (SharedTagsController) already covers Terraform; this commit covers the SDK path. Expand integration test to verify both wire paths. Add SDK-based compatibility test using SfnClient. * chore: remove invented inline comment from tags integration test * refactor: remove dead REST TagHandler and clean up integration tests StepFunctionsTagHandler registered the 'states' service key with SharedTagsController (REST /tags/{arn}), but SFN uses JSON 1.0 exclusively. No real client calls GET/POST/DELETE /tags/arn:aws:states:... — the handler was unreachable dead code. Remove StepFunctionsTagHandler and strip the eight REST-path tests from StepFunctionsTagsIntegrationTest. The remaining JSON 1.0 tests are now self-contained (no longer depend on state set by the deleted REST tests). * fix: correct SDK API usage in tag tests and persist creation-time tags - Fix StepFunctionsTagsTest: tags() takes Tag... not Map, use tagsAsMap() helper to convert List<Tag> before asserting with MapAssert methods - Fix StepFunctionsService: pass tags through createStateMachine/createActivity so tags set at creation time are persisted immediately - Fix StepFunctionsJsonHandler: extract parseTagsArray() helper, add 400 validation when tags/tagKeys are not arrays, wire tags into create calls - Expand StepFunctionsTagsIntegrationTest: cover creation-time tag persistence for state machines and activities, and 400 on malformed tag input |
||
|
|
5ab178e10d |
fix(dynamodb): improve conformance across validation, expressions, and queries (#826)
* fix(dynamodb): improve conformance across validation, expressions, and queries - Rename InvalidParameterValue → ValidationException for table-name errors - Enforce min-length 3 on table names for all operations, not just CreateTable - ListTables: alphabetical order, Limit validation (1–100), pagination - Enum validation (ReturnValues, ReturnConsumedCapacity) fires before table lookup - ProjectionExpression support on GetItem, Query, Scan, BatchGetItem - Select=COUNT returns Count/ScannedCount and omits Items - Parallel scan: Segment/TotalSegments validation and hash-based sharding - Reserved words rejected in FilterExpression, ConditionExpression, UpdateExpression - Legacy API: AttributesToGet, AttributeUpdates, QueryFilter, ScanFilter, KeyConditions - TransactWriteItems idempotency token with payload-hash conflict detection - ReturnValuesOnConditionCheckFailure on PutItem, UpdateItem, DeleteItem - Item size limit (400 KB) and number normalization on write - Tags API: TagResource, UntagResource, ListTagsOfResource with ARN validation - New Java and Node SDK conformance tests covering all changes above * fix(dynamodb): fix unit testing |
||
|
|
734e318278 |
fix(sqs): return MD5 of current request on FIFO dedup replay (#786)
* fix(sqs): return MD5 of current request on FIFO dedup replay On a duplicate SendMessage within the 5-minute FIFO dedup window Floci returned the original message verbatim, including its cached MD5OfMessageBody and MD5OfMessageAttributes. AWS SDK clients validate those MD5s against the body and attributes they sent, so any time the second send differed from the first (or even when the first send had different attribute keys than the second's body alone) the SDK threw "MD5 returned by SQS does not match the calculation on the original request" and never delivered the message. AWS itself returns the original MessageId and SequenceNumber on dedup, but recomputes MD5s from the current request so the validation round-trips. Floci now does the same. A new SDK-driven integration test (sqs Java SDK at test scope) covers the dedup-replay case plus several standard/FIFO/binary/custom-type-name MD5 round-trips. Refs #768. * test(sqs): tighten dedup-replay MD5 test and drop redundant @Inject Address review feedback on #786: - Assert the second SendMessage returns the same MessageId and SequenceNumber as the first, so the test would catch a regression that silently disabled dedup (in which case the MD5 round-trip would also pass for the wrong reason). - Drop the redundant @Inject on the @ConfigProperty-injected field, matching the convention used in other Floci integration tests. * test(sqs): move FIFO MD5 SDK tests to compatibility-tests/sdk-test-java Address maintainer review on #786: - Drop the software.amazon.awssdk:sqs test-scope dependency from the main module's pom.xml. - Move SqsSdkMd5IntegrationTest to the compatibility-tests/sdk-test-java module as SqsMd5Test, where the existing AWS SDK v2 compatibility suite already lives. The test now follows that module's conventions (TestFixtures.sqsClient, AssertJ, lowerCamelCase method names, queue cleanup) and exercises the same scenarios: standard / FIFO / fair MD5 parity, binary and custom-type-name attributes, and the dedup-replay case that asserts the second SendMessage returns the original MessageId and SequenceNumber. |
||
|
|
944f82a6a4 |
feat(ses): add v2 suppression list endpoints (#813)
* feat(ses): add v2 suppression list endpoints
Implements the v2 SES suppression list management plane at
/v2/email/suppression/addresses:
- PUT /v2/email/suppression/addresses PutSuppressedDestination
- GET /v2/email/suppression/addresses/{EmailAddress} GetSuppressedDestination
- DELETE /v2/email/suppression/addresses/{EmailAddress} DeleteSuppressedDestination
- GET /v2/email/suppression/addresses ListSuppressedDestinations
(repeated Reason filter)
Entries are persisted per region in ses-suppression.json. A repeat Put for
the same EmailAddress updates the existing entry's Reason and LastUpdateTime.
List responses are sorted by LastUpdateTime then EmailAddress for stable
output across runs.
Behaviour aligned with real AWS responses:
- EmailAddress is silently trimmed of leading/trailing whitespace on Put
/ Get / Delete; whitespace-only is rejected with BadRequestException.
- Reason validation errors use the AWS-canonical "1 validation error
detected: Value at '<field>' failed to satisfy constraint: Member must
satisfy enum value set: [BOUNCE, COMPLAINT]" wording, with the nested
"Member must satisfy constraint: [...]" wrapping AWS emits for the
list-typed reasons filter.
- ListSuppressedDestinations accepts a repeated Reason query param (the
Java SDK's .reasons(...) varargs serialise this way) and applies
OR-semantics across the supplied values.
- GetSuppressedDestination and DeleteSuppressedDestination return
NotFoundException with "Email address <X> does not exist on your
suppression list." for unknown addresses — Delete is not idempotent
on AWS so floci matches.
SendEmail integration is intentionally out of scope: suppressed addresses
are still delivered locally so that existing send tests remain unaffected.
A follow-up PR can wire suppression checks into the send path along with
the PutAccount/ConfigurationSetSuppressionOptions configuration endpoints.
Tests:
- SesSuppressionV2IntegrationTest covers Put/Get/Delete lifecycle, List
sort order, single- and multi-Reason filter (with OR semantics), Put
updates, trim-on-Put, idempotent-Get-on-known, and validation errors.
- SesSuppressionListTest exercises the same surface through the Java SDK
v2 SesV2Client.
* fix(ses): reject null and non-object bodies on PutSuppressedDestination
Jackson's NullNode.asText("default") returns the literal string "null"
rather than the default, so a body like
{"EmailAddress": null, "Reason": "BOUNCE"}
silently stored an entry under the email address "null". Validate the
body is a JSON object via requireJsonObject and require both
EmailAddress and Reason to be present and textual via a new
readRequiredStringField helper.
SesSuppressionV2IntegrationTest gains three cases covering null
EmailAddress, null Reason, and a non-object root body.
|
||
|
|
c8c77c9e6e |
feat(s3): virtual-hosted style addressing support (#805)
*.s3.localhost.floci.io, *.localhost.localstack.cloud, and
*.s3.localhost.localstack.cloud as virtual-hosted style regardless of
FLOCI_HOSTNAME — fixes 405 when SDK uses endpointOverride("http://localhost:4566")
without forcePathStyle (closes #801)
- EmbeddedDnsServer ships localhost.localstack.cloud and localhost.floci.io
as built-in suffixes so spawned containers resolve these domains to Floci's
IP without extra config
- Compatibility test S3VirtualHostStyleTest covers the full virtual-host path
end-to-end; TestFixtures.s3VirtualHostClient() prefers s3.localhost.floci.io,
falls back to s3.localhost.localstack.cloud, or uses FLOCI_S3_VHOST_ENDPOINT
in Docker
- run-docker-tests.sh and compatibility.yml inject --dns <floci-ip> and
FLOCI_S3_VHOST_ENDPOINT=http://floci:4566 into test containers
- S3 and migrate-from-localstack docs updated with virtual-hosted style details
|
||
|
|
bcc36c08e0 |
feat(ses): extend tag endpoints to v2 EmailIdentity ARNs (#760)
* feat(ses): extend tag endpoints to v2 EmailIdentity ARNs Adds support for arn:aws:ses:<region>:<account>:identity/<email-or-domain> ARNs across TagResource / UntagResource / ListTagsForResource. Behaviour was verified against real AWS via aws sesv2 commands and matches the EmailTemplate routing exactly: - Tag region mismatch -> BadRequestException "Failed to tag resource" - Untag region mismatch -> BadRequestException "Failed to untag resource" - List region mismatch -> Tags resolved against the signing region - Missing identity -> NotFoundException with "No EmailIdentity present with name: <identity>" Identity gains a tags field. CreateEmailIdentity accepts an optional Tags array (validated via the existing validateTag()) and persists it on the freshly verified Identity record. GetEmailIdentity surfaces stored tags in the existing Tags response field. Tests: - SesTagsV2IntegrationTest gains identity lifecycle, identity-not-found, and identity-specific region-mismatch / signing-region-lookup cases. - SesIdentityAttributesV2IntegrationTest covers create-with-tags -> Get/ListTagsForResource round-trip. - SesTagResourceTest (Java SDK compat) exercises CreateEmailIdentity with Tags and the Tag/Untag lifecycle on the identity ARN. * test(ses): move identity tags round-trip test next to other createEmailIdentity cases The Tags-on-create round-trip case fits better next to the existing createEmailIdentity_* cases at the top of SesV2IntegrationTest than it does in the attributes-focused SesIdentityAttributesV2IntegrationTest, where DKIM / MAIL FROM / Feedback validation lives. * chore(ses): drop dead identity.setTags call after CreateEmailIdentity setIdentityTags already persists the tag list on the stored Identity, and CreateEmailIdentity does not surface Tags in its response per the AWS spec, so the in-memory mutation that followed had no observable effect. |
||
|
|
646b4199df |
feat(ses): extend tag endpoints to v2 EmailTemplate ARNs (#759)
Adds support for arn:aws:ses:<region>:<account>:template/<name> ARNs across TagResource / UntagResource / ListTagsForResource. Behaviour was verified against real AWS via aws sesv2 commands and aligned where it diverged. - EmailTemplate gains a tags field. CreateEmailTemplate accepts an optional Tags array; tag validation reuses validateTag(). - UpdateEmailTemplate intentionally preserves the existing tags so that AWS-style "tags only mutated via Tag/UntagResource" semantics hold. - GetEmailTemplate response surfaces stored tags. - Missing templates return NotFoundException with the AWS-canonical "No Template present with name: <name>" message — AWS uses the bare "Template" (not "EmailTemplate") for tag-endpoint lookups even though the SDK type is EmailTemplate. Resource-type-specific routing in the tag endpoints: - TagResource on a template ARN strictly validates ARN/signing region match (BadRequestException "Failed to tag resource" on mismatch), matching the existing ConfigurationSet behaviour. - UntagResource on a template ARN strictly validates ARN/signing region match (BadRequestException "Failed to untag resource"), whereas ConfigurationSet's lenient ARN-region lookup is preserved. AWS treats the two resource types asymmetrically here. - ListTagsForResource on a template ARN ignores the ARN region and resolves the template against the signing region. ConfigurationSet continues to route by ARN region. Three small refactors that fall out naturally from adding a second taggable resource: - Tag is promoted from ConfigurationSet.Tag to a top-level services/ses/model/Tag so EmailTemplate and the shared helpers no longer reference a Configuration-scoped name. JSON serialization is unchanged. - A private mergeTags(existing, incoming) helper centralizes the LinkedHashMap merge previously duplicated between tagConfigurationSet and tagEmailTemplate. - A private parseTagsArray(JsonNode) helper centralizes the JSON Tags array parse previously duplicated across createConfigurationSet, createEmailTemplate, and tagResource. The helper returns null for missing/null nodes; the required caller (tagResource) treats null as BadRequestException. Tests: - SesTagsV2IntegrationTest gains a template lifecycle case, a template-not-found assertion, and the two template-specific region-mismatch / signing-region-lookup cases. - SesTemplateV2IntegrationTest covers create-with-tags, list-via-tags endpoint, and update-preserves-tags round-trips. - SesTagResourceTest (Java SDK compat) exercises CreateEmailTemplate with Tags and the Tag/Untag lifecycle on the template ARN. |
||
|
|
9b68bd0377 |
feat(ses): add v2 TagResource / UntagResource / ListTagsForResource (#749)
* feat(ses): add v2 TagResource / UntagResource / ListTagsForResource
Implements the v2 SES tag endpoints at /v2/email/tags. Initial scope
covers ConfigurationSet ARNs only
(arn:aws:ses:<region>:<account>:configuration-set/<name>); other
resource types return NotFoundException so follow-up PRs can extend
coverage to Identity, EmailTemplate, etc.
Behavior aligned with observed AWS responses:
- TagResource enforces ARN/signing region match strictly and rejects
mismatches with BadRequestException ("Failed to tag resource").
- UntagResource and ListTagsForResource route lookups to the ARN's
region instead, so a region mismatch surfaces as NotFoundException
with the resource-specific message (e.g. "No ConfigurationSet
present with name: <name>").
- TagResource merges by key (existing keys are replaced, others
retained); UntagResource silently skips keys not present.
- Empty Tags / TagKeys lists are rejected with BadRequestException to
match AWS validation.
- ARN parsing uses the shared AwsArnUtils helper; missing region or
account in the ARN is rejected as BadRequest, matching AWS.
Tests:
- New SesTagsV2IntegrationTest for endpoint-focused coverage (lifecycle,
region-mismatch asymmetry, validation errors).
- Cross-feature round-trip in SesConfigurationSetV2IntegrationTest
verifying that tags supplied to CreateConfigurationSet are reachable
via ListTagsForResource.
- New SesTagResourceTest in the Java SDK compatibility suite.
* refactor(ses): drop unused region parameter from list/untag tag service methods
listResourceTags and untagResource route lookups by the ARN's region, so
the request signing region they accepted was never read. Remove it and
stop resolving it in the controller. tagResource still takes region
because it strictly validates it against the ARN.
|
||
|
|
3ae5c7b467 |
feat(apigatewayv2): Add WebSocket data-plane support (#712)
* feat: implement API Gateway v2 WebSocket data-plane support Implement full WebSocket data-plane for API Gateway v2, including: - Real WebSocket connection handling via Vert.x (ws://localhost:4566/ws/{apiId}/{stage}) - $connect/$disconnect/$default route lifecycle with Lambda integration - Custom route selection via routeSelectionExpression ($request.body.{field}) - @connections management API (POST/GET/DELETE) for server-to-client messaging - Lambda REQUEST authorizer support on $connect with identity source validation - Stage variable substitution in integration URIs - Multiple integration types: AWS_PROXY, AWS (VTL), HTTP_PROXY, HTTP (VTL), MOCK - Route response selection expression for bidirectional messaging - Binary frame support (isBase64Encoded: true) - 128 KB payload size limit enforcement (frames and @connections POST) - 10-minute idle timeout and 2-hour max connection duration - GoneException (410) for disconnected connections - $connect response headers propagation - Server-initiated close via @connections DELETE (skips $disconnect Lambda) Also includes: - Refactored LambdaArnUtils.extractFunctionNameFromUri as shared utility - Extended Authorizer/Integration/Stage models with new fields - Comprehensive Java integration tests (WebSocket lifecycle, routing, auth, etc.) - Node.js SDK compatibility tests using ws client and @aws-sdk/client-apigatewaymanagementapi - Updated documentation with full feature matrix
* test(apigatewayv2): support custom WebSocket endpoint via env var
- Update wsUrl helper to read FLOCI_ENDPOINT environment variable
- Convert http/https schemes to ws/wss for WebSocket compatibility
- Strip trailing slashes from endpoint URL for consistent formatting
- Enable testing against non-localhost endpoints for CI/CD flexibility
* fix: use AwsErrorResponse for @connections API error responses
Replace raw JSON string literals in handlePostToConnection,
handleGetConnectionInfo, and handleDeleteConnection with the
project-standard AwsErrorResponse record, which serialises to
the correct {"__type": ..., "message": ...} wire shape.
* fix: simplify extractFunctionNameFromUri using AwsArnUtils.parse
Adopt AwsArnUtils.parse() as the core of the implementation per
reviewer suggestion. One addition beyond the suggested snippet:
the API Gateway v1 integration URI format embeds a Lambda ARN
inside an apigateway ARN (resource starts with 'path/.../functions/'),
so we detect that pattern and recurse on the embedded ARN before
applying the standard function-name extraction. All 43
LambdaArnUtilsTest cases pass, including the API Gateway v1 style URI.
|
||
|
|
d971288d02 |
feat(ses): add UpdateAccountSendingEnabled (v1) (#737)
Implements the v1 Query action mirroring the existing v2 PUT /v2/email/account/sending endpoint. The Enabled parameter is optional per AWS docs; missing or empty is treated as false. Adds integration tests and a Java SDK compatibility test that exercises both v1 UpdateAccountSendingEnabled and verifies state is shared with the v2 GetAccount / PutAccountSendingAttributes path. |
||
|
|
c2cc053853 | feat(backup): AWS Backup management-plane API (#734) | ||
|
|
86eac926f9 |
feat(elbv2): ALB Lambda target type (#730)
* feat(elbv2): add Lambda target type support for ALB forwarding |
||
|
|
bd3a33326c |
feat(ses): add MAIL FROM domain and identity attribute operations (#716)
* feat(ses): add MAIL FROM domain and identity attribute operations
v1 (Query):
- SetIdentityMailFromDomain / GetIdentityMailFromDomainAttributes
- SetIdentityFeedbackForwardingEnabled
- SetIdentityHeadersInNotificationsEnabled
- GetIdentityNotificationAttributes now reflects the stored
feedbackForwardingEnabled and per-NotificationType
headersInNotificationsEnabled flags instead of hard-coded defaults
v2 (REST JSON):
- PUT /v2/email/identities/{id}/mail-from -> PutEmailIdentityMailFromAttributes
- GetEmailIdentity response surfaces real MailFromAttributes
(MailFromDomain / MailFromDomainStatus / BehaviorOnMxFailure) instead
of the previously hard-coded "" / NOT_STARTED / USE_DEFAULT_VALUE
- v1 PascalCase <-> v2 SCREAMING_SNAKE BehaviorOnMxFailure values are
translated at the controller boundary, with both ends rejecting
unknown enum values
Identity gains mailFromDomain, behaviorOnMxFailure (v1 form),
mailFromDomainStatus, and headersInNotificationsEnabled fields. The
service layer normalizes BehaviorOnMxFailure to the canonical SESv1
enum values (UseDefaultValue / RejectMessage), so storage is
consistent regardless of which protocol wrote it.
Validation (verified against live aws-cli output):
- ForwardingEnabled / Enabled / MailFromDomain are required on the
matching v1 setters; missing values produce InvalidParameterValue
rather than silently being treated as false / null
- An empty-string MailFromDomain remains the documented "clear" path,
distinct from a missing parameter; whitespace-only values are
rejected (only "" or null clear the setting)
- BehaviorOnMxFailure / NotificationType enum violations return the
AWS-canonical "1 validation error detected: Value at '<param>' failed
to satisfy constraint: Member must satisfy enum value set: [...]"
message: ValidationError on v1, BadRequestException on v2
- Unknown identity on v1 setters returns InvalidParameterValue with
the AWS-canonical "Identity <X> does not exist." form (HTTP 400)
- v2 PutEmailIdentityMailFromAttributes follows the same wire mapping:
unknown identity surfaces as BadRequestException (HTTP 400) via
remapV1Exception, with the same "Identity <X> does not exist."
message text. Schema / enum validation runs before the service call
so an unknown enum on a missing identity still surfaces as an enum
error rather than as the identity error
- v2 controller validates that MailFromDomain and BehaviorOnMxFailure
are JSON strings; non-textual values produce BadRequestException
- AwsQueryController.SES_ACTIONS picks up the new v1 actions for the
auth-less fallback dispatch
Tests: 21 v1 integration cases, 9 v2 integration cases, 4 SDK compat
cases (AWS Java SDK 2.42.24).
* fix(ses): align identity-setter missing-identity errors with live AWS
Previously setFeedbackForwardingEnabled threw NotFoundException/404 and
setHeadersInNotificationsEnabled threw a Floci-specific
"Identity <X> does not exist." message. Real AWS verified via
aws-cli returns InvalidParameterValue (HTTP 400) for both, but with
*different* operation-specific message texts:
- SetIdentityFeedbackForwardingEnabled (also v2 PUT /feedback after
remapV1Exception):
Identity X is invalid. Must be a verified email address or domain.
- SetIdentityHeadersInNotificationsEnabled:
Identity X is invalid. It must be a verified email address or domain.
- SetIdentityMailFromDomain (unchanged in this commit):
Identity <X> does not exist.
Update the service-level throws so each setter emits its operation's
exact wire shape. setFeedbackForwardingEnabled now also benefits the
pre-existing v2 PUT /feedback endpoint, which previously surfaced
NotFoundException/404 instead of BadRequestException/400.
Tests:
- v1 unknown-identity coverage for SetIdentityFeedbackForwardingEnabled
(new) and updated message-text assertion for HeadersInNotificationsEnabled
- v2 unknown-identity coverage for PUT /feedback
- SDK compat additions: getIdentityNotificationAttributes round-trip
exercising forwarding/header flags, and v2
PutEmailIdentityMailFromAttributes unknown-identity throwing
BadRequestException
* test(ses): update putFeedbackAttributes_notFound to expect BadRequest
The previous commit changed setFeedbackForwardingEnabled to throw
InvalidParameterValue (HTTP 400) for missing identities to match real
AWS, which propagates through remapV1Exception as BadRequestException
on the v2 PUT /feedback path. The pre-existing
SesV2IntegrationTest.putFeedbackAttributes_notFound still asserted the
old 404 / NotFoundException behavior, so it began failing in CI.
Update the test to expect 400 / BadRequestException, matching the
verified live AWS response.
|
||
|
|
7fa2a28c62 |
fix(appconfig): use capital "Tags" body key matching AWS SDK wire format (#704)
AppConfigTagHandler inherited the default tagsBodyKey() = "tags" (lowercase), so SharedTagsController parsed and serialised the tag payload with the lowercase key. The AWS spec for AppConfig TagResource and ListTagsForResource is capital "Tags" with a map body, which is what AWS SDK clients send and expect — so SDK calls to appConfig.tagResource(...) silently dropped tags and listing came back empty. Override tagsBodyKey() on AppConfigTagHandler to return "Tags". The other axes (POST method, map body, lowercase tagKeys query) already match the defaults so no further override is needed. AppConfigIntegrationTest is updated to send capital "Tags" bodies and assert capital "Tags" response keys, matching the AWS SDK wire format. AppConfigTest (SDK compatibility) now exercises a tagResource → listTagsForResource → untagResource round-trip via AppConfigClient to lock in the wire format end-to-end. |
||
|
|
4fe93aa379 |
feat(eventbridge): add Archive and Replay support (#702)
Implement EventBridge Archive and Replay APIs: - Archive, ArchivedEvent, Replay, ArchiveState, ReplayState models - ReplayDispatcher: async Vertx-based replay execution with cancel support - EventBridgeService: createArchive, describeArchive, updateArchive, deleteArchive, listArchives, startReplay, describeReplay, cancelReplay, listReplays; event capture on putEvents via captureToArchives - EventBridgeHandler: 9 new action cases wired to service methods - Storage: 3 new StorageBackend fields (archives, archivedEvents, replays) wired through StorageFactory |
||
|
|
8e30c09d0a |
feat(scheduler): support TagResource, UntagResource, ListTagsForResource (#700)
* feat(scheduler): support TagResource, UntagResource, ListTagsForResource
Implements the three remaining EventBridge Scheduler tag APIs by
extending the shared /tags/{arn} dispatcher. Tags apply to schedule
groups only, matching AWS behavior; ARNs pointing at individual
schedules return ValidationException.
A survey of all ~75 AWS services that share the /tags/{arn} path
shows three independent shape axes — body key (`tags` lower vs
`Tags` capital), body structure (map vs list of {Key, Value}), and
untag query parameter name (`tagKeys` vs `TagKeys`) — and most
"capital Tags" services still use lowercase tagKeys query, so these
axes vary independently. TagHandler exposes them as five orthogonal
default methods rather than a coarse-grained enum:
- tagsBodyKey() defaults to "tags"
- tagsBodyIsList() defaults to false (map)
- tagKeysQueryName() defaults to "tagKeys"
- tagResourceUsesPut() defaults to false (POST)
- strictTagValidation() defaults to false (lenient parsing)
The defaults match the most common AWS shape (~73 services use
lowercase tags map + POST + lowercase tagKeys) so handlers like
EKS, Pipes, and AppConfig need no overrides. The dispatcher
returns 405 MethodNotAllowedException for the unused HTTP method
per handler. Strict input validation (missing Tags, wrong-shaped
Tags, missing TagKeys, entries missing Key or Value) is enforced
when strictTagValidation() is true, mirroring the AWS Scheduler
error shape; lenient handlers retain the looser parsing they had
before.
SchedulerTagHandler overrides tagsBodyKey, tagsBodyIsList,
tagKeysQueryName, and strictTagValidation. ApiGatewayTagHandler
overrides tagResourceUsesPut to true. AppConfigIntegrationTest
switches its tagApplication call from PUT to POST to match the
AWS spec for AppConfig (was relying on the dispatcher's prior
leniency on HTTP method).
* fix(tags): normalize empty body and reject non-object payloads
Address Copilot review on floci-io/floci#700.
- doTagResource normalizes null/blank request bodies to "{}" before
passing to ObjectMapper.readTree, mirroring SchedulerController's
parseTags. Previously an empty body raised a Jackson parse error
that strict handlers surfaced as a ValidationException with a raw
Java/Jackson message instead of the structured AWS error shape.
- parseTags adds a strict-only check that the JSON root is an
object. A request body like a JSON array or string used to fall
through to "Value null at 'Tags' ..." which misleads about the
actual problem; it now reports that the payload itself must be a
JSON object.
SchedulerIntegrationTest covers both paths with a 400 assertion.
|
||
|
|
b84d205b89 |
feat: Glue Schema Registry support (#621)
* feat(glue): add Glue Schema Registry support * Move Glue SDK coverage to compatibility tests * Align protobuf compatibility expectations * Resolve services index merge conflict * Remove unused Lombok compatibility dependency * Serialize Glue schema registry timestamps as strings * Tighten Glue schema registry name validation * Avoid duplicate schema registry index rebuild * Limit schema registry in-memory constructor visibility * Clone Glue tables before resolving schema references * Align Glue schema registry response shapes * Extract Glue schema version resolver helper Both validateSchemaReference and withResolvedSchemaReference duplicated the latest-version computation and the four-argument getSchemaVersion call. Pull that into a private resolveSchemaVersion(SchemaReference) helper so the call sites read at one level of abstraction and a future change to the resolution rule lands in one place. * Fix Glue schema version list projection --------- Signed-off-by: Tristan Burch <tburch@users.noreply.github.com> Signed-off-by: Hector Ventura <hectorvent@gmail.com> Co-authored-by: Hector Ventura <hectorvent@gmail.com> |