mirror of
https://github.com/floci-io/floci.git
synced 2026-11-23 06:00:46 -05:00
* 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.
337 lines
12 KiB
XML
337 lines
12 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.42.24</aws.sdk.version>
|
|
<awsjavasdk.version>2.42.24</awsjavasdk.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>4.1.118.Final</version>
|
|
<type>pom</type>
|
|
<scope>import</scope>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>com.fasterxml.jackson.core</groupId>
|
|
<artifactId>jackson-databind</artifactId>
|
|
<version>2.18.2</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>athena</artifactId>
|
|
</dependency>
|
|
<dependency>
|
|
<groupId>software.amazon.awssdk</groupId>
|
|
<artifactId>glue</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>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>
|
|
<!-- 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>
|
|
<!-- 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>
|
|
<!-- 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>
|
|
<!-- 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>
|
|
<!-- 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>
|
|
<!-- 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.3</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>
|
|
<version>2.18.2</version>
|
|
</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>
|