Skip to content
This repository has been archived by the owner on Jun 18, 2020. It is now read-only.

LDAP Authentication #73

Merged
merged 40 commits into from
Mar 10, 2013
Merged

LDAP Authentication #73

merged 40 commits into from
Mar 10, 2013

Conversation

rmartinjak
Copy link
Contributor

"Update" to Trac #11501

Optional user authentication via LDAP (only visible in the notebook settings if python-ldap is installed)

(in order to not list all users found in LDAP, the "share worksheet" page now has a search box instead of the list. [Bonus: search results are added to the textbox if you click them])

@rmartinjak
Copy link
Contributor Author

f40903b does not include automatic deactivation of LDAP if an import fails. Is this needed?
I doubt anybody would

  1. install python-ldap
  2. activate LDAP auth in the notebook
  3. remove python-ldap

which is the only case where an import x from ldap would raise an ImportError

@kini
Copy link
Collaborator

kini commented Jun 20, 2012

For thoroughness I think it certainly can't hurt...

@kini kini mentioned this pull request Jun 20, 2012
@rmartinjak
Copy link
Contributor Author

I set up sagenb/ldap at https://rmartinjak.de:8080/ in case anybody wants to play around a bit.
It only has two LDAP users so far, just comment here if you want some more.

User / Password:
admin / sagemath
mjwatson / ilovespidey
loislane / dailyplanet

@jasongrout
Copy link
Member

Judging from the many merges, I take it that you have done a great job of keeping up with master. Is this ready to go? Did anyone review it?

@jasongrout
Copy link
Member

It looks like you might still be working on this? Is that right?

@rmartinjak
Copy link
Contributor Author

I just modified some small parts because I found the code a bit ugly (especially the exception handling should be much cleaner now)

Robin Martinjak added 2 commits November 2, 2012 19:07
Conflicts:
	sagenb/data/sage/html/settings/user_management.html
	sagenb/notebook/user.py
@jasongrout
Copy link
Member

Okay, so we just need someone to review it.

@rmartinjak
Copy link
Contributor Author

How is review done? I couldn't find much in http://www.sagemath.org/doc/developer/sagenb/index.html except "Ask for code review!"

@kini
Copy link
Collaborator

kini commented Nov 20, 2012

AFAIK it's similar to the review process for Sage itself (?), i.e. someone who knows what they're talking about should come along and say it looks good, and then we can merge it... problem is I don't know who knows enough about LDAP to review this (maybe @ijstokes, if he's still doing Sage development?). It's really a shame how long this pull request has been sitting around and how many merge commits you've made...

# so we can turn this auth method on/off
self._auth_methods = {
'auth_ldap': LdapAuth(self._conf),
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not 100% happy with this solution. Probably a "constant" in server_conf would be better than a string. Or maybe somebody has a better idea.

@ppurka
Copy link
Member

ppurka commented Mar 5, 2013

Can people who are using this code just chime in and say "it works"? If there are at least two such groups, then we should simply merge this set of patches. It is an often asked for functionality and so it should go in.

I know that it used to work with sage-4.7, and still works with that installation (the servers are still running happily). But quite a bit has changed in the meanwhile (4.7 was almost two years ago).

@rmartinjak
Copy link
Contributor Author

We've been using it with 5.5 for some weeks and haven't encountered any problems so far.

@ghost
Copy link

ghost commented Mar 6, 2013

Well, we initially wanted this functionality and asked rmartinjak to extend the code, which he did. We are using this over a year now with sage 4.7 and recently with sage 5.5 for university-courses. We can surely say: it works :)

@@ -1369,7 +1369,7 @@ def html_specific_revision(self, username, ws, rev):
username = username, rev = rev, prev_rev = prev_rev,
next_rev = next_rev, time_ago = time_ago)

def html_share(self, worksheet, username):
def html_share(self, worksheet, username, lookup=None):
Copy link
Member

Choose a reason for hiding this comment

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

The documentation to html_share should be updated to explain this lookup parameter

@jasongrout
Copy link
Member

The changes to the share page probably shouldn't be added, at least until we have a better system for managing shared worksheets. On the one hand, it's nice to have a search, but on the other hand, it exposes the exact same sort of problems that we had before---it is trivial for someone to spam a huge number of people with a shared worksheet.

@ppurka
Copy link
Member

ppurka commented Mar 9, 2013

@jasongrout Maybe the lookup code can be kept around, and only the lookup parameter removed from the function definition so that it can enabled in the future.

@jasongrout
Copy link
Member

With the search users feature removed, I don't see anything else jump out at me as a cause for concern. I haven't tested this, though.

@jasongrout
Copy link
Member

And thanks for working on this! I will likely use it this fall.

@ppurka
Copy link
Member

ppurka commented Mar 10, 2013

Thanks a lot for the updates! I checked that the notebook is still working (local and openid) with the new updates. Merging this now.

ppurka added a commit that referenced this pull request Mar 10, 2013
Introduce LDAP Authentication into the notebook.
@ppurka ppurka merged commit f3e6e20 into sagemath:master Mar 10, 2013
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants