Feature: Public Web Access, Private tgz download access #1368
Replies: 12 comments
-
hi @NathanaelA . I think this is not doable, let me explain why. When you click download tarball you are actually downloading from the registry API, thus, if we add some sort of login for fetch tarballs this also will affect the |
Beta Was this translation helpful? Give feedback.
-
Actually it does appear there is a way to do it. ;-) I actually played with this a bit last night and I made only a couple quick hacks and was able to make visibility work. I haven't finished testing to make sure that install was still locked; but none of the code I changed appears to have anything to do with install. But view worked great. I added two If I got it working properly, would a |
Beta Was this translation helpful? Give feedback.
-
Perhaps you can show me a PoC, it would be great to see your approach. |
Beta Was this translation helpful? Give feedback.
-
@juanpicado - Just finished testing. Yes it does work. So far I only had to change the following:
Tested it. Config has If this is a feature you would like to add; I'll can work on adding an actual |
Beta Was this translation helpful? Give feedback.
-
@juanpicado - You can see a version with these changes at: https://npm.proplugins.org I also was able to make a single change to the search allow_access to allow_view and it worked like the other files. So adding a "View" security is fairly trivial... |
Beta Was this translation helpful? Give feedback.
-
Thanks 🙏 I will take a look along the week :) |
Beta Was this translation helpful? Give feedback.
-
Since you swapped to TS; I fixed all the links in my changes post; and added the single search change I had to do. View mode works perfectly as far as I can see, and the changes are pretty simple overall. ;-) |
Beta Was this translation helpful? Give feedback.
-
Thanks @NathanaelA for your detailed explanation, here are my thoughts. What I've seen by far is you want specific permissions for web endpoints allowing users to read the readme and access the packages (list them in the UI) using a new property in package access section named The idea to separate access roles for UI and API seems interesting to me, but I do not agree with the implementation. The differences between I have no proposal in exchange for this unless suggesting create a middleware plugin, which might work. Hopefully you understand all my concerns. However, I'm open to listen more options (from you or anyone) about how to address your proposal. |
Beta Was this translation helpful? Give feedback.
-
Thoughts? |
Beta Was this translation helpful? Give feedback.
-
Plz show the use case. Can not imagine why people can download package via web and can not download it via CLI. |
Beta Was this translation helpful? Give feedback.
-
@artemdudkin - I believe you misunderstood me. I wanted view access so that people can see all the packages, read the readme's, get the links to the repos; but CANNOT download the .tgz the via The changes I listed above gave me a public/everybody "view" mode with no ability to download unless they are logged in. My Verdaccio instance is currently working this way (with these changes); and meets these needs properly. So I am good! So, this issue can be closed now, unless you guys want to leave it open to possibly re-implement these changes in a future version. Do to some additional features I was pondering today, I realized a completely different and better way for me to proceed. One which will give me the ability to easily add all the additional features that I need and will actually simplify my infrastructure as my https://plugins.nativescript.rocks/plugins codebase already has most the features I needed. So rather that add features to Verdaccio; I just need to add NPM endpoint api to my own codebase and then Verdaccio won't be needed any more. I'll have the ability to easily add any of the final missing features, and won't have to worry about backwards compatibility. 😀 Verdaccio is an awesome product -- and it got me off the ground for my next venture. However, I think I am doing something that doesn't really co-inside with what the majority of people need from it and the number of features that I would need to add/or retrofit into Verdaccio to match what I already have and what I need -- I believe a lot more work than shifting my direction... 😀 |
Beta Was this translation helpful? Give feedback.
-
I have a specific usecase for this, but in reverse: people cannot view packages via web (unless authenticated), but can download them via CLI (if they know the exact url) without authentication. The use case for this would be to allow a private (as in, private usage for our company only) npm registry to be accessible remotely (i.e. for those devs that work from home), but have the web interface locked behind authentication (so in case someone does find our url, they still need a user & pass to view the list of packages). This is especially useful for people wanting to setup their own npm registry and use it in Unity 2018.4 LTS (a game development engine that uses most of the npm concepts to allow adding additional packages containig game assets), since users can add their own scoped registry, and put the user & pass in the url itself ( |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
I would like the web interface/page to be public and show all the docs/readme's but the ability to
npm install
or download the .tgz directly would require the user to log in/or be logged in.Describe the solution you'd like
Perhaps a new setting in the config for website access?
Additional context
I am going to have a private registry for certain packages; however to read the actual docs is not private -- I think it makes a lot more sense to allow them to search, read the readme's; link to the git repo from the web facing registry. The only part I need secured is the actual download of the tgz file...
Beta Was this translation helpful? Give feedback.
All reactions