Skip to content

Commit

Permalink
S3Client breaking change: DEFAULT requests must pass operation name (#…
Browse files Browse the repository at this point in the history
…802)

**Issue:**
see: awslabs/aws-c-s3#439

**Description of changes:**
- When making requests with the `S3Client` of type `MetaRequestType.DEFAULT`, the user MUST specify the operation name
- Latest submodules:
    ```
    aws-c-cal          v0.6.15 -> v0.7.1
    aws-c-common       v0.9.21 -> v0.9.23
    aws-c-s3           v0.5.10 -> v0.6.0
    s2n                v1.4.16 -> v1.4.17
    ```
  • Loading branch information
graebm authored Jul 3, 2024
1 parent 263d240 commit 5e41fcb
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
2 changes: 1 addition & 1 deletion crt/aws-c-common
Submodule aws-c-common updated 83 files
+1 −1 .clang-tidy
+4 −7 .github/workflows/clang-format.yml
+6 −5 .github/workflows/proof_ci_resources/config.yaml
+10 −1 CMakeLists.txt
+26 −0 THIRD-PARTY-LICENSES.txt
+47 −0 format-check.py
+0 −24 format-check.sh
+2 −4 include/aws/common/atomics.h
+1 −1 include/aws/common/byte_buf.h
+449 −0 include/aws/common/cbor.h
+2 −4 include/aws/common/condition_variable.h
+7 −2 include/aws/common/error.h
+3 −2 include/aws/common/logging.h
+19 −1 include/aws/common/macros.h
+2 −4 include/aws/common/mutex.h
+19 −0 include/aws/common/private/byte_buf.h
+7 −3 include/aws/common/private/external_module_impl.h
+2 −4 include/aws/common/rw_lock.h
+1 −1 include/aws/common/statistics.h
+1 −2 include/aws/common/thread.h
+129 −0 scripts/import_libcbor.py
+8 −3 scripts/latest_submodules.py
+1 −1 source/allocator.c
+3 −1 source/android/logging.c
+19 −0 source/byte_buf.c
+647 −0 source/cbor.c
+12 −2 source/common.c
+19 −0 source/external/libcbor/allocators.c
+425 −0 source/external/libcbor/cbor.c
+74 −0 source/external/libcbor/cbor.h
+131 −0 source/external/libcbor/cbor/arrays.c
+137 −0 source/external/libcbor/cbor/arrays.h
+119 −0 source/external/libcbor/cbor/bytestrings.c
+150 −0 source/external/libcbor/cbor/bytestrings.h
+121 −0 source/external/libcbor/cbor/callbacks.c
+189 −0 source/external/libcbor/cbor/callbacks.h
+14 −0 source/external/libcbor/cbor/cbor_export.h
+163 −0 source/external/libcbor/cbor/common.c
+339 −0 source/external/libcbor/cbor/common.h
+46 −0 source/external/libcbor/cbor/configuration.h
+264 −0 source/external/libcbor/cbor/data.h
+200 −0 source/external/libcbor/cbor/encoding.c
+140 −0 source/external/libcbor/cbor/encoding.h
+189 −0 source/external/libcbor/cbor/floats_ctrls.c
+240 −0 source/external/libcbor/cbor/floats_ctrls.h
+422 −0 source/external/libcbor/cbor/internal/builder_callbacks.c
+85 −0 source/external/libcbor/cbor/internal/builder_callbacks.h
+98 −0 source/external/libcbor/cbor/internal/encoders.c
+41 −0 source/external/libcbor/cbor/internal/encoders.h
+80 −0 source/external/libcbor/cbor/internal/loaders.c
+43 −0 source/external/libcbor/cbor/internal/loaders.h
+57 −0 source/external/libcbor/cbor/internal/memory_utils.c
+50 −0 source/external/libcbor/cbor/internal/memory_utils.h
+33 −0 source/external/libcbor/cbor/internal/stack.c
+53 −0 source/external/libcbor/cbor/internal/stack.h
+95 −0 source/external/libcbor/cbor/internal/unicode.c
+33 −0 source/external/libcbor/cbor/internal/unicode.h
+190 −0 source/external/libcbor/cbor/ints.c
+211 −0 source/external/libcbor/cbor/ints.h
+125 −0 source/external/libcbor/cbor/maps.c
+121 −0 source/external/libcbor/cbor/maps.h
+368 −0 source/external/libcbor/cbor/serialization.c
+168 −0 source/external/libcbor/cbor/serialization.h
+600 −0 source/external/libcbor/cbor/streaming.c
+37 −0 source/external/libcbor/cbor/streaming.h
+142 −0 source/external/libcbor/cbor/strings.c
+183 −0 source/external/libcbor/cbor/strings.h
+46 −0 source/external/libcbor/cbor/tags.c
+74 −0 source/external/libcbor/cbor/tags.h
+1 −1 source/json.c
+1 −1 source/posix/clock.c
+1 −1 source/priority_queue.c
+1 −0 source/windows/thread.c
+11 −0 tests/CMakeLists.txt
+2 −0 tests/assert_test.c
+58 −1 tests/byte_buf_test.c
+489 −0 tests/cbor_test.c
+18 −14 tests/condition_variable_test.c
+9 −7 tests/error_test.c
+87 −0 tests/fuzz/cbor_decoding_transitive.c
+66 −0 tests/fuzz/cbor_double_encode_decode.c
+0 −1 verification/cbmc/proofs/Makefile.common
+4 −1 verification/cbmc/sources/utils.c
2 changes: 1 addition & 1 deletion crt/s2n
Submodule s2n updated from 114cca to 073c7b
9 changes: 4 additions & 5 deletions src/main/java/software/amazon/awssdk/crt/s3/S3Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,10 @@ public S3MetaRequest makeMetaRequest(S3MetaRequestOptions options) {
}

String operationName = options.getOperationName();
if (operationName == null && options.getMetaRequestType() == S3MetaRequestOptions.MetaRequestType.DEFAULT) {
// The upcoming release of aws-c-s3 v0.6.0 will require an operation name for DEFAULT meta-requests.
// Set a default value for now, in case this code gets mixed with the upcoming aws-c-s3 release.
// But when we take the upcoming release for real, change this code to throw IllegalArgumentException.
operationName = new String("DEFAULT");
if (options.getMetaRequestType() == S3MetaRequestOptions.MetaRequestType.DEFAULT && operationName == null) {
Log.log(Log.LogLevel.Error, Log.LogSubject.S3Client,
"S3Client.makeMetaRequest has invalid options; Operation name must be set for MetaRequestType.DEFAULT.");
throw new IllegalArgumentException("S3Client.makeMetaRequest has invalid options; Operation name must be set for MetaRequestType.DEFAULT.");
}

S3MetaRequest metaRequest = new S3MetaRequest();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public MetaRequestType getMetaRequestType() {

/**
* The S3 operation name (eg: "CreateBucket"),
* this should be set for {@link MetaRequestType#DEFAULT},
* this MUST be set for {@link MetaRequestType#DEFAULT},
* it is ignored for other meta request types since the operation is implicit.
*
* See <a href="https://docs.aws.amazon.com/AmazonS3/latest/API/API_Operations_Amazon_Simple_Storage_Service.html">
Expand Down

0 comments on commit 5e41fcb

Please sign in to comment.