Skip to content
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

[WIP] Add support for private feeds #69

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

loic-sharma
Copy link
Owner

@loic-sharma loic-sharma commented Aug 2, 2018

Private Feeds

⚠️ This is still a work in progress

This adds support for private BaGet feeds using Azure Active Directory authentication. The experience is as follows:

  1. The user runs dotnet restore for the first time on their private BaGet feed
  2. The NuGet client shows the message:

To sign in, use a web browser to open the page https://microsoft.com/devicelogin and enter the code ABCD123456 to authenticate.

  1. After the user logs in using their browser, BaGet grants the user access to the private feed
  2. The NuGet client continues the restore operation

Addresses #36

TODO

  • Backend
    • Support Azure Active Directory authorization
    • Accept the JWT token using HTTP Basic Auth
  • BaGet frontend authentication
  • NuGet client authentication plugin. See this branch
  • Polish
    • Disable the authentication if there are no AAD settings
    • Documentation

For a prototype of the client side code that will be used by the NuGet plugin, see: https://gist.github.com/loic-sharma/dca161747f13a62a6bcf8b1d04259445

/cc @nkolev92

@loic-sharma loic-sharma force-pushed the feature/private-feeds branch 2 times, most recently from 92c07c8 to 68b1370 Compare August 5, 2018 00:00
@loic-sharma
Copy link
Owner Author

@chenzuo
Copy link

chenzuo commented Dec 4, 2018

□ BaGet frontend authentication

hi , guys ! About what time to completed?? plase !

@loic-sharma loic-sharma mentioned this pull request Dec 11, 2018
@pablopioli
Copy link

I'm trying BaGet and I like it. Support for private feeds is something I need. Can I help with something? Some parts that I complete? Glad to help in anything I can.

@chenzuo
Copy link

chenzuo commented Dec 15, 2018

how can i get jwt token? and how in BaGet auth it? how can i setting the jwt ?is ther any about document ?

@chenzuo
Copy link

chenzuo commented Dec 19, 2018

@loic-sharma the url : https://package.jiehai-tech.com/
This address is for everyone to use for testing. Everyone is welcome to use this address test. I will stare at the author's release every minute. As long as he updates, I will provide the latest test address.

@loic-sharma
Copy link
Owner Author

Thanks @chenzuo! One day I’ll setup an official demo endpoint with all of NuGet.org mirrored :)

@pablopioli Hey, thanks for offering. I’m actually planning on taking a step back and reevaluating my approach. Right now, this requires that you setup an Azure Active Directory which is burdensome. I’d like to investigate setting up my own OAuth token server that grant access if you know the API Key. I’ll work on this next week when I get back from the holidays. Cheers!

@pablopioli
Copy link

I have implemented Identity Server and can tell you is a lot simpler to setup Azure AD. However I see how this can bring more flexibility.

Maybe an option to disable the UI? In many cases the Nuget server is only accessed using the command line (build server and code editor tooling). Using the API key to list, upload and download will be sufficient.

@gjonespf
Copy link

Hey @loic-sharma
I think Azure AD for this is ideal for my use case, but can appreciate it's perhaps burdonesome for others. Perhaps some configurable options to swap between Azure AD and e.g. a standard OpenAuth (So you could use Open ID server - https://identityserver.io/). Would definitely suggest this rather than trying to sort out an ID server youself. Definitely keen to see where this goes, sems perfect for what I'm after (currently using Docker image of Klondike, but it's not getting any further updates and has some warts).

@Marusyk
Copy link
Contributor

Marusyk commented May 23, 2019

What status of this feature?

@araqiel2552
Copy link

araqiel2552 commented Aug 23, 2019

I would like to setup a private NuGet server for my company. But Private Feed is needed. What is the advancement? Can I help?

@Sasino97
Copy link

Sasino97 commented Oct 9, 2019

Hello
I fell in love with BaGet and it does everything I needed
However I need to keep my private packages secure otherwise anyone can download them and do malicious things.
A simple feature that only allows the download if the client provides the API key, both in browser and in CLI, would be completely sufficient.

@oli-mo
Copy link

oli-mo commented Oct 18, 2019

I want to help to complete that feature, because I need it too.
Maybe you could summarize what to do and what tasks of the TODO is still open.
You may want to create a github project for it?

BTW Thanks for that project, really appreciate it.

@chazt3n
Copy link

chazt3n commented Apr 8, 2020

What is happening here?
What do you need done?

@tomko80
Copy link

tomko80 commented Sep 22, 2020

I would be happy with just ldaps support on-prem... for cloud hosting SaaS would anyway be the direction.

@Foxite
Copy link

Foxite commented Aug 31, 2021

It seems like this hasn't been finished yet simply because nobody has done so. I'll pay 25 euros to everyone who contributes to this PR, when it is merged. Can anyone tell me what the preferred way of creating bounties is in this project?

@wahmedswl
Copy link

Hi, why not have option for simple authentication like for Publish, there is Api Key. Can something like this be done for all calls to BaGet server?

Thanks

@pablopioli
Copy link

Hi, why not have option for simple authentication like for Publish, there is Api Key. Can something like this be done for all calls to BaGet server?

Thanks

As suggested in
#515
you can use a reverse proxy to implement security

I would suggest
https://microsoft.github.io/reverse-proxy/articles/authn-authz.html
as a c# only solution

You can then plug any authentication you want

@wahmedswl
Copy link

why not something inbuilt rather outsource it? There is already ApiKey based auth for package publish so why not same for view, pull etc as well.

Thanks

@auaustria
Copy link

i really liked BaGet but also wanted private feed. I made an attempt to get something going "in a hackish way" if you like. So if someone is interested, I made some changes in my forked branch with Basic Authentication support. You can see my changes here: main...auaustria:BaGet:feature/browser-basic-auth

Please use it with caution since it is only Basic Auth. You can rotate passwords and update the configuration. This maybe for someone that does not have very strict security requirements.

@as-85
Copy link

as-85 commented Aug 11, 2024

Hey, whats about this Feature? Any news onto PullRequest from @auaustria ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.