A manually created forked subset of the official AWS SDK (from aws-sdk-net) limited to the S3 type Amazon.S3.Transfer.TransferUtility, required supporting types, and relevant tests. The parts that are forked retain a package reference dependency to the original AWS SDK but expose alternate implementations of the forked functionality.
-
discard functionality annotated with
ObsoleteAttribute -
use
asyncfunctionality by default- discard synchronous functionality exposed by contracts
- uses
Taskinstead ofThreadpatterns
-
prefer modern
C#syntax to that of the original source code -
enabled Nullable reference types (i.e.
#nullable enable)- code has been refactored to successfully build / test with them enabled
-
coalesce
partialdefinitions where possible -
annotate forked type definitions with
AmazonSdkForkAttribute- documents the
tagof the forked version of the original source - documents source files and namespaces
- documents what type or types in the original source are relevant to the annotated type including:
- directly analogous definitions
- multiple in the case of
partialdefinitions
- multiple in the case of
- non-analogous definitions from which any code was sourced
- directly analogous definitions
- can be used by scripts to reconstitute an original file structure for diff purposes
- documents the
-
expose
privatefunctionality for extensible types- changed modifier to
protected
- changed modifier to
-
expose
internalfunctionality- changed modifier to
protectedfor extensible types - exposed remaining
internalto a list of known assemblies viaInternalsVisibleToAttribute
- changed modifier to
-
modify functionality with
virtualto make it extensible -
correct, improv, and add additional
XML Documentation -
prefer future-proof value types in exposed contracts and signatures
Examples:
Nullable<T>is used instead of sentinelTvalues that representnullDateTimeOffsetinstead ofDateTimeuintinstead ofintwhen value cannot be negativeulonginstead oflongwhen value cannot be negative
NOTE the underlying
aws sdkreference may not yet make use of these and in that case they fallback to those value types for internal calls to that SDK -
change namespaces to match extracted subset functionality as well as the containing solution
-
change logging to use
Serilog- changed
Amazon.Runtime.Internal.Util.LoggertoSerilog.ILogger
- changed
Consuming applications should set the static property Allos.Amazon.Sdk.TonicLogger.BaseLogger to the desired Serilog.ILogger to hook into this library's internal logging
The tests use the AWS credentials file to authenticate with S3
NOTE The credentials file is typically located at
~/.aws/credentialson Unix-like systems, or%USERPROFILE%\.aws\credentialson WindowsSee also: sso-configure-profile-token-auto-sso
In the definition for Allos.Amazon.Sdk.Tests.IntegrationTests.Tests.TestBase on which the property TestAwsCredentialsProfileName should be set to a profile name that exists in the local credential file.
NOTE a default could also be hardcoded in the private field
_testAwsCredentialsProfileName
The original Amazon.S3.Transfer.TransferUtility would never fire Amazon.Runtime.Internal.IAmazonWebServiceRequest.StreamUploadProgressCallback events when uploading a Stream where one or more of the following was true:
Stream.CanSeek==falseStream.Lengthwouldthrow
This limitation has been addressed by including one ore more additional types and patching some of the original type implementations as follows:
- [Forked, Patched]
EventStream- Forked an additional type
EventStreamand enhanced theOnReadevent it publishes
- Forked an additional type
- [Patched]
SimpleUploadCommand- Patched the construction of
PutObjectRequestto attach aProgressHandleralong with anEventStream - Disconnected the existing event registration to
StreamUploadProgressCallback - Registered a handler on
ProgressHandlerthat receives an enhanced implementation ofUploadProgressArgsthat removes the above limitations on this code path
- Patched the construction of
- [Patched]
MultipartUploadCommand- Patched the construction of
UploadPartRequestto attach aProgressHandleralong with anEventStream - Disconnected the existing event registration to
StreamUploadProgressCallback - Registered a handler on
ProgressHandlerthat receives an enhanced implementation ofUploadProgressArgsthat removes the above limitations on this code path
- Patched the construction of
- [Patched]
**TransferUtility- Patched
UploadAsyncto handle a new edge case specific toMultipartUploadCommandandStreaminstances that were previously subject to the above limitations
- Patched
The combination of these patches yields progress update events without limitations.