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

Support Azure Artifacts registries & personal access token #5246

Closed
colinhacks opened this issue Sep 13, 2023 · 5 comments
Closed

Support Azure Artifacts registries & personal access token #5246

colinhacks opened this issue Sep 13, 2023 · 5 comments
Labels
atw bug Something isn't working

Comments

@colinhacks
Copy link
Contributor

colinhacks commented Sep 13, 2023

From #643 (comment)


The auth for the NPM registry is appended to headers for getting the Tarball itself, which is wrong for Azure Artifacts:

When omitting the Auth header on the same URL in Postman, it works.
If I add the Basic auth, I get a 403, same as bun.

Here's where the auth is added to the request in Bun 1.0

Any chance there'll be a fix for Azure Artifacts that omits the Auth header? Not sure how other registries handle tarballs and if this only applies to https://SERVER.blob.core.windows.net/BLOB_LINK-URLs

@colinhacks colinhacks added the bug Something isn't working label Sep 13, 2023
@colinhacks colinhacks added the atw label Sep 14, 2023
@AndriiZelenskyi
Copy link

This sounds relevant to the issue with the JFrog registry as well. Please, check this one: #2470

@yenerunver
Copy link

yenerunver commented Sep 14, 2023

Same issue, when I configure my .bunfig.toml file with unencoded personal access token from Azure with Packaging rights:

[install]
registry = { username = "$EMAIL", password = "$UNENCODED_AZURE_PTA", url = "https://pkgs.dev.azure.com/$ORGANIZATION/$PROJECT/_packaging/$FEED/npm/registry/" }

then I can access Azure Artifacts but I get 403 errors when downloading private blobs served from Azure Storage.

If I configure my .bunfig.toml file with Base64 encoded personal access token from Azure as per Azure Artifacts npm documentation suggests:

[install]
registry = { username = "$EMAIL", password = "$BASE64_ENCODED_AZURE_PTA", url = "https://pkgs.dev.azure.com/$ORGANIZATION/$PROJECT/_packaging/$FEED/npm/registry/" }

then I get 401 errors when accessing Azure Artifacts.

@davidlacasse
Copy link

This is a show stopper for us. We've tried everything that seemed related to this issue and there's no way around.

@Jarred-Sumner
Copy link
Collaborator

Wrote a little guide: https://bun.sh/guides/install/azure-artifacts, though the layout is currently not right

Fixed by #5729

image

This will ship in Bun v1.0.3, but once that PR lands feel free to try it out bun upgrade --canary

@AndriiZelenskyi
Copy link

Thank you, @Jarred-Sumner, for the fix. It works for the JFrog artifacts as well. Well done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
atw bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants