🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

genbox.simples3.cli.core.commercial

Package Overview
Dependencies
Maintainers
0
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

genbox.simples3.cli.core.commercial

2.3.0
unpublished
NuGet
Version published
Maintainers
0
Created
Source

SimpleS3

License

Description

A C# implementation of Amazon's S3 API with a focus on simplicity, security and performance. Download or upload an object with a single line of code.

S3 features

  • Streaming chunked encoding support.
  • Server-side encryption with customer keys.
  • Support for path and virtual host style buckets.

API features

These are the features provided by SimpleS3.

  • Retry/timeout support via Polly.
  • Build requests through easy builder-based APIs. You never again have to remember the low-level details of a HTTP header.
  • Use the ProfileManager to manage credentials. Use ConsoleSetup to secure setup new profiles.
  • Support for pre-signed URLs
  • Full async and cancellation support.
  • Client-side validation of requests makes it easier to know what is wrong before sending a request.
  • Support uploading non-seekable streams or streams with no length.
  • Supports automatic URL decoding of XML responses to support special non-XML compliant characters.
  • Extensive unit tests ensure correctness and stability.
  • Few allocations due to extensive use of object pools.
  • API is fully annotated with nullability.
  • Dependency injection friendly. By default uses Microsoft.Extensions.DependencyInjection.
  • Supports configuration binding via Microsoft.Extensions.Configuration.

Usage

Download package

The packages here already depends on all the things you need. Commercial packages require a commercial sponsorship.

NugetType
AmazonS3 - FreeFree
BackblazeB2 - CommercialCommercial
Google cloud Storage - CommercialCommercial
Wasabi - CommercialCommercial

See the provider status page for the list of operations that are currently supported. For the purpose of the examples below, we are going to use the Amazon S3 provider.

Setup the config and client

AmazonS3Client client = new AmazonS3Client("MyKeyId", "MyAccessKey", AmazonS3Region.EuWest1)

Or use Microsoft's Dependency Injection

ServiceCollection services = new ServiceCollection();
services.AddAmazonS3(config => {
    config.Credentials = new StringAccessKey("MyKeyId", "MyAccessKey");
    config.Region = AmazonS3Region.EuWest1;
});

ServiceProvider provider = services.BuildServiceProvider();
AmazonS3Client client = provider.GetRequiredService<AmazonS3Client>();

Download/Upload using the Transfer API

The fluent Transfer API makes downloading/uploading objects easier by providing a convenient way of supplying information such as cache control, content-disposition, encryption keys, etc.

//Upload
IUpload upload = client.CreateUpload("MyBucket", "MyObject")
                        .WithAccessControl(ObjectCannedAcl.PublicReadWrite)
                        .WithCacheControl(CacheControlType.NoCache)
                        .WithEncryption();

PutObjectResponse putResp = await upload.UploadStringAsync("Hello World!");

//Download string
IDownload download = client.CreateDownload(bucketName, objectName)
                           .WithRange(0, 5);

GetObjectResponse getResp = await download.DownloadAsync();

Console.WriteLine(await dlResp.Content.AsStringAsync()); //Outputs "Hello"

Commercial features

This project is open source and released under the permissive MIT license, but some features are only avaliable to Commercial Tier sponsors. You need to be part of the Commercial Tier to access these features and any of the goodies thats comming in the future.

Currently SimpleS3 has the following commercial features:

  • Support multiple S3 providers. See provider support further down for more info.
  • Support for uploading/downloading multiparts with parallel requests.
  • High-level API to help listing/deleting more than 1000 objects at the time. Uses HTTP pipelining to reduce latency.
  • Extends ProfileManager with strong in-memory and on-disk encryption. Keys are always cleared from memory after use.
  • Enable automatic pooling of requests to reduce allocations and speed up requests.

Extensions

SimpleS3 is extensible and has multiple different network drivers and extensions you can use. Click on the extension below for more information. Note that some extensions contains commercial features. You can purchase a commercial license by sponsoring me.

If you are already using the SimpleS3.AmazonS3 package, you already have a dependency on most of the extensions below. These are only for advanced users that want to tweak their setup to their own liking.

NugetExtensionDescription
NuGetHttpClientA network driver based on HttpClient
NuGetHttpClientFactoryA network driver based on HttpClientFactory. It supports dynamic DNS changes.
NuGetHttpClientFactory.PollyAdds support for retry/timeout logic through Polly
NuGetProfileManagerA profile manager that can safely persist your credentials to disk

Keywords

AmazonS3

FAQs

Package last updated on 05 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts