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

Private registry scoped package add fails due to forward slash not being encoded #5076

Closed
jbidston opened this issue Sep 12, 2023 · 7 comments · Fixed by #5716
Closed

Private registry scoped package add fails due to forward slash not being encoded #5076

jbidston opened this issue Sep 12, 2023 · 7 comments · Fixed by #5716
Labels
bug Something isn't working

Comments

@jbidston
Copy link

jbidston commented Sep 12, 2023

What version of Bun is running?

1.0.0+822a00c4d508b54f650933a73ca5f4a3af9a7983

What platform is your computer?

MacOS - Darwin 22.1.0 x86_64 i386

What steps can reproduce the bug?

Private NPM Registry AWS CodeArtifact, used for both private packages and to proxy public.

bunfig.toml

[install]
registry = {
	url = "https://something.d.codeartifact.somewhere.amazonaws.com/npm/repository/",
	token = "eabyJ2 ... w7d5Hy4A"
}

(also tried many, many varied configuration syntax)

[install]
registry = {
	url = "https://something.d.codeartifact.somewhere.amazonaws.com/npm/repository/:_authToken=eabyJ2 ... w7d5Hy4A"
}

Install any scoped package, for example @storybook/addons.

bun add @storybook/addons

What is the expected behavior?

Storybook Addons package is installed successfully, enabled by a successful GET request to:

https://something.d.codeartifact.somewhere.amazonaws.com/npm/repository/@storybook%2Faddons

Please note the storybook%2Faddons forward slash is URL encoded.

What do you see instead?

Storybook Addons package is not installed successfully.

GET request to:

https://something.d.codeartifact.somewhere.amazonaws.com/npm/repository/@storybook/addons

... results in a 400 Bad Request

Please note the storybook/addons forward slash is not URL encoded.

After bun install all non-scoped packages install successfully, and all scoped packages are listed:

...
error: @storybook/addon-a11y@^6.5.16 failed to resolve
error: @storybook/addon-essentials@^6.5.16 failed to resolve
error: @storybook/addons@^6.5.16 failed to resolve
error: @storybook/components@^6.5.16 failed to resolve
error: @storybook/react@^6.5.16 failed to resolve
error: @storybook/theming@^6.5.16 failed to resolve
...

Additional information

I think that this issue is being discussed in the comments of #643, and it may improve clarity having a dedicated issue.

While I am using AWS Code Artifact, #643 suggests it is not limited to this artifact repository.

@jbidston jbidston added the bug Something isn't working label Sep 12, 2023
@gabrielrra
Copy link

I am having the same problem, using AWS CodeArtifact

@Mariscal6
Copy link

Same here....

@gingermusketeer
Copy link
Contributor

Running into this issue as well. It looks like the URL is created here unless mistaken.

@snxtecnologiabkp
Copy link

Same here

@CtrlAltFocus
Copy link

same here

@beeb
Copy link

beeb commented Sep 15, 2023

Does someone have the knowledge of Zig to add url-encoding to the package name in the code linked above? Looks like a rather important issue (blocker with no known workaround)

@gingermusketeer
Copy link
Contributor

After a big more digging I found that the above linked code wasn't the right place, it handles pulling the tar file, but the failure is occurring when fetching the package manifest.

Put up a PR that is working for me locally.

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
7 participants