should allow better configuration and overrides.

This commit is contained in:
David Lebee 2020-03-13 16:13:49 -04:00
parent fa07c52ccd
commit d78a90d6f2

View File

@ -12,10 +12,10 @@ namespace PoweredSoft.Storage.S3
{ {
public class S3StorageProvider : IStorageProvider public class S3StorageProvider : IStorageProvider
{ {
private readonly string endpoint; protected readonly string endpoint;
private readonly string bucketName; protected readonly string bucketName;
private readonly string accessKey; protected readonly string accessKey;
private readonly string secret; protected readonly string secret;
public S3StorageProvider(string endpoint, string bucketName, string accessKey, string secret) public S3StorageProvider(string endpoint, string bucketName, string accessKey, string secret)
{ {
@ -25,11 +25,11 @@ namespace PoweredSoft.Storage.S3
this.secret = secret; this.secret = secret;
} }
private IAmazonS3 GetClient() protected virtual IAmazonS3 GetClient()
{ {
var config = new AmazonS3Config var config = new AmazonS3Config
{ {
ServiceURL = $"https://{endpoint}" ServiceURL = endpoint
}; };
var client = new AmazonS3Client(this.accessKey, this.secret, config); var client = new AmazonS3Client(this.accessKey, this.secret, config);
return client; return client;