kappa icon indicating copy to clipboard operation
kappa copied to clipboard

Add field to json proxied, showing which its original registry was.

Open aredridel opened this issue 9 years ago • 10 comments

I'd love to make sure we can tell internal and external registry information apart.

aredridel avatar Mar 17 '15 18:03 aredridel

+1 :)

As workaround I'm checking package.repository.url for internal domain on frontend.

alexindigo avatar Mar 17 '15 18:03 alexindigo

Yeah, though that comes from the package, not the registry -- one of the uses of this change would be to identify things published to the wrong registry.

aredridel avatar Mar 17 '15 19:03 aredridel

Interesting, can you elaborate on use case?

alexindigo avatar Mar 17 '15 19:03 alexindigo

We had a package that should have been published to registry.npmjs.com get published to our internal registry by mistake (shadowing the real package) -- diagnosing this was a little bit of guesswork since nothing outright said which registry the answer came from.

aredridel avatar Mar 17 '15 19:03 aredridel

I see. We're trying to have only-local-per-package-npmrc rule to fight this kind of issues. But more visibility will definitely help.

alexindigo avatar Mar 17 '15 19:03 alexindigo

Unfortunately, this is a tough thing to accomplish given we're operating within the confines of an application we don't own. That said, we do add an x-registry header to every response. I believe (without looking ... fingers crossed) you can see that information if you set verbose logging.

Any ideas how else we might be able to accomplish this?

jasisk avatar Mar 17 '15 19:03 jasisk

Perhaps add "kappaRegistryInfo": { "origin": "registryname" } to the returned JSON?

aredridel avatar Mar 17 '15 19:03 aredridel

(and no, it doesn't show with --verbose to npm)

aredridel avatar Mar 17 '15 19:03 aredridel

Shows up with --loglevel=silly but, it is, after all, a silly amount of logging.

jasisk avatar Mar 17 '15 19:03 jasisk

That is indeed silly.

aredridel avatar Mar 17 '15 19:03 aredridel