Inherits all conventions from the root AGENTS.md. Below are module-specific additions only.
Core S3Mock server implementation.
server/src/main/kotlin/com/adobe/testing/s3mock/
├── S3MockApplication.kt # Spring Boot entry
├── S3MockConfiguration.kt # Top-level config
├── S3MockProperties.kt # Properties binding
├── controller/
│ ├── *Controller.kt # REST endpoints
│ ├── ControllerConfiguration.kt # Controller beans + exception handlers
│ └── ControllerProperties.kt
├── dto/ # XML/JSON models (*Result, request/response)
├── service/
│ ├── *Service.kt # Business logic
│ └── ServiceConfiguration.kt # Service beans (used in @SpringBootTest)
├── store/
│ ├── *Store.kt # Persistence
│ ├── StoreConfiguration.kt # Store beans (used in @SpringBootTest)
│ └── StoreProperties.kt
└── util/
├── DigestUtil.kt # ETag/checksum computation (replaces Apache Commons)
├── EtagUtil.kt # ETag normalization
├── HeaderUtil.kt # HTTP header helpers
└── AwsHttpHeaders.kt # AWS-specific header constants
Adding S3 operation: Follow DTO → Store → Service → Controller:
- DTO (
dto/): Data classes with Jackson annotations for XML/JSON models. In current DTOs, use@JsonRootName("...", namespace = "http://s3.amazonaws.com/doc/2006-03-01/")and@JsonProperty("...", namespace = "...")fromcom.fasterxml.jackson.annotation, plus XML-specific annotations such as@JacksonXmlElementWrapper(useWrapping = false)fromtools.jackson.dataformat.xml.annotationfor collections. See rootAGENTS.mdXML Serialization section. Verify element names against AWS S3 API docs. - Store (
store/): Filesystem path resolution, binary storage, metadata JSON. Key classes:BucketStore,ObjectStore,BucketMetadata,S3ObjectMetadata. - Service (
service/): Validation, store coordination. ThrowS3Exceptionconstants (e.g.,S3Exception.NO_SUCH_BUCKET) — see docs/SPRING.md for exception handling rules. - Controller (
controller/): HTTP mapping only — delegate all logic to services. Controllers never catch exceptions.
S3MockExceptionHandlerconvertsS3Exception→ XMLErrorResponsewith the correct HTTP statusIllegalStateExceptionHandlerconverts unexpected errors →500 InternalError
See docs/SPRING.md for exception handling patterns and rules.
See docs/TESTING.md for the full strategy. Service and store tests use @SpringBootTest with @MockitoBean; controller tests use @WebMvcTest with @MockitoBean and BaseControllerTest. Always extend the appropriate base class (ServiceTestBase, StoreTestBase, BaseControllerTest).
Three @ConfigurationProperties classes bind environment variables to typed properties:
StoreProperties(com.adobe.testing.s3mock.store.*) — storage root, buckets, KMS, regionControllerProperties(com.adobe.testing.s3mock.controller.*) — context pathS3MockProperties(com.adobe.testing.s3mock.*) — top-level settings
make run
docker run -p 9090:9090 -p 9191:9191 adobe/s3mock:latest