agilord / aws_client

High-level APIs for Amazon Web Services (AWS) in Dart
234 stars 104 forks source link

aws_s3_api doesn't work with Linode Object Storage #420

Open ryanheise opened 8 months ago

ryanheise commented 8 months ago

Linode Object Storage is compatible with S3, although this library doesn't support it because the S3() constructor does not permit configuring an endpoint URL without a service prefix.

I think it would be better to follow boto3 API design and allow explicitly passing in the service name as a parameter so that it doesn't need to be inferred from the URL.

PeterMcKinnis commented 7 months ago

I am using this with Linode, works great.

  var client = s3.S3(
      region: "",
      endpointUrl: "https://${config.endPoint}",
      credentials: s3.AwsClientCredentials(
          accessKey: config.accessKey, secretKey: config.secretKey);
}
isoos commented 6 months ago

@ryanheise: Have you tried https://pub.dev/packages/aws_client ? I'm not sure if there is a difference, but IIRC we don't really release aws_s3_api anymore, it is kind of deprecated.

ryanheise commented 6 months ago

Oh, I didn't realise that!

I'll try aws_client (and failing that, I'll try @PeterMcKinnis 's snippet). Back in March, what I embarrassingly ended up doing was writing my own S3 library which is working fine. Probably not a wise thing to do in retrospect, but fortunately it was only a day's worth of distractions (200 lines), and I already had written some code to generate a presigned URL which aws_s3_api was missing, so I could reuse some of that code.

Does aws_client also have a method to generate presigned URLs?

isoos commented 6 months ago

Does aws_client also have a method to generate presigned URLs?

It is all generated 🙈. However, if you want to contribute the missing part, we may find a place for it.