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

Lib does not honor scheme key in AWSConfig Object #43

Closed
MarkCupitt opened this issue Apr 27, 2023 · 4 comments
Closed

Lib does not honor scheme key in AWSConfig Object #43

MarkCupitt opened this issue Apr 27, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@MarkCupitt
Copy link
Contributor

MarkCupitt commented Apr 27, 2023

Im trying to test k6 locally with a Minio Standalone server installed on the same machine

The AWSConfig Object supports the Normal S3 scheme key that can be set to 'http || https'

    /**
     * The HTTP scheme to use when connecting to AWS.
     *
     * @type {HTTPScheme} ['https']
     */
    scheme: HTTPScheme = 'https'

Here is the type declaration

/**
 * Type representing HTTP schemes
 */
export type HTTPScheme = 'http' | 'https'

however it appears that the functions do not honor this setting, for example

    listBuckets(): Array<S3Bucket> {
        const method = 'GET'

        const signedRequest: SignedHTTPRequest = this.signature.sign(
            {
                method: 'GET',
                protocol: 'https',  <============= Hard Coded
                hostname: this.host,
                path: '/',
                headers: {},
            },
            {}
        )

I have tried using minio in set up for ssl for a self signed cert but the lib reports a tls error (pretty normal)

Is there a way to achieve this? I would expect this is a normal dev scenario, and am hoping for a way to make this work

Many thanks

@MarkCupitt MarkCupitt changed the title Lib Ignores scheme key in AWSConfig Object Lib does not scheme key in AWSConfig Object Apr 27, 2023
@MarkCupitt MarkCupitt changed the title Lib does not scheme key in AWSConfig Object Lib does not honor scheme key in AWSConfig Object Apr 28, 2023
@MarkCupitt
Copy link
Contributor Author

I have forked the repo and done the necessary mods, I don't have a local setup to run the tests, also found another issue where the bucket was prepended to the url that broke DNS on a local Minio Instance

Happy to provide a Pull Request if you want to see what we did, to make it work, might be worth it for future K6 use, as we will be using K6 for testing in Kubernetes, and it will all be http

@oleiade
Copy link
Member

oleiade commented Apr 28, 2023

Hey @MarkCupitt, it looks like you're correct 🤝 We have fixed a couple of issues regarding signature in the last few weeks, and we probably have overlooked this. I believe we had proper support for the scheme prior to that, but I might be wrong.

If you have the bandwidth for it, a Pull Request addressing this would be much appreciated, otherwise I'll probably try to address this in the close future indeed. Let me know 🙇🏻‍♂️

@oleiade oleiade self-assigned this Apr 28, 2023
@oleiade oleiade added the bug Something isn't working label Apr 28, 2023
@MarkCupitt
Copy link
Contributor Author

MarkCupitt commented Apr 28, 2023 via email

@oleiade
Copy link
Member

oleiade commented May 5, 2023

I believe this is now fixed, and will land in version 0.8.0. Closing this. Feel free to reopen if you still experience the issue.

@oleiade oleiade closed this as completed May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants