As I explained some days ago on sage-support (am I on the good list
here?), I would like to add ldap identification to Sage.
This seems necessary for some projects:
1) building a Sage server for the whole French math community
(we have a large ldap server used for identifications on some services)
2) In my University, I want to build a prototype of Sage server for the
students (there exists an active directory)
and there are other projects.
The idea is to add a Python module (using Python-ldap) at the good place
in Sage. If the identification succeeds, then -at the first login- a
Sage user will be created.
My question is: where to put this module? I can find this, yes: but I
lack time. If somebody can explain me where and how the
identification/login is done in the notebook, I will certainly ave a lot
of time...
What happens when I press "Sign in" ?
yours
t.d.
----
Thierry Dumont
Institut C. Jordan CNRS & Université Lyon 1.
Villeurbanne, France.
2008/7/6 Thierry Dumont <tdu...@math.univ-lyon1.fr>:
I think login information is first handled by the fuction
getCredentials. The actual username and password checking is done in
the function requestAvatarId. Right above requestAvatarId is code for
creating a new user.
Function getCredentials: guard.py, line 259,
http://www.sagemath.org/hg/sage-main/file/c25e04ebfb67/sage/server/notebook/guard.py
Function requestAvatarId: avatars.py, line 55,
http://www.sagemath.org/hg/sage-main/file/c25e04ebfb67/sage/server/notebook/avatars.py
i know it would be specific to Linux boxes but i think there is a
python_PAM module that would help Sage rely on native Linux PAM
mechanism..
Maybe an option..
Philippe
Why is it not pretty?
> management is very hard to follow.
> Is there some cruft here?
Of course.
> Do notebooks keep their own subsets of users
> for the purposes of limited collaborations?
By "notebooks" do you mean "worksheets"?
If so, then yes each worksheet has a list of users that
are allowed to collaborate on that worksheet. It's
just a plain text list of usernames.
Each complete notebook has a list of users. This is
completely independent of twisted, avatar.py, guard.py,
etc. except that those files will query this list to decide
whether login credentials are valid.
Here is an example of using the users() method to get a list
of them:
EXAMPLES:
sage: n = sage.server.notebook.notebook.Notebook(tmp_dir())
sage: n.create_default_users('password')
Creating default users.
sage: list(sorted(n.users().iteritems()))
[('_sage_', _sage_), ('admin', admin), ('guest', guest),
('pub', pub)]
sage: n.delete()
The list of users for a notebook is a very very simple data
structure. A user is just an instance of the class User that
is defined in user.py. The list of users (the attribute
__users of the notebook instance) is just pickled as part
of the notebook object. That's all there is to
users in the Sage notebook.
-- William
Hi,
I don't like the really insecure storing of the plain text password at
all; that's
of course terrible since it will get pickled to disk probably. But I like
the design strategy you suggest above, especially overloading __eq__
and improving user.py. I very very very strongly encourage you to create
one single tiny patch that does something right in this direction and submit
it to be reviewed and included in Sage. It will help you get a sense of
how the Sage workflow goes without biting off more than you can easily
chew.
-- William
Hello,
I have posted some questions about ldap identification in Sage (in the
notebook), and I started to look a bit more in details... But it seems
that you are much more advanced than me (I'm absolutely not a specialist
of ldap programing, and twisted or zope are a strange world for me);
I'm progressing very very slowly... but I'll need a ldap identification
to convince my University to make a Sage server for the students
(actually using an active directory) and to build a server for the
French Math community (there, we will use a true ldap).
If you are looking for a beta-tester, It could be me :-)
t.d.
--
Thierry Dumont. Institut Camille Jordan -- Mathematiques--
Univ. Lyon I,43 Bd du 11 Novembre 1918, 69622
- Villeurbanne Cedex - France.
tdu...@math.univ-lyon1.fr web: http://math.univ-lyon1.fr/~tdumont
That code looks to me like it is just crap. I'm not insulting
anybody by saying
that since I wrote that code. I would like to strongly encourage you
(Michael D. G.)
to take a clean copy of Sage, change just that code by say getting rid of the
else, test things out, make a patch, and submit it for inclusion in sage. This
is a hopefully simple straightforward task and will give you a sense for the
sage project's workflow (plus you get your name in big red lights as a
contributor).
-- William
--
William Stein
Associate Professor of Mathematics
University of Washington
http://wstein.org
The Mythical Man-Month (Fred Brooks, a MUST read book) has an interesting
example of a dinosaur stuck in a tarpit. The dinosaur can lift any foot
but cannot escape the tarpit. Really large systems, like Axiom and Sage,
have massive, dinosaur-sized tarpits of code.
Developers of these systems have the belief that it is sufficient to write
code that the machine understands. After all, any part of the system can
be understood by anyone with sufficient effort (see... we can lift any
foot you point at...). And every piece of code is perfectly clear
despite having many levels of inherited behavior and unstated background
mathematical theory.
The problem is that tarpit gets larger and deeper with every passing
day and with every additional piece of code added. As the current
developers move on and new people join, they have no way to understand
the prior work except to try to read each file and "integrate".
The best solution I've found it Knuth's Literate Programming (Axiom
uses noweb). The fundamental idea is to write for people while
writing the code so the machine can follow along. This adds about
two to three times as much work for the original developer but
saves the time for everyone else in the future.
And, yes, I know that nobody has the time. But if you don't take
the time now, the next person can only guess, probaby incorrectly,
or give up and rewrite it.
Do you want your code to live?
Tim
More to the point, how much code is in Sage that is designed for the
30 year horizon? Will a matrix inversion still give the right answer
30 years from now? If so, how many dozens of times will it have to
be reimplemented because nobody can understand the current code?
Which of the 16 kinds of matrix inversions are used and how do they
differ in terms of input domains, performance, robustness, etc?
Should I use the Maxima inversion or the Sympy inversion or the
Lapack inversion or implement a new one?
The front ends will likely change. Axiom's hyperdoc help system is
being reimplemented using a firefox front end. The build system is
about to be moved from using 'make' to using 'asdf'. The file system
layout is disappearing, replaced by latex literate books.
<http://axiom.axiom-developer.org/axiom-website/documentation.html>
Sage's notebook is certain to be replaced.
Even so, if we want the next generation of developers to contribute
effectively it seems important to write down what they need to know so
they don't give up in frustration. That's a serious loss. We need a
computational mathematician to be able to contribute effectively
without becoming frustrated. We also need to capture the special
knowledge that lies behind the contributed code since there will be
very few experts worldwide in a given research area. Would you
recognize and be able to fix a bug in a feynman quantum computation?
William has stated that he doesn't care about this issue since he
wants a system NOW that he can use to do his number theory research.
But it is fundamentally about the quality of the system. The 4Ms
don't care because they pay people to learn the code.
Google and Microsoft, having invested real dollars into the
effort, ought to try for a higher standard and a longer horizon.
I really wish they would hire a team with a mandate to make this
code literate.
Tim
Tim: Please create a new thread if you would like to push literate
programming as it is distracting to the topic at hand.
Thierry and Michael_D_G: I played around with python-ldap for a
little bit, and this is definitely doable. There is already some code
for modularizing the authentication and user code at
http://trac.sagemath.org/sage_trac/ticket/2936 , but it still needs
some work. I has sort of sat there since there hadn't been many
requests for the functionality it provides until now. I suspect that
I could have a working first version of the notebook using LDAP in an
evening, and I will try get to it in the next few days.
--Mike
+1.
> Thierry and Michael_D_G: I played around with python-ldap for a
> little bit, and this is definitely doable. There is already some code
> for modularizing the authentication and user code at
> http://trac.sagemath.org/sage_trac/ticket/2936 , but it still needs
> some work. I has sort of sat there since there hadn't been many
> requests for the functionality it provides until now. I suspect that
> I could have a working first version of the notebook using LDAP in an
> evening, and I will try get to it in the next few days.
Don't just think one should use the code at #2936 -- it has quality
issues. However, looking at the code is helpful.
Mike -- I can help too on getting ldap support into the notebook, as I've
mentioned earlier in this thread.
-- William