-
Notifications
You must be signed in to change notification settings - Fork 0
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
🐛 Bug: Parse mode doesn't like org-scoped registries #25
Comments
You might be onto something here! I think I need to better understand org scoping. This is instructive: ; bad config
_authToken=MYTOKEN
; good config
@myorg:registry=https://somewhere-else.com/myorg
@another:registry=https://somewhere-else.com/another
//registry.npmjs.org/:_authToken=MYTOKEN
; would apply to both @myorg and @another
; //somewhere-else.com/:_authToken=MYTOKEN
; would apply only to @myorg
//somewhere-else.com/myorg/:_authToken=MYTOKEN1
; would apply only to @another
//somewhere-else.com/another/:_authToken=MYTOKEN2 Consider the kind of thing ; begin auth token
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/registry/:username=org-name
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/registry/:_password=BASE64ENCODEDPAT
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/registry/:email=npm requires email to be set but doesn't use the value
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/:username=org-name
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/:_password=BASE64ENCODEDPAT
//pkgs.dev.azure.com/org-name/_packaging/org-feed-name/npm/:email=npm requires email to be set but doesn't use the value
; end auth token and consider your example of: @myorg:registry=https://pkgs.internal-repo.myorg.com/foo/bar/baz what would we expect? Perhaps: ; begin auth token
@myorg:registry=https://pkgs.internal-repo.myorg.com/foo/bar/baz
//pkgs.internal-repo.myorg.com/foo/bar/baz/:username=org-name
//pkgs.internal-repo.myorg.com/foo/bar/baz/:_password=BASE64ENCODEDPAT
//pkgs.internal-repo.myorg.com/foo/bar/baz/:email=npm requires email to be set but doesn't use the value
//pkgs.internal-repo.myorg.com/foo/bar/:username=org-name
//pkgs.internal-repo.myorg.com/foo/bar/:_password=BASE64ENCODEDPAT
//pkgs.internal-repo.myorg.com/foo/bar/:email=npm requires email to be set but doesn't use the value
; end auth token Would this work for your use case? |
I think, you shouldn't duplicate the All we need in the user's So, I would suggest the behaviour should be:
Considering that folks might be using |
So it's just the parsing that you think should be amended? So if it could cope with @myorg:registry=https://pkgs.internal-repo.myorg.com/foo/bar/baz as well as registry=https://pkgs.internal-repo.myorg.com/foo/bar/baz it'd be fine?
I take you're point on this, but I'd like to tackle this separately |
Yup, I think that's correct. Agreed that the multi registry auth stuff feels more like an enhancement. I'm happy to write up a separate issue for that if it helps. |
🎉 This is included in version v1.2.0 🎉 The release is available on: Cheers! 📦🚀 |
Bug Report Checklist
main
branch of the repository.Expected
Running
npx -y --registry https://registry.npmjs.org azdo-npm-auth
on a project whose.npmrc
uses an org-scoped registry config, like:...should just work™️ as per the README.
Actual
The command fails with the error:
Error parsing project .npmrc.
Additional Info
I presume this is to do with the org scoping, because when I removed the
@orgname:
prefix in my.npmrc
, it worked fine.The text was updated successfully, but these errors were encountered: