From cbc9c300c4c92000791ab5cb90ae497c7c0da9c3 Mon Sep 17 00:00:00 2001 From: John DiSanti Date: Mon, 28 Aug 2023 15:45:53 -0700 Subject: [PATCH] Add `@optionalAuth` to all S3 operations --- CHANGELOG.next.toml | 6 ++++++ .../amazon/smithy/rustsdk/customize/s3/S3Decorator.kt | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.next.toml b/CHANGELOG.next.toml index 8f11accc1e..4a10a0913e 100644 --- a/CHANGELOG.next.toml +++ b/CHANGELOG.next.toml @@ -54,3 +54,9 @@ message = "Update MSRV to Rust 1.70.0" references = ["smithy-rs#2948"] meta = { "breaking" = true, "tada" = false, "bug" = false, "target" = "all" } author = "Velfi" + +[[aws-sdk-rust]] +message = "Allow `no_credentials` to be used with all S3 operations." +references = ["smithy-rs#2955", "aws-sdk-rust#878"] +meta = { "breaking" = false, "tada" = false, "bug" = true } +author = "jdisanti" diff --git a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt index e83ebb1e9a..31f134d0bb 100644 --- a/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt +++ b/aws/sdk-codegen/src/main/kotlin/software/amazon/smithy/rustsdk/customize/s3/S3Decorator.kt @@ -135,15 +135,9 @@ class FilterEndpointTests( // TODO(P96049742): This model transform may need to change depending on if and how the S3 model is updated. private class AddOptionalAuth { - private val s3OptionalAuthOperations = listOf( - ShapeId.from("com.amazonaws.s3#ListObjects"), - ShapeId.from("com.amazonaws.s3#ListObjectsV2"), - ShapeId.from("com.amazonaws.s3#HeadObject"), - ShapeId.from("com.amazonaws.s3#GetObject"), - ) - fun transform(model: Model) = ModelTransformer.create().mapShapes(model) { shape -> - if (shape is OperationShape && s3OptionalAuthOperations.contains(shape.id) && !shape.hasTrait()) { + // Add @optionalAuth to all S3 operations + if (shape is OperationShape && !shape.hasTrait()) { shape.toBuilder() .addTrait(OptionalAuthTrait()) .build()