npm
provides a great way of associating a scope with a registry but I don't really see it working with AWS CodeArtifact.
I expect that once you created a domain @myco
and a couple of repositories under that domain, ex: @myco/repo-a
& @myco/repo-b
I would be able to:
npm config set @myco:registry https://888999.d.codeartifact.eu-central-1.amazonaws.com/npm/
npm config set //888999.d.codeartifact.eu-central-1.amazonaws.com/npm/:_authToken=xxx
and all repositories could be installed with the same authToken
, but aws codeartifact login
expects repository which makes me think that it's not possible to install 2 private repos using one token.
Any ideas?
The root of my confusion was an assumption that AWS CodeArtifact has the following hierarchy:
In fact, it's slightly different:
As result generated token works as expected if we configure global
.npmrc
like this:That works for both default npm registry and your own.