-
-
Notifications
You must be signed in to change notification settings - Fork 31
Custom scope authentication #98
Comments
With the following
Installation with npm works (
If I remove the scope from the npmrc file (which I don't really want to do), it still fails:
This means that I'm unable to install this package from a private repo, which is quite a big issue. Is this difficult to fix? (jspm 0.17.0-beta.22) |
I was able to install my package with a temporary hack, but it would really be nice if this was implemented properly. In if (scope) {
var npmrc = new Npmrc();
self.auth = npmrc.getAuth(self.registryURL(scope));
} If I can help in some way, please let me know. |
@glen-84 a proper implementation for this would be really awesome. If you're keen on working on a PR let me know. The hack sounds about the right direction to me actually, but perhaps we can inline the implementation into |
I would have to get more familiar with the code, so if it's something that you could do in 5 minutes then it's probably not worth me trying to figure this all out. However, it is really important and something that I need to have working within the next couple of business days (maybe a week at most), so if you simply don't have the time then please let me know now and I'll see if I can make a plan. |
I don't think that it makes sense for I made some improvements to my code, so it now looks like this: var authData;
if (scope) {
authData = self.npmrc.getAuth(self.registryURL(scope));
} else {
authData = self.auth;
}
// This is the existing code, except that `self.auth` is replaced with `authData`.
return asp(request)(auth.injectRequestOptions({
uri: self.registryURL(scope) + '/' + repoPath,
gzip: true,
strictSSL: self.strictSSL,
headers: lookupCache ? {
'if-none-match': lookupCache.eTag
} : {}
}, doAuth && authData)).then(function(res) { The Question: If there is no scope-specific auth, should it fall back to It would then be something like this: var authData;
if (scope) {
authData = self.npmrc.getAuth(self.registryURL(scope));
}
if (!authData) {
authData = self.auth;
}
// etc. |
@glen-84 it make make sense to have a more general For non-scope-specific, yes we just fallback to global auth.
|
I just submitted a PR for this. I couldn't see the benefit of having a method like that. |
While we now support scopes which have their own registry settings, we still only check the auth once without any scope context. We should upgrade the auth check to apply for each lookup given the currently installing scope.
The text was updated successfully, but these errors were encountered: