mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 14:10:49 -05:00
* feat(amazonmq): add Amazon MQ broker control plane for RabbitMQ
* feat(amazonmq): provision RabbitMQ container with rollback
Back a broker with a real rabbitmq:3-management container, following the
MSK/ElastiCache container-manager pattern.
- RabbitMqManager starts the container, publishes AMQP (5672) and
management (15672) ports, and resolves the broker endpoints
- Service branches on the mock flag; real brokers stay
CREATION_IN_PROGRESS until a readiness poller observes the management
API answering, then flip to RUNNING
- Rollback on failed provisioning: the manager removes the half-built
container and the broker is persisted as CREATION_FAILED
- @PreDestroy stops containers on shutdown; DeleteBroker stops and
removes the container and its storage
Readiness probes the management UI root (no auth) to avoid RabbitMQ's
loopback-only guest user over Docker port mapping.
* feat(amazonmq): seed broker admin user and reject ActiveMQ-only User API
Amazon MQ's standalone User API (CreateUser/DescribeUser/ListUsers/
DeleteUser) applies only to ActiveMQ brokers; AWS rejects it for RabbitMQ
and directs callers to the RabbitMQ web console. CreateBroker now requires
exactly one broker user (validated against AWS password rules) which is
seeded into the container via RABBITMQ_DEFAULT_USER/PASS, sidestepping
RabbitMQ's loopback-only guest restriction.
* test(amazonmq): SDK compatibility test against live RabbitMQ broker
Adds AmazonMqTest exercising the real container path via the AWS SDK MqClient:
CreateBroker provisions a rabbitmq:3-management container, the broker
transitions to RUNNING once its management API answers, endpoints are
published, the ActiveMQ-only User API is rejected, and DeleteBroker tears the
container down. Uses JUnit Assumptions to skip cleanly when Docker is absent.
* fix(amazonmq): harden error handling, persistence, and shutdown teardown
- Redact the provisioning failure 500: log the cause, return a generic AWS
error envelope instead of leaking e.getMessage() (which can be null).
- Add @JsonIgnoreProperties(ignoreUnknown = true) to Broker, MqUser, and
BrokerInstance so old persisted snapshots survive field changes.
- Wire RabbitMQ container teardown into EmulatorLifecycle.onStop() via
RabbitMqManager.stopAll(), alongside the other container managers; the
service @PreDestroy now only stops the readiness poller.
* docs(amazonmq): add Amazon MQ service page and bump service count to 66
Adds docs/services/amazonmq.md, lists Amazon MQ in the services overview and
README service tables, and updates the "65 -> 66 AWS services" count across
docs/index.md, docs/services/index.md, and README.md.
* fix(amazonmq): reject RebootBroker unless the broker is RUNNING
RebootBroker unconditionally set the broker to RUNNING, so a non-RUNNING
broker (e.g. CREATION_FAILED, which has no backing container) was silently
promoted to RUNNING and never reconciled by the readiness poller. AWS allows
RebootBroker only on a broker in the RUNNING state; guard it and return a 400
otherwise, matching the Amazon MQ API ("You can reboot only a broker with the
RUNNING status").
* fix(amazonmq): close readiness-probe connection and log tolerated failures
isReady() opened an HttpURLConnection but never disconnected it; since the
probe runs every 2s per pending broker this leaked sockets. Disconnect in a
finally block, and log the tolerated failure at debug with broker/URL context
(AGENTS.md: no empty catch; avoid noise in hot paths) instead of swallowing it.
* fix(amazonmq): tear down broker container by deterministic name after restart
containerId is in-memory bookkeeping (intentionally not persisted, since the
Broker model is serialized straight to DescribeBroker and must not leak it).
After an emulator restart it is null, so stopContainer() previously returned
early and left the container running. It now falls back to the deterministic
container name (floci-amazonmq-{brokerId}) so an explicit DeleteBroker still
removes a container left over from a previous run. Documented the field and
added RabbitMqManagerTest covering both the id and name-fallback paths.
* fix(amazonmq): keep admin password in-memory only and fail loudly if absent
The admin password is a secret used solely to seed the RabbitMQ container at
create time. Persisting it (to make it survive a restart) would write the
credential in cleartext to amazonmq-brokers.json, which the project's security
rule prohibits. It stays in-memory only via @JsonIgnore; startContainer (the
only consumer, called from CreateBroker) now throws if the password is absent
rather than seeding a null credential. Added MqUserTest asserting the password
is never serialized and round-trips to null.
* fix(amazonmq): persist broker volumeId/accountId/containerId without leaking them
These internal fields were @JsonIgnore'd, so they were absent from
amazonmq-brokers.json. After a restart in persistent mode volumeId was null
(removeBrokerStorage could not locate the named volume, leaking it) and
accountId was null (the readiness poller wrote brokers via the non-account-aware
path). Unlike the admin password, these are not secrets, so they should persist.
Remove @JsonIgnore so they round-trip through storage, and build the
DescribeBroker response explicitly in the controller so they are still never
exposed to clients (matches MskCluster, which persists volumeId/containerId).
Adds BrokerTest (round-trip) and asserts the describe response omits them.
426 lines
15 KiB
XML
426 lines
15 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
|
<modelVersion>4.0.0</modelVersion>
|
|
|
|
<groupId>com.floci</groupId>
|
|
<artifactId>sdk-test-java</artifactId>
|
|
<version>1.0-SNAPSHOT</version>
|
|
<packaging>jar</packaging>
|
|
|
|
<name>Floci SDK Test</name>
|
|
<description>Test AWS SDK v2 against Floci emulator</description>
|
|
|
|
<properties>
|
|
<maven.compiler.source>17</maven.compiler.source>
|
|
<maven.compiler.target>17</maven.compiler.target>
|
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
|
<aws.sdk.version>2.44.14</aws.sdk.version>
|
|
<awsjavasdk.version>2.44.14</awsjavasdk.version>
|
|
<jackson.version>2.18.8</jackson.version>
|
|
<kafka.clients.version>3.9.2</kafka.clients.version>
|
|
<netty.version>4.1.135.Final</netty.version>
|
|
<wire.version>6.3.0</wire.version>
|
|
</properties>
|
|
|
|
<dependencyManagement>
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>bom</artifactId>
|
|
<version>${aws.sdk.version}</version>
|
|
<type>pom</type>
|
|
<scope>import</scope>
|
|
</dependency>
|
|
<!-- Force consistent Netty version across AWS SDK and Lettuce -->
|
|
<dependency>
|
|
<groupId>io.netty</groupId>
|
|
<artifactId>netty-bom</artifactId>
|
|
<version>${netty.version}</version>
|
|
<type>pom</type>
|
|
<scope>import</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson</groupId>
|
|
<artifactId>jackson-bom</artifactId>
|
|
<version>${jackson.version}</version>
|
|
<type>pom</type>
|
|
<scope>import</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.squareup.wire</groupId>
|
|
<artifactId>wire-runtime</artifactId>
|
|
<version>${wire.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.squareup.wire</groupId>
|
|
<artifactId>wire-runtime-jvm</artifactId>
|
|
<version>${wire.version}</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.commons</groupId>
|
|
<artifactId>commons-lang3</artifactId>
|
|
<version>3.18.0</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>org.apache.kafka</groupId>
|
|
<artifactId>kafka-clients</artifactId>
|
|
<version>${kafka.clients.version}</version>
|
|
</dependency>
|
|
</dependencies>
|
|
</dependencyManagement>
|
|
|
|
<dependencies>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>acm</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>sqs</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>s3</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>s3control</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>ssm</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>sns</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>dynamodb</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>dynamodb-enhanced</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>lambda</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>apigateway</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>apigatewayv2</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>apigatewaymanagementapi</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>kms</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>cognitoidentityprovider</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>sfn</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>iam</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>kafka</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>mq</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>athena</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>glue</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>resourcegroupstaggingapi</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.glue</groupId>
|
|
<artifactId>schema-registry-serde</artifactId>
|
|
<version>1.1.27</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>firehose</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>ec2</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>sts</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>elasticache</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>elasticbeanstalk</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>io.lettuce</groupId>
|
|
<artifactId>lettuce-core</artifactId>
|
|
<version>6.3.2.RELEASE</version>
|
|
</dependency>
|
|
<!-- RDS management client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>rds</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>neptune</artifactId>
|
|
</dependency>
|
|
<!-- EventBridge client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>eventbridge</artifactId>
|
|
</dependency>
|
|
<!-- Cloud Map (servicediscovery) client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>servicediscovery</artifactId>
|
|
</dependency>
|
|
<!-- CloudTrail client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>cloudtrail</artifactId>
|
|
</dependency>
|
|
<!-- EMR client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>emr</artifactId>
|
|
</dependency>
|
|
<!-- WAF v2 client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>wafv2</artifactId>
|
|
</dependency>
|
|
<!-- Kinesis client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>kinesis</artifactId>
|
|
</dependency>
|
|
<!-- Netty async HTTP client — required for KinesisAsyncClient (SubscribeToShard) -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>netty-nio-client</artifactId>
|
|
</dependency>
|
|
<!-- CloudWatch Logs client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>cloudwatchlogs</artifactId>
|
|
</dependency>
|
|
<!-- CloudWatch Metrics client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>cloudwatch</artifactId>
|
|
</dependency>
|
|
<!-- Secrets Manager client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>secretsmanager</artifactId>
|
|
</dependency>
|
|
<!-- SES client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>ses</artifactId>
|
|
</dependency>
|
|
<!-- SES V2 client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>sesv2</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>route53</artifactId>
|
|
</dependency>
|
|
<!-- OpenSearch Service management client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>opensearch</artifactId>
|
|
</dependency>
|
|
<!-- ECS client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>ecs</artifactId>
|
|
</dependency>
|
|
<!-- ECR client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>ecr</artifactId>
|
|
</dependency>
|
|
<!-- EventBridge Pipes client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>pipes</artifactId>
|
|
</dependency>
|
|
<!-- AWS IoT client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>iot</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>iotdataplane</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>iotjobsdataplane</artifactId>
|
|
</dependency>
|
|
<!-- EKS client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>eks</artifactId>
|
|
</dependency>
|
|
<!-- ELBv2 client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>elasticloadbalancingv2</artifactId>
|
|
</dependency>
|
|
<!-- EventBridge Scheduler client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>scheduler</artifactId>
|
|
</dependency>
|
|
<!-- Auto Scaling client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>autoscaling</artifactId>
|
|
</dependency>
|
|
<!-- CloudFormation client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>cloudformation</artifactId>
|
|
</dependency>
|
|
<!-- CodeBuild client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>codebuild</artifactId>
|
|
</dependency>
|
|
<!-- CodeDeploy client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>codedeploy</artifactId>
|
|
</dependency>
|
|
<!-- CodePipeline client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>codepipeline</artifactId>
|
|
</dependency>
|
|
<!-- AWS Backup client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>backup</artifactId>
|
|
</dependency>
|
|
<!-- AppSync client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>appsync</artifactId>
|
|
</dependency>
|
|
<!-- S3 Vectors client -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>s3vectors</artifactId>
|
|
</dependency>
|
|
<!-- AppConfig and AppConfigData clients -->
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>appconfig</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>appconfigdata</artifactId>
|
|
</dependency>
|
|
<!-- JDBC drivers for RDS data-plane tests -->
|
|
<dependency>
|
|
<groupId>org.postgresql</groupId>
|
|
<artifactId>postgresql</artifactId>
|
|
<version>42.7.11</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.mysql</groupId>
|
|
<artifactId>mysql-connector-j</artifactId>
|
|
<version>8.3.0</version>
|
|
</dependency>
|
|
|
|
<dependency>
|
|
<groupId>org.mariadb.jdbc</groupId>
|
|
<artifactId>mariadb-java-client</artifactId>
|
|
<version>3.3.2</version>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.core</groupId>
|
|
<artifactId>jackson-databind</artifactId>
|
|
</dependency>
|
|
<!-- JUnit 5 -->
|
|
<dependency>
|
|
<groupId>org.junit.jupiter</groupId>
|
|
<artifactId>junit-jupiter</artifactId>
|
|
<version>5.10.2</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
<!-- AssertJ for fluent assertions -->
|
|
<dependency>
|
|
<groupId>org.assertj</groupId>
|
|
<artifactId>assertj-core</artifactId>
|
|
<version>3.25.3</version>
|
|
<scope>test</scope>
|
|
</dependency>
|
|
</dependencies>
|
|
|
|
<build>
|
|
<plugins>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-surefire-plugin</artifactId>
|
|
<version>3.2.5</version>
|
|
<configuration>
|
|
<!-- Include *Tests.java to also run DynamoDbScanConditionTests, EcsTests,
|
|
Ec2Tests, etc. that were silently skipped by the original pattern -->
|
|
<includes>
|
|
<include>**/*Test.java</include>
|
|
<include>**/*Tests.java</include>
|
|
</includes>
|
|
<environmentVariables>
|
|
<FLOCI_ENDPOINT>${env.FLOCI_ENDPOINT}</FLOCI_ENDPOINT>
|
|
</environmentVariables>
|
|
</configuration>
|
|
</plugin>
|
|
<plugin>
|
|
<groupId>org.apache.maven.plugins</groupId>
|
|
<artifactId>maven-compiler-plugin</artifactId>
|
|
<version>3.12.1</version>
|
|
<configuration>
|
|
<source>17</source>
|
|
<target>17</target>
|
|
</configuration>
|
|
</plugin>
|
|
</plugins>
|
|
</build>
|
|
</project>
|