Commits (5)
......@@ -255,5 +255,55 @@ public ResourceTypeWaterbutlerRdsS3(string name, IConfiguration gConfig, Resourc
{
await _rdsS3EcsManager.SetBucketQuota(options["bucketname"], quota);
}
public override async Task<Uri> GetEntryDownloadUrl(string key, string version = null, Dictionary<string, string> options = null)
{
return await Task.Run(() =>
{
var amazonConfig = new AmazonS3Config
{
ServiceURL = options["endpoint"],
ForcePathStyle = true
};
using (var client = new AmazonS3Client(_accessKey, _secretKey, amazonConfig))
{
var presignedUrl = client.GetPreSignedURL(new GetPreSignedUrlRequest()
{
BucketName = options["bucketname"],
Key = key,
Verb = HttpVerb.GET,
Protocol = Protocol.HTTP,
// For now, expiry of a day is set, but this might be up to debate
Expires = DateTime.UtcNow.AddHours(24)
});
return new Uri(presignedUrl);
}
});
}
public override async Task<Uri> GetEntryStoreUrl(string key, string version = null, Dictionary<string, string> options = null)
{
return await Task.Run(() =>
{
var amazonConfig = new AmazonS3Config
{
ServiceURL = options["endpoint"],
ForcePathStyle = true
};
using (var client = new AmazonS3Client(_accessKey, _secretKey, amazonConfig))
{
var presignedUrl = client.GetPreSignedURL(new GetPreSignedUrlRequest()
{
BucketName = options["bucketname"],
Key = key,
Verb = HttpVerb.PUT,
Protocol = Protocol.HTTP,
// For now, expiry of a day is set, but this might be up to debate
Expires = DateTime.UtcNow.AddHours(24)
});
return new Uri(presignedUrl);
}
});
}
}
}
......@@ -4,7 +4,7 @@
<RootNamespace>Coscine.ResourceTypeWaterbutlerRdsS3</RootNamespace>
<AssemblyName>Coscine.ResourceTypeWaterbutlerRdsS3</AssemblyName>
<TargetFramework>net5.0</TargetFramework>
<Version>1.1.1</Version>
<Version>1.2.0</Version>
</PropertyGroup>
<PropertyGroup>
<Authors>RWTH Aachen University</Authors>
......