Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use path-style URL for AWS Config #26

Closed
vuongphamaioz opened this issue Dec 8, 2022 · 6 comments
Closed

Use path-style URL for AWS Config #26

vuongphamaioz opened this issue Dec 8, 2022 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@vuongphamaioz
Copy link

Hi,

I'm trying to use this library to connect to my self-hosted MinIO Object Storage that has S3-compatible. I connected to my server successfully. But my server uses path-style URL so I can't get buckets on my server. I haven't found any way to config this. Is there any way to do this? For example, in AWS S3 Javascript SDK, this field is named forcePathStyle.

Thanks.

@oleiade
Copy link
Member

oleiade commented Dec 8, 2022

Hi @vuongphamaioz 👋🏻 I'm not sure I understand what you meant by "path-style URL"? Could you please expand on this?🙏🏻

For instance, it would be super helpful if you could provide examples of the requests you're trying to perform that wouldn't work with the latest version of the project.

@oleiade oleiade self-assigned this Dec 8, 2022
@oleiade oleiade added the enhancement New feature or request label Dec 8, 2022
@vuongphamaioz
Copy link
Author

Hi @oleiade,

This is the reference link: https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html

The S3 provides 2 types of URL addresses that we send request to, for example:

  • Virtual-hosted–style: bucket-name.s3.region-code.amazonaws.com/key-name
  • Path-style: s3.region-code.amazonaws.com/bucket-name/key-name

The default of AWS S3 SDK now is virtual-hosted-style.
Below is the example code when I use AWS S3 Javascript SDK.

const s3Client = new S3Client({
  region: "us-east-1",
  credentials: {
    accessKeyId: process.env.AWS_ACCESS_KEY_ID,
    secretAccessKey: process.env.AWS_SECRET_ACCESS_KEY,
  },
  endpoint: {
    url: "https://minio-example.com",
  },
  forcePathStyle: true,
});

Below is the code that I am trying to do

const awsConfig = new AWSConfig({
  region: __ENV.AWS_REGION,
  accessKeyId: __ENV.AWS_ACCESS_KEY_ID,
  secretAccessKey: __ENV.AWS_SECRET_ACCESS_KEY,
  scheme: 'https',
  endpoint: "https://minio-example.com",
  forcePathStyle: true, // has not this field yet
});

Hope it help.

@oleiade
Copy link
Member

oleiade commented Dec 8, 2022

II see; thanks a lot for the specific example. It does sound like a useful feature to add, indeed, but we would need to do a bit of research to decide on which design would be the best👍🏻 We'll look into it 🙇🏻

@vuongphamaioz
Copy link
Author

Thank you very much 🙏🏻

@ismaelpuerto
Copy link

ismaelpuerto commented Dec 8, 2022

related #21

@oleiade
Copy link
Member

oleiade commented May 5, 2023

I believe this might be fixed by #44, which will be released with version 0.8.0, but you can already pick up the specific build files you're interested in from the main branch and take it out for a spin.

Closing. Feel free to reopen if you still experience issues 👍🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants