summaryrefslogtreecommitdiff
path: root/src/SMAPI.Web/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Web/Framework')
-rw-r--r--src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs16
-rw-r--r--src/SMAPI.Web/Framework/Storage/StorageProvider.cs41
2 files changed, 5 insertions, 52 deletions
diff --git a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
index 4a73750b..878130bf 100644
--- a/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
+++ b/src/SMAPI.Web/Framework/ConfigModels/ApiClientsConfig.cs
@@ -14,22 +14,6 @@ namespace StardewModdingAPI.Web.Framework.ConfigModels
/****
- ** Amazon Web Services
- ****/
- /// <summary>The access key for AWS authentication.</summary>
- public string AmazonAccessKey { get; set; }
-
- /// <summary>The secret key for AWS authentication.</summary>
- public string AmazonSecretKey { get; set; }
-
- /// <summary>The AWS region endpoint (like 'us-east-1').</summary>
- public string AmazonRegion { get; set; }
-
- /// <summary>The AWS bucket in which to store temporary uploaded logs.</summary>
- public string AmazonTempBucket { get; set; }
-
-
- /****
** Azure
****/
/// <summary>The connection string for the Azure Blob storage account.</summary>
diff --git a/src/SMAPI.Web/Framework/Storage/StorageProvider.cs b/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
index b2d8ae7e..12a35f18 100644
--- a/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
+++ b/src/SMAPI.Web/Framework/Storage/StorageProvider.cs
@@ -2,10 +2,6 @@ using System;
using System.IO;
using System.Text;
using System.Threading.Tasks;
-using Amazon;
-using Amazon.Runtime;
-using Amazon.S3;
-using Amazon.S3.Model;
using Azure;
using Azure.Storage.Blobs;
using Azure.Storage.Blobs.Models;
@@ -96,39 +92,12 @@ namespace StardewModdingAPI.Web.Framework.Storage
}
catch (RequestFailedException ex)
{
- if (ex.ErrorCode != "BlobNotFound")
- return new StoredFileInfo { Error = $"Could not fetch that file from storage ({ex.ErrorCode}: {ex.Message})." };
- }
-
- // try legacy Amazon S3
- {
- var credentials = new BasicAWSCredentials(accessKey: this.ClientsConfig.AmazonAccessKey, secretKey: this.ClientsConfig.AmazonSecretKey);
- using IAmazonS3 s3 = new AmazonS3Client(credentials, RegionEndpoint.GetBySystemName(this.ClientsConfig.AmazonRegion));
-
- try
- {
- using GetObjectResponse response = await s3.GetObjectAsync(this.ClientsConfig.AmazonTempBucket, $"uploads/{id}");
- using Stream responseStream = response.ResponseStream;
- using StreamReader reader = new StreamReader(responseStream);
-
- DateTime expiry = response.Expiration.ExpiryDateUtc;
- string pastebinError = response.Metadata["x-amz-meta-pastebin-error"];
- string content = this.GzipHelper.DecompressString(reader.ReadToEnd());
-
- return new StoredFileInfo
- {
- Success = true,
- Content = content,
- Expiry = expiry,
- Warning = pastebinError
- };
- }
- catch (AmazonServiceException ex)
+ return new StoredFileInfo
{
- return ex.ErrorCode == "NoSuchKey"
- ? new StoredFileInfo { Error = "There's no file with that ID." }
- : new StoredFileInfo { Error = $"Could not fetch that file from AWS S3 ({ex.ErrorCode}: {ex.Message})." };
- }
+ Error = ex.ErrorCode == "BlobNotFound"
+ ? "There's no file with that ID."
+ : $"Could not fetch that file from storage ({ex.ErrorCode}: {ex.Message})."
+ };
}
}