aws-sdk-java-v2 icon indicating copy to clipboard operation
aws-sdk-java-v2 copied to clipboard

Async S3 Client Presigned Url Download API

Open davidh44 opened this issue 1 year ago • 2 comments

Motivation and Context

Modifications

  • New handwritten request POJO PresignedDownloadRequest and corresponding marshaller
  • New SdkInternalExecutionAttribute : PRESIGNED_URL
  • Added CustomSdkOperations and CustomSdkOperationsProcessor to add custom PresignedDownload operation to S3 customization config
  • Updated codegen logic to handle custom operation with input having fqcn and marshallerFqcn
  • Updated protocol specs to use custom request type and marshaller, and add presigned url ExecutionAttribute
  • Skipping sync client for now, will revisit
  • Updated AuthSchemeInterceptorSpec to use NoAuthAuthScheme if presigned url operation
  • Updated RequestEndpointInterceptorSpec to skip setting endpoint if presigned url operation

Testing

  • Added customization to codegen test models and updated generated classes
  • Added S3 Integ tests
  • To add unit tests in follow up PRs

Screenshots (if appropriate)

Types of changes

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)

Checklist

  • [ ] I have read the CONTRIBUTING document
  • [ ] Local run of mvn install succeeds
  • [ ] My code follows the code style of this project
  • [ ] My change requires a change to the Javadoc documentation
  • [ ] I have updated the Javadoc documentation accordingly
  • [ ] I have added tests to cover my changes
  • [ ] All new and existing tests passed
  • [ ] I have added a changelog entry. Adding a new entry must be accomplished by running the scripts/new-change script and following the instructions. Commit the new file created by the script in .changes/next-release with your changes.
  • [ ] My change is to implement 1.11 parity feature and I have updated LaunchChangelog

License

  • [ ] I confirm that this pull request can be released under the Apache 2 license

davidh44 avatar Sep 11 '24 16:09 davidh44

Quality Gate Failed Quality Gate failed

Failed conditions
64.3% Coverage on New Code (required ≥ 80%)
C Reliability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

sonarqubecloud[bot] avatar Sep 11 '24 21:09 sonarqubecloud[bot]

Overall I was thinking we should try to be consistent with the model structure We already have "shapeModifiers" we can have something "operationModifiers" and have a field "add" this adds custom operations to the existing operations. Can you please give a try for this approach

{
  "operationModifiers": {
    "PresignedDownload": {
      "addNew": [
        {
          "name": "PresignedDownload",
          "http": {
            "method": "GET",
            "requestUri": "/"
          },
          "input": "PresignedDownloadInput"
          },
          "output": {
            "shape": "GetObjectOutput"
          },
          "errors": [
            {
              "shape": "InvalidObjectState"
            }
          ],
          "documentation": "Non-modeled operation for downloading S3 object with pre-signed URL"
        }
      ]
    }
  }
}

Define PresignedDownloadInput as mentioned in another comment

joviegas avatar Sep 13 '24 17:09 joviegas