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

LDAP sign-in #383

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

LDAP sign-in #383

wants to merge 6 commits into from

Conversation

michaelstorm
Copy link
Contributor

This resolves #347 by adding LDAP user authentication to Barkeep. It's documented, with examples, in doc/ldap.markdown.

Here's the provider selection page. If only one provider of any type is specified, Barkeep skips this page and redirects immediately there, as before. Note that the names are specified arbitrarily in the configuration; I could've used "barkeep.com" instead of "Active Directory".
barkeep_provider_selection

And here's the actual LDAP sign-in page. I'm not great at making things pretty, but it's functional.
barkeep_ldap_signin

I'd like to test it with Ladle, but there seems to be a version conflict between Fezzik's version of Open4 (>= 1.3.0) and Ladle's version (~> 1.0.0). I don't know Ruby best practice in these situations, so I'll leave it alone for now.

That said, I've tested it manually against OpenLDAP and Active Directory. However, the more exotic (read: anything other than :method => :simple) are untested. I'm just too distracted to set up anything more complicated right now.

Best,
Mike

@stave
Copy link

stave commented Jan 29, 2013

This would be awesome. OpenID isn't good when you're trying to use Barkeep with confidential code; I can't have snippets being sent off to [email protected].

halt 400, "LDAP provider not found." unless provider

begin
Timeout::timeout(5) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Timeout should be treated like try/catch -- we should try to only put code inside the body which needs timeout protection. For instance, setting up the vars conn_params and auth_params does not need to be in the timeout, and makes it hard to see the code that needs the timeout protection.

@philc
Copy link
Contributor

philc commented Feb 28, 2013

This is overall a very solid and much-requested piece of functionality Michael. Nice job! If we can restructure it a bit and polish it up, I'd be happy to merge it in.

The one key thing that's missing is some tests. Ladle sounds great and realistic, but even if we had some basic unit tests using mocks, that would help. Since I don't use ldap and don't know how to test it, I'd be very afraid that I'd break your functionality in the course of refactoring things, which would be a headache for anyone who comes along and wants to use it.

@robertandrewbain
Copy link

Great job Michael. My development team are looking to adopt Barkeep, but require Active Directory rather than OpenID. I've been following this post closely and wonder if you have a rough idea of when your branch is likely to get merged into master? Thanks for your efforts adding this highly sought-after functionality.

@zebpalmer
Copy link

👍 I'm starting to test drive barkeep for an enterprise deployment and would (sadly) require ldap as well, this will be a great feature when integrated.

@bobbotron
Copy link

I'm also interested in this feature. My team is interested in using barkeep for our code reviews, but using openid for authentication isn't going to work for us. Active Directory support would be great!

@robertandrewbain
Copy link

As far as open source code review tools go, Barkeep is at the top of its game. With that said, in order for its acceptance within many software development houses, LDAP support is paramount. With only openid support, Barkeep is preventing itself from being used where it is most needed. In absence of LDAP support, I've had to suggest the introduction of the propriety tool Crucible (Atlassian), it's pretty slick, but IMO lacks the simple UI and workflow of Barkeep. It would be great to see Barkeep evolve into an open source project that could be adopted at all levels of development, as it shows great promise.

@philc philc mentioned this pull request May 1, 2013
@PRI-mcallen
Copy link

I would also like to add my vote for this issue.... thanks.

@pioneerit
Copy link

+1 vote.
Any idea when the code will be merged in?

@dmac
Copy link
Contributor

dmac commented Aug 20, 2013

The next action for this pull request is for @michaelstorm to respond to the inlined comments and to include some tests. Michael, this functionality is really great and it looks like it's going to be a popular feature. You mentioned that you couldn't use Ladle to test because of a gem dependency issue. I've fixed this in 9a9ee62. Do you think you could take another crack at polishing this off?

@Nycander
Copy link

👍

This is currently what is stopping me from giving Barkeep a go!

@jlisee
Copy link

jlisee commented Apr 3, 2014

It's been about 8 months, any word on when this will be merged, or what's keeping it from being merged?

@cespare
Copy link
Contributor

cespare commented Apr 3, 2014

What's keeping it from being merged is (a) the code needs cleanup, see review comments and (b) the complete lack of tests.

cespare and others added 2 commits September 11, 2014 15:47
Conflicts:
	Gemfile
	Gemfile.lock
	barkeep_server.rb
@zuk
Copy link

zuk commented Oct 7, 2014

Michael, just wanted to say thanks for this. The LDAP branch is working great for us so far.

:password => params[:password] })}))

if conn.bind
filter = Net::LDAP::Filter.contains(provider[:uid], params[:username])

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Filter.contains needs to actually be Filter.eq. If, for instance, you happen to have Alice Smith (asmith) and Adam Smithson (asmithson) then Alice won't be able to log in because this seach will return both, and the entries.size > 1 error condition a few line below will activate.

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.

Support LDAP authentication