Loading CHANGELOG.next.toml +6 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,9 @@ message = "`DynMiddleware` is now `clone`able" references = ["smithy-rs#1225"] meta = { "breaking" = false, "tada" = false, "bug" = false } author = "Velfi" [[aws-sdk-rust]] message = "Enable presigning for S3 operations UploadPart and DeleteObject" references = ["aws-sdk-rust#475", "aws-sdk-rust#473"] meta = { "breaking" = false, "tada" = true, "bug" = false } author = "rcoh" aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt +3 −0 Original line number Diff line number Diff line Loading @@ -63,8 +63,11 @@ private val SYNTHESIZE_SPEECH_OP = ShapeId.from("com.amazonaws.polly#SynthesizeS internal val PRESIGNABLE_OPERATIONS by lazy { mapOf( // S3 // TODO(https://github.com/awslabs/aws-sdk-rust/issues/488) Technically, all S3 operations support presigning ShapeId.from("com.amazonaws.s3#GetObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#PutObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#UploadPart") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#DeleteObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), // Polly SYNTHESIZE_SPEECH_OP to PresignableOperation( Loading aws/sdk/integration-tests/s3/tests/presigning.rs +16 −0 Original line number Diff line number Diff line Loading @@ -112,3 +112,19 @@ async fn test_presigning_with_payload_headers() -> Result<(), Box<dyn Error>> { Ok(()) } #[tokio::test] async fn test_presigned_upload_part() -> Result<(), Box<dyn Error>> { let presigned = presign_input!(s3::input::UploadPartInput::builder() .content_length(12345) .bucket("bucket") .key("key") .part_number(0) .upload_id("upload-id") .build()?); assert_eq!( presigned.uri().to_string(), "https://s3.us-east-1.amazonaws.com/bucket/key?x-id=UploadPart&uploadId=upload-id&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ANOTREAL%2F20090213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20090213T233131Z&X-Amz-Expires=30&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Signature=e50e1a4d1dae7465bb7731863a565bdf4137393e3ab4119b5764fb49f5f60b14&X-Amz-Security-Token=notarealsessiontoken" ); Ok(()) } Loading
CHANGELOG.next.toml +6 −0 Original line number Diff line number Diff line Loading @@ -16,3 +16,9 @@ message = "`DynMiddleware` is now `clone`able" references = ["smithy-rs#1225"] meta = { "breaking" = false, "tada" = false, "bug" = false } author = "Velfi" [[aws-sdk-rust]] message = "Enable presigning for S3 operations UploadPart and DeleteObject" references = ["aws-sdk-rust#475", "aws-sdk-rust#473"] meta = { "breaking" = false, "tada" = true, "bug" = false } author = "rcoh"
aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/AwsPresigningDecorator.kt +3 −0 Original line number Diff line number Diff line Loading @@ -63,8 +63,11 @@ private val SYNTHESIZE_SPEECH_OP = ShapeId.from("com.amazonaws.polly#SynthesizeS internal val PRESIGNABLE_OPERATIONS by lazy { mapOf( // S3 // TODO(https://github.com/awslabs/aws-sdk-rust/issues/488) Technically, all S3 operations support presigning ShapeId.from("com.amazonaws.s3#GetObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#PutObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#UploadPart") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), ShapeId.from("com.amazonaws.s3#DeleteObject") to PresignableOperation(PayloadSigningType.UNSIGNED_PAYLOAD), // Polly SYNTHESIZE_SPEECH_OP to PresignableOperation( Loading
aws/sdk/integration-tests/s3/tests/presigning.rs +16 −0 Original line number Diff line number Diff line Loading @@ -112,3 +112,19 @@ async fn test_presigning_with_payload_headers() -> Result<(), Box<dyn Error>> { Ok(()) } #[tokio::test] async fn test_presigned_upload_part() -> Result<(), Box<dyn Error>> { let presigned = presign_input!(s3::input::UploadPartInput::builder() .content_length(12345) .bucket("bucket") .key("key") .part_number(0) .upload_id("upload-id") .build()?); assert_eq!( presigned.uri().to_string(), "https://s3.us-east-1.amazonaws.com/bucket/key?x-id=UploadPart&uploadId=upload-id&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=ANOTREAL%2F20090213%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20090213T233131Z&X-Amz-Expires=30&X-Amz-SignedHeaders=content-length%3Bhost&X-Amz-Signature=e50e1a4d1dae7465bb7731863a565bdf4137393e3ab4119b5764fb49f5f60b14&X-Amz-Security-Token=notarealsessiontoken" ); Ok(()) }