feat: abstract pre-signed upload request creation#742
Open
alvarosanchez wants to merge 9 commits into3.0.xfrom
Open
feat: abstract pre-signed upload request creation#742alvarosanchez wants to merge 9 commits into3.0.xfrom
alvarosanchez wants to merge 9 commits into3.0.xfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces a new portable API in object-storage-core for generating time-limited, client-replayable pre-signed upload HTTP requests, with provider-specific implementations for AWS S3, Google Cloud Storage, and Azure Blob Storage, plus corresponding documentation and doc-example controllers.
Changes:
- Adds
CreatePresignedUploadRequest+PresignedUploadtypes and a defaultObjectStorageOperations#createPresignedUpload(...)API returningOptional. - Implements provider-backed signed
PUTrequest generation for AWS, GCP, and Azure, with new provider-specific tests. - Adds a dedicated “Pre-Signed Uploads” documentation section and Java/Groovy/Kotlin controller examples.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/main/docs/guide/toc.yml | Adds the new “Pre-Signed Uploads” section to the guide navigation. |
| src/main/docs/guide/quickStart.adoc | Links quick start readers to the new pre-signed uploads section. |
| src/main/docs/guide/preSignedUploads.adoc | Documents the new pre-signed upload flow and provides a controller example snippet. |
| object-storage-core/src/main/java/io/micronaut/objectstorage/ObjectStorageOperations.java | Adds the portable createPresignedUpload default method returning Optional. |
| object-storage-core/src/main/java/io/micronaut/objectstorage/request/CreatePresignedUploadRequest.java | Defines request parameters for creating a pre-signed upload (key, expiry, optional headers/metadata). |
| object-storage-core/src/main/java/io/micronaut/objectstorage/response/PresignedUpload.java | Defines the portable “full request shape” response (URI/method/headers/expiration). |
| object-storage-core/src/test/groovy/io/micronaut/objectstorage/ObjectStorageOperationsPresignedUploadFallbackSpec.groovy | Verifies the default interface method behavior (providers not overriding return empty). |
| object-storage-aws/src/main/java/io/micronaut/objectstorage/aws/AwsS3Operations.java | Implements AWS S3 pre-signed PUT creation via S3Presigner. |
| object-storage-aws/src/test/groovy/io/micronaut/objectstorage/aws/AwsS3PresignedUploadSpec.groovy | Adds AWS presigned upload unit tests. |
| object-storage-gcp/src/main/java/io/micronaut/objectstorage/googlecloud/GoogleCloudStorageOperations.java | Implements GCS signed PUT generation via Storage#signUrl(...) with portable headers. |
| object-storage-gcp/src/test/groovy/io/micronaut/objectstorage/googlecloud/GoogleCloudStoragePresignedUploadSpec.groovy | Adds GCP presigned upload unit tests. |
| object-storage-azure/src/main/java/io/micronaut/objectstorage/azure/AzureBlobStorageOperations.java | Adds Azure SAS-based signed upload generation and returns portable headers. |
| object-storage-azure/src/test/groovy/io/micronaut/objectstorage/azure/AzureBlobStoragePresignedUploadSpec.groovy | Adds Azure presigned upload unit tests. |
| object-storage-azure/src/test/groovy/io/micronaut/objectstorage/azure/AzureBlobStoragePaginationSpec.groovy | Updates test subclass constructor call due to Azure operations constructor signature change. |
| doc-examples/example-java/src/main/java/example/PresignedUploadController.java | Adds Java doc-example controller for returning a presigned upload payload. |
| doc-examples/example-groovy/src/main/groovy/example/PresignedUploadController.groovy | Adds Groovy doc-example controller for returning a presigned upload payload. |
| doc-examples/example-kotlin/src/main/kotlin/example/PresignedUploadController.kt | Adds Kotlin doc-example controller for returning a presigned upload payload. |
...rage-core/src/main/java/io/micronaut/objectstorage/request/CreatePresignedUploadRequest.java
Show resolved
Hide resolved
...storage-azure/src/main/java/io/micronaut/objectstorage/azure/AzureBlobStorageOperations.java
Outdated
Show resolved
Hide resolved
Member
Author
|
Addressed the remaining review follow-ups on this branch:
Verification:
|
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
Co-Authored-By: Paperclip <noreply@paperclip.ing>
9a1bd69 to
f282a47
Compare
alvarosanchez
commented
Apr 4, 2026
buildSrc/src/main/groovy/io.micronaut.build.internal.objectstorage-base.gradle
Outdated
Show resolved
Hide resolved
Co-Authored-By: Paperclip <noreply@paperclip.ing>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
object-storage-corePUTrequest generation for AWS, GCP, and AzureWhy
Micronaut Object Storage already abstracts direct upload/download operations, but it did not expose a first-class way to generate time-limited client upload requests. Some providers require signed headers in addition to the URL, so the API needs to return the full request shape instead of only a link.
Closes #631.
Validation
./gradlew --no-daemon :micronaut-doc-examples:micronaut-example-java:compileJava :micronaut-doc-examples:micronaut-example-groovy:compileGroovy :micronaut-doc-examples:micronaut-example-kotlin:compileKotlin :micronaut-object-storage-core:test --tests 'io.micronaut.objectstorage.ObjectStorageOperationsPresignedUploadFallbackSpec' :micronaut-object-storage-aws:test --tests 'io.micronaut.objectstorage.aws.AwsS3PresignedUploadSpec' :micronaut-object-storage-gcp:test --tests 'io.micronaut.objectstorage.googlecloud.GoogleCloudStoragePresignedUploadSpec' :micronaut-object-storage-azure:test --tests 'io.micronaut.objectstorage.azure.AzureBlobStoragePresignedUploadSpec' japiCmp docs