Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Coscine
backend
libraries
ResourceTypeWaterbutlerRdsS3
Commits
a5db019d
Commit
a5db019d
authored
Apr 23, 2021
by
Marcel Nellesen
Browse files
Merge branch 'Product/1440-largerFiles' into 'Sprint/2021-07'
Product/1440 larger files See merge request
!8
parents
cdeb9301
e77f606f
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/ResourceTypeWaterbutlerRdsS3/ResourceTypeWaterbutlerRdsS3.cs
View file @
a5db019d
...
@@ -255,5 +255,55 @@ public ResourceTypeWaterbutlerRdsS3(string name, IConfiguration gConfig, Resourc
...
@@ -255,5 +255,55 @@ public ResourceTypeWaterbutlerRdsS3(string name, IConfiguration gConfig, Resourc
{
{
await
_rdsS3EcsManager
.
SetBucketQuota
(
options
[
"bucketname"
],
quota
);
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
);
}
});
}
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment