Skip to content

Commit 9d4fea3

Browse files
authored
Remove S3 code that was obsolete in V3 for V4. (#3686)
The GetACL and PutACL obsoletes were left since they were only obsolete in V4.
1 parent 1e44507 commit 9d4fea3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+68
-1373
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"services": [
3+
{
4+
"serviceName": "S3",
5+
"type": "patch",
6+
"changeLogMessages": [
7+
"Remove obsolete DisableMD5Stream property. Code should be updated to use DisableDefaultChecksumValidation property.",
8+
"Remove obsolete ServerSideEncryptionMethod and ServerSideEncryptionKeyManagementServiceKeyId from CopyPart. This should be set in the InitiateMultipartUpload method.",
9+
"Remove obsolete Expires property from GetObjectResponse. Code should be updated to use ExpiresString. Since the string may not be in a valid timestamp format code shoud use TryParse when converting to DateTime.",
10+
"Remove obsolete region identifiers from S3Region enumeration",
11+
"Remove obsolete Prefix property from LifecycleConfiguration. Code should be updated to use Filter property.",
12+
"Remove obsolete Transition and NoncurrentVersionTransition from LifecycleRule. Could should be updated to use the collection versions Transitions and NoncurrentVersionTransitions.",
13+
"Remove obsolete Event property from TopicConfiguration. Code should be updated to use the collection property Events.",
14+
"Remove obsolete CalculateContentMD5Header property. This property no longer needed to be set because the SDK will compute a checksum by default.",
15+
"Remove obsolete Bucket property from SelectObjectContentRequest. Code should be updated to use BucketName.",
16+
"Remove obsolete NumberOfUploadThreads property from TransferUtilityConfig. Code should be updated to use ConcurrentServiceRequests.",
17+
"Remove obsolete DoesS3BucketExist method. Code should be updated to use DoesS3BucketExistV2"
18+
]
19+
}
20+
]
21+
}

sdk/src/Core/Amazon.Runtime/SharedInterfaces/_bcl/ICoreAmazonS3.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,5 @@ public partial interface ICoreAmazonS3
8989
/// </summary>
9090
/// <param name="bucketName"></param>
9191
void EnsureBucketExists(string bucketName);
92-
93-
/// <summary>
94-
/// Check to see if the bucket exists.
95-
/// </summary>
96-
/// <param name="bucketName"></param>
97-
/// <returns></returns>
98-
bool DoesS3BucketExist(string bucketName);
9992
}
10093
}

sdk/src/Services/S3/Custom/AWSConfigs.S3.cs

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,29 +38,6 @@ namespace Amazon
3838
/// </summary>
3939
public static class AWSConfigsS3
4040
{
41-
/// <summary>
42-
/// <para><b>WARNING: Setting DisableMD5Stream to true disables the MD5 data integrity check
43-
/// on upload requests.This property has been deprecated in favor of <see cref="DisableDefaultChecksumValidation"/>
44-
/// Setting the value of DisableMD5Stream will set DisableDefaultChecksumValidation to the same value
45-
/// and vice versa. This property was left here for backwards compatibility.</b></para>
46-
/// <para>
47-
/// When true, MD5Stream will not be used in upload requests. This may increase upload
48-
/// performance under high CPU loads. The default value is false. Set this value to true to
49-
/// disable MD5Stream use in all S3 upload requests or override this value per request by
50-
/// setting the DisableMD5Stream property on PutObjectRequest, UploadPartRequest, or
51-
/// TransferUtilityUploadRequest.</para>
52-
/// <para>MD5Stream, SigV4 payload signing, and HTTPS each provide some data integrity
53-
/// verification. If DisableMD5Stream is true and DisablePayloadSigning is true, then the
54-
/// possibility of data corruption is completely dependant on HTTPS being the only remaining
55-
/// source of data integrity verification.</para>
56-
/// </summary>
57-
[Obsolete("This property is deprecated in favor of DisableDefaultChecksumValidation.")]
58-
public static bool DisableMD5Stream
59-
{
60-
get { return DisableDefaultChecksumValidation; }
61-
set { DisableDefaultChecksumValidation = value; }
62-
}
63-
6441
/// <summary>
6542
/// <para><b>WARNING: Setting DisableDefaultChecksumValidation to true disables the default data
6643
/// integrity check on upload requests.</b></para>
@@ -74,7 +51,6 @@ public static bool DisableMD5Stream
7451
/// verification. If DisableDefaultChecksumValidation is true and DisablePayloadSigning is true, then the
7552
/// possibility of data corruption is completely dependent on HTTPS being the only remaining
7653
/// source of data integrity verification.</para>
77-
/// <para>This flag is a rename of the <see cref="DisableMD5Stream"/> property</para>
7854
/// </summary>
7955
public static bool DisableDefaultChecksumValidation { get; set; }
8056

sdk/src/Services/S3/Custom/IAmazonS3.Extensions.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313
* permissions and limitations under the License.
1414
*/
1515
using System;
16-
#if AWS_ASYNC_API
1716
using System.Threading.Tasks;
18-
#endif
1917
using Amazon.S3;
2018
using Amazon.S3.Model;
2119

@@ -49,7 +47,7 @@ public partial interface IAmazonS3 : IDisposable, Amazon.Runtime.SharedInterface
4947
string GetPreSignedURL(GetPreSignedUrlRequest request);
5048

5149
#endregion
52-
#if AWS_ASYNC_API
50+
5351
#region GetPresignedURLAsync
5452

5553
/// <summary>
@@ -76,6 +74,5 @@ public partial interface IAmazonS3 : IDisposable, Amazon.Runtime.SharedInterface
7674
Task<string> GetPreSignedURLAsync(GetPreSignedUrlRequest request);
7775

7876
#endregion
79-
#endif
8077
}
8178
}

sdk/src/Services/S3/Custom/Internal/AmazonS3PostMarshallHandler.cs

Lines changed: 2 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -130,26 +130,7 @@ private static void SetStreamChecksum(UploadPartRequest uploadPartRequest, IRequ
130130
request.Headers.Add(HeaderKeys.ContentLengthHeader, partialStream.Length.ToString(CultureInfo.InvariantCulture));
131131

132132
request.DisablePayloadSigning = uploadPartRequest.DisablePayloadSigning;
133-
134-
#pragma warning disable CS0618 // Type or member is obsolete
135-
if (!uploadPartRequest.IsSetMD5Digest() && uploadPartRequest.CalculateContentMD5Header && !request.IsDirectoryBucket())
136-
#pragma warning restore CS0618 // Type or member is obsolete
137-
{
138-
// Calculate Content-MD5 if not already set and customer opted in
139-
string md5 = AmazonS3Util.GenerateMD5ChecksumForStream(partialStream);
140-
if (!string.IsNullOrEmpty(md5))
141-
{
142-
request.Headers[HeaderKeys.ContentMD5Header] = md5;
143-
}
144-
145-
// Wrap input stream in MD5Stream; after this we can no longer seek or position the stream
146-
var hashStream = new MD5Stream(partialStream, null, partialStream.Length);
147-
uploadPartRequest.InputStream = hashStream;
148-
}
149-
else
150-
{
151-
uploadPartRequest.InputStream = partialStream;
152-
}
133+
uploadPartRequest.InputStream = partialStream;
153134
}
154135

155136
var defaultChecksumValidationDisabled = uploadPartRequest.DisableDefaultChecksumValidation ?? AWSConfigsS3.DisableDefaultChecksumValidation;
@@ -184,26 +165,7 @@ private static void SetStreamChecksum(PutObjectRequest putObjectRequest, IReques
184165
request.Headers.Add(HeaderKeys.ContentLengthHeader, length.ToString(CultureInfo.InvariantCulture));
185166

186167
request.DisablePayloadSigning = putObjectRequest.DisablePayloadSigning;
187-
188-
#pragma warning disable CS0618 // Type or member is obsolete
189-
if (!putObjectRequest.IsSetMD5Digest() && putObjectRequest.CalculateContentMD5Header && !request.IsDirectoryBucket())
190-
#pragma warning restore CS0618 // Type or member is obsolete
191-
{
192-
// Calculate Content-MD5 if not already set and customer opted in
193-
string md5 = AmazonS3Util.GenerateMD5ChecksumForStream(putObjectRequest.InputStream);
194-
if (!string.IsNullOrEmpty(md5))
195-
{
196-
request.Headers[HeaderKeys.ContentMD5Header] = md5;
197-
}
198-
199-
// Wrap input stream in MD5Stream
200-
var hashStream = new MD5Stream(streamWithLength, null, length);
201-
putObjectRequest.InputStream = hashStream;
202-
}
203-
else
204-
{
205-
putObjectRequest.InputStream = streamWithLength;
206-
}
168+
putObjectRequest.InputStream = streamWithLength;
207169
}
208170

209171
var defaultChecksumValidationDisabled = putObjectRequest.DisableDefaultChecksumValidation ?? AWSConfigsS3.DisableDefaultChecksumValidation;

sdk/src/Services/S3/Custom/Model/CopyPartRequest.cs

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -234,13 +234,9 @@ public partial class CopyPartRequest : AmazonWebServiceRequest
234234
private string expectedSourceBucketOwner;
235235
private RequestPayer requestPayer;
236236

237-
[Obsolete("Use ServerSideEncryptionMethod in InitiateMultipartUploadRequest instead.")]
238-
private ServerSideEncryptionMethod serverSideEncryption;
239237
private ServerSideEncryptionCustomerMethod serverSideCustomerEncryption;
240238
private string serverSideEncryptionCustomerProvidedKey;
241239
private string serverSideEncryptionCustomerProvidedKeyMD5;
242-
[Obsolete("Use ServerSideEncryptionKeyManagementServiceKeyId in InitiateMultipartUploadRequest instead.")]
243-
private string serverSideEncryptionKeyManagementServiceKeyId;
244240

245241
private ServerSideEncryptionCustomerMethod copySourceServerSideCustomerEncryption;
246242
private string copySourceServerSideEncryptionCustomerProvidedKey;
@@ -599,31 +595,6 @@ internal bool IsSetLastByte()
599595
return this.lastByte.HasValue;
600596
}
601597

602-
/// <summary>
603-
/// <para>
604-
/// This property is obsolete. Use ServerSideEncryptionMethod in InitiateMultipartUploadRequest instead.
605-
/// </para>
606-
/// <para>
607-
/// Default: None
608-
/// </para>
609-
/// </summary>
610-
[Obsolete("Use ServerSideEncryptionMethod in InitiateMultipartUploadRequest instead.")]
611-
public ServerSideEncryptionMethod ServerSideEncryptionMethod
612-
{
613-
get { return this.serverSideEncryption; }
614-
set { this.serverSideEncryption = value; }
615-
}
616-
617-
/// <summary>
618-
/// Checks if ServerSideEncryptionMethod property is set.
619-
/// </summary>
620-
/// <returns>true if ServerSideEncryptionMethod property is set.</returns>
621-
[Obsolete("Use ServerSideEncryptionMethod in InitiateMultipartUploadRequest instead.")]
622-
internal bool IsSetServerSideEncryptionMethod()
623-
{
624-
return this.serverSideEncryption != null && this.serverSideEncryption != ServerSideEncryptionMethod.None;
625-
}
626-
627598
/// <summary>
628599
/// The Server-side encryption algorithm to be used with the customer provided key.
629600
///
@@ -690,27 +661,6 @@ internal bool IsSetServerSideEncryptionCustomerProvidedKeyMD5()
690661
return !System.String.IsNullOrEmpty(this.serverSideEncryptionCustomerProvidedKeyMD5);
691662
}
692663

693-
/// <summary>
694-
/// This property is obsolete. Use ServerSideEncryptionKeyManagementServiceKeyId in InitiateMultipartUploadRequest instead.
695-
/// </summary>
696-
[Obsolete("Use ServerSideEncryptionKeyManagementServiceKeyId in InitiateMultipartUploadRequest instead.")]
697-
[AWSProperty(Sensitive=true)]
698-
public string ServerSideEncryptionKeyManagementServiceKeyId
699-
{
700-
get { return this.serverSideEncryptionKeyManagementServiceKeyId; }
701-
set { this.serverSideEncryptionKeyManagementServiceKeyId = value; }
702-
}
703-
704-
/// <summary>
705-
/// Checks if ServerSideEncryptionKeyManagementServiceKeyId property is set.
706-
/// </summary>
707-
/// <returns>true if ServerSideEncryptionKeyManagementServiceKeyId property is set.</returns>
708-
[Obsolete("Use ServerSideEncryptionKeyManagementServiceKeyId in InitiateMultipartUploadRequest instead.")]
709-
internal bool IsSetServerSideEncryptionKeyManagementServiceKeyId()
710-
{
711-
return !System.String.IsNullOrEmpty(this.serverSideEncryptionKeyManagementServiceKeyId);
712-
}
713-
714664
/// <summary>
715665
/// The Server-side encryption algorithm to be used with the customer provided key.
716666
///

sdk/src/Services/S3/Custom/Model/GetObjectResponse.cs

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ public partial class GetObjectResponse : StreamResponse
4343
private string eTag;
4444
private int? missingMeta;
4545
private string versionId;
46-
private DateTime? expires;
4746
private ObjectLockLegalHoldStatus objectLockLegalHoldStatus;
4847
private ObjectLockMode objectLockMode;
4948
private DateTime? objectLockRetainUntilDate;
@@ -69,12 +68,6 @@ public partial class GetObjectResponse : StreamResponse
6968
private string _checksumSHA256;
7069
private ChecksumType _checksumType;
7170

72-
/// <summary>
73-
/// Flag which returns true if the Expires property has been unmarshalled
74-
/// from the raw value or set by user code.
75-
/// </summary>
76-
private bool isExpiresUnmarshalled;
77-
7871
/// <summary>
7972
/// The date and time at which the object is no longer cacheable.
8073
/// </summary>
@@ -310,42 +303,6 @@ internal bool IsSetVersionId()
310303
return this.versionId != null;
311304
}
312305

313-
/// <summary>
314-
/// The date and time at which the object is no longer cacheable.
315-
///
316-
/// </summary>
317-
[Obsolete("This property is deprecated for handling cases where Expires cannot be parsed as a DateTime. Instead, use ExpiresString, which returns the unparsed value from S3.")]
318-
public DateTime? Expires
319-
{
320-
get
321-
{
322-
if (this.isExpiresUnmarshalled)
323-
{
324-
return this.expires;
325-
}
326-
else
327-
{
328-
if (!string.IsNullOrEmpty(this.ExpiresString))
329-
{
330-
this.expires = AmazonS3Util.ParseExpiresHeader(this.ExpiresString, this.ResponseMetadata.RequestId);
331-
}
332-
else
333-
{
334-
this.expires = null;
335-
}
336-
this.isExpiresUnmarshalled = true;
337-
return this.expires.GetValueOrDefault();
338-
}
339-
}
340-
set { this.expires = value; this.isExpiresUnmarshalled = true; }
341-
}
342-
343-
// Check to see if Expires property is set
344-
internal bool IsSetExpires()
345-
{
346-
return this.expires.HasValue;
347-
}
348-
349306
/// <summary>
350307
/// Gets and sets the property ObjectLockLegalHoldStatus.
351308
/// <para>

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/DeleteBucketRequestMarshaller.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,22 +47,21 @@ public IRequest Marshall(DeleteBucketRequest deleteBucketRequest)
4747

4848
if (deleteBucketRequest.BucketRegion != null)
4949
{
50-
// Disable error preventing using explicit RegionEndpoints in the SDK since the code is mapping S3Regions to RegionEndpoints with a fallback default.
51-
#pragma warning disable CR1004,CS0612,CS0618
5250
RegionEndpoint regionEndpoint;
53-
if(deleteBucketRequest.BucketRegion == S3Region.US)
51+
#pragma warning disable CR1004
52+
if (deleteBucketRequest.BucketRegion == S3Region.USEast1)
5453
{
5554
regionEndpoint = RegionEndpoint.USEast1;
5655
}
57-
else if (deleteBucketRequest.BucketRegion == S3Region.EU)
56+
else if (deleteBucketRequest.BucketRegion == S3Region.EUWest1)
5857
{
5958
regionEndpoint = RegionEndpoint.EUWest1;
6059
}
6160
else
6261
{
6362
regionEndpoint = RegionEndpoint.GetBySystemName(deleteBucketRequest.BucketRegion.Value);
6463
}
65-
#pragma warning restore CR1004,CS0612,CS0618
64+
#pragma warning restore CR1004
6665
request.AlternateEndpoint = regionEndpoint;
6766
}
6867

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutBucketReplicationRequestMarshaller.cs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,6 @@ public IRequest Marshall(PutBucketReplicationRequest putBucketreplicationRequest
8585
{
8686
xmlWriter.WriteElementString("Priority", S3Transforms.ToXmlStringValue(rule.Priority));
8787
}
88-
if (rule.IsSetPrefix())
89-
{
90-
xmlWriter.WriteElementString("Prefix", S3Transforms.ToXmlStringValue(rule.Prefix));
91-
}
9288

9389
if (rule.IsSetFilter())
9490
{

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/PutLifecycleConfigurationRequestMarshaller.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -174,17 +174,6 @@ public IRequest Marshall(PutLifecycleConfigurationRequest putLifecycleConfigurat
174174
xmlWriter.WriteElementString("ID", S3Transforms.ToXmlStringValue(lifecycleConfigurationLifecycleConfigurationrulesListValue.Id));
175175
}
176176

177-
if (lifecycleConfigurationLifecycleConfigurationrulesListValue.IsSetPrefix() &&
178-
lifecycleConfigurationLifecycleConfigurationrulesListValue.IsSetFilter())
179-
{
180-
throw new AmazonClientException("LifecycleRule.Prefix is deprecated. Please only use LifecycleRule.Filter.");
181-
}
182-
183-
if (lifecycleConfigurationLifecycleConfigurationrulesListValue.IsSetPrefix())
184-
{
185-
xmlWriter.WriteElementString("Prefix", S3Transforms.ToXmlStringValue(lifecycleConfigurationLifecycleConfigurationrulesListValue.Prefix));
186-
}
187-
188177
if (lifecycleConfigurationLifecycleConfigurationrulesListValue.IsSetFilter())
189178
{
190179
xmlWriter.WriteStartElement("Filter");

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/ReplicationRuleUnmarshaller.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,6 @@ public ReplicationRule Unmarshall(XmlUnmarshallerContext context)
5555

5656
continue;
5757
}
58-
if (context.TestExpression("Prefix", targetDepth))
59-
{
60-
rule.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context);
61-
62-
continue;
63-
}
6458
if (context.TestExpression("Filter", targetDepth))
6559
{
6660
rule.Filter = ReplicationRuleFilterUnmarshaller.Instance.Unmarshall(context);

sdk/src/Services/S3/Custom/Model/Internal/MarshallTransformations/RulesItemUnmarshaller.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ public LifecycleRule Unmarshall(XmlUnmarshallerContext context)
5757

5858
continue;
5959
}
60-
if (context.TestExpression("Prefix", targetDepth))
61-
{
62-
rulesItem.Prefix = StringUnmarshaller.GetInstance().Unmarshall(context);
63-
continue;
64-
}
6560
if (context.TestExpression("Filter", targetDepth))
6661
{
6762
var predicateList = LifecycleFilterPredicateListUnmarshaller.Instance.Unmarshall(context);

0 commit comments

Comments
 (0)