@@ -1040,10 +1040,8 @@ function (CommandInterface $cmd) use (&$captured) {
10401040 public function testCallerSuppliedTaggingDoesNotTriggerReplace ()
10411041 {
10421042 // Caller-supplied params['Tagging'] does NOT auto-flip tags_directive.
1043- // With no explicit tags_directive (the default), the resolver stays
1044- // at UNSPECIFIED. No Phase 1 read,
1045- // no Phase 3 PUT. Caller's Tagging rides on CreateMultipartUpload as
1046- // before, preserving legacy initiate-time tagging behavior.
1043+ // Callers who need their Tagging applied must opt in via
1044+ // tags_directive='REPLACE'.
10471045 $ client = $ this ->getTestClient ('s3 ' );
10481046 $ this ->addMockResults ($ client , [
10491047 new Result (['UploadId ' => 'baz ' ]),
@@ -1075,7 +1073,11 @@ function (CommandInterface $cmd) use (&$observed, &$initiate) {
10751073 $ this ->assertNotContains ('GetObjectTagging ' , $ observed );
10761074 $ this ->assertNotContains ('PutObjectTagging ' , $ observed );
10771075 $ this ->assertNotNull ($ initiate );
1078- $ this ->assertSame ('Project=Override&Env=prod ' , $ initiate ['Tagging ' ]);
1076+ $ this ->assertNull (
1077+ $ initiate ['Tagging ' ] ?? null ,
1078+ 'UNSPECIFIED must drop caller-supplied Tagging from '
1079+ . 'CreateMultipartUpload — MPU never carries Tagging on initiate. '
1080+ );
10791081 }
10801082
10811083 public function testAnnotationPutTransientFailureIsRetried ()
@@ -1739,14 +1741,8 @@ function (CommandInterface $cmd) use (&$initiate, &$putTagging) {
17391741 );
17401742 }
17411743
1742- public function testTagsDirectiveUnspecifiedLeavesCallerTaggingOnInitiate ()
1744+ public function testTagsDirectiveUnspecifiedDropsCallerTaggingFromInitiate ()
17431745 {
1744- // When tags_directive resolves to UNSPECIFIED (legacy default with
1745- // no caller --tagging), there is
1746- // no Phase 3 tag write. Caller-supplied params['Tagging'], if any, is
1747- // left on CreateMultipartUpload exactly as before, preserving
1748- // backwards compatibility for callers that relied on the original
1749- // initiate-time tagging behavior.
17501746 $ client = $ this ->getTestClient ('s3 ' );
17511747 $ this ->addMockResults ($ client , [
17521748 new Result (['UploadId ' => 'baz ' ]),
@@ -1772,13 +1768,18 @@ function (CommandInterface $cmd) use (&$initiate, &$observed) {
17721768 'key ' => 'bar ' ,
17731769 'source_metadata ' => $ this ->srcMeta (),
17741770 'tags_directive ' => 'UNSPECIFIED ' ,
1775- 'params ' => ['Tagging ' => 'preserved =yes ' ],
1771+ 'params ' => ['Tagging ' => 'dropped =yes ' ],
17761772 ]);
17771773 $ uploader ->upload ();
17781774
17791775 $ this ->assertNotNull ($ initiate );
1780- $ this ->assertSame ('preserved=yes ' , $ initiate ['Tagging ' ]);
1781- // No Phase 3 tag writes.
1776+ $ this ->assertNull (
1777+ $ initiate ['Tagging ' ] ?? null ,
1778+ 'UNSPECIFIED must drop caller-supplied Tagging from '
1779+ . 'CreateMultipartUpload — MPU never carries Tagging on initiate. '
1780+ );
1781+ // No Phase 1 read, no Phase 3 write.
1782+ $ this ->assertNotContains ('GetObjectTagging ' , $ observed );
17821783 $ this ->assertNotContains ('PutObjectTagging ' , $ observed );
17831784 }
17841785
0 commit comments