summaryrefslogtreecommitdiffstats
path: root/ipsilon/util/user.py
Commit message (Collapse)AuthorAgeFilesLines
* Save user attributes on subsequent calls to login.Rob Crittenden2015-03-161-0/+2
| | | | | | | | | | | | | | | | | When a login comes in via the remote_login() call no user attributes are set. These may be later filled in by a subsequent call to login() after the info plugins are called but a short-circuit in that function exits if the user matches the current session. Add an extra conditional such that if the user matches, userattributes are passed in and the current user attributes for this user is empty then save the new data. https://fedorahosted.org/ipsilon/ticket/86 Signed-off-by: Rob Crittenden <rcritten@redhat.com> Reviewed-by: Nathan Kinder <nkinder@redhat.com>
* Don't explicitly save sessionsNathan Kinder2015-03-121-4/+0
| | | | | | | | | | | | | | | | | Saving a session causes it to be unlocked, but sessions have a hook that also performs a save just before the session is finalized. In CherryPy 3.3.0 and later, an assertion was added to ensure that a session is locked when trying to perform a save. Since we perform explicit saves in our code, this causes the assertion to be tripped when the hook executes. This patch removes our explicit save calls. We should rely on the hook to save and unlock the session. https://fedorahosted.org/ipsilon/ticket/84 Signed-off-by: Nathan Kinder <nkinder@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add helper to store provider specific dataRob Crittenden2015-02-131-0/+16
| | | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Rob Crittenden <rcritten@redhat.com>
* Fix file permissions and remove shebang'sPatrick Uiterwijk2014-12-161-2/+0
| | | | | Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Add helpers to store per plugin user preferencesSimo Sorce2014-10-241-1/+9
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Refactor the data store a bitSimo Sorce2014-09-241-3/+3
| | | | | | | | | | | Reduce code duplication, and clearly separates admin and user dbs. Move plugin wrapper away and let plugin code use native functions. This patch also changes the indexed data to use a uuid and assumes 2 identical uuid cannot be created concurrently. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Cast db value to string before comparisonSimo Sorce2014-09-241-1/+1
| | | | | | | | Avoid false negatives when the sqlite3 db is 'smart' and automatically converts the type to integer. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Move user attribute storage into session functionsSimo Sorce2014-08-271-1/+19
| | | | | Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Use new Log class everywhereSimo Sorce2014-08-271-5/+2
| | | | | | | | | Replace copies of _debug function sprinkled all over the code with a single implementation Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com> - Removed replace of self._debug to self.debug
* Rework remote_login and remove protect decoratorSimo Sorce2014-08-271-2/+5
| | | | | | | | | | | | The protect decorator was not really being used for anything, remove it. Change the way UserSession's remote_login() works. If called now it either sets a REMOTE_USER (if found) or nukes the current user data in the session. This means this function can be safely called only in a login plugin now. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Patrick Uiterwijk <puiterwijk@redhat.com>
* Fix E256 with stricter pep8 error checkerSimo Sorce2014-05-201-1/+1
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Add a way to return the email address of the userSimo Sorce2014-03-021-0/+7
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Create a user facility in the sessionSimo Sorce2014-03-021-9/+13
| | | | | | | This way all identification data about the user can be managed in a single place and be erased/replaced at login time. Signed-off-by: Simo Sorce <simo@redhat.com>
* Add way to tell if the session is anonymousSimo Sorce2014-02-241-0/+6
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Improve handing of session dataSimo Sorce2014-02-241-2/+31
| | | | | | | Add functions to store data in an organized way so that multiple plugins can store data w/o stomping on each other. Signed-off-by: Simo Sorce <simo@redhat.com>
* Implement login plugin infrastructureSimo Sorce2014-01-241-0/+39
| | | | Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pep8 checkPetr Vobornik2014-01-241-1/+2
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Signed-off-by: Simo Sorce <simo@redhat.com>
* Use pylint checkPetr Vobornik2014-01-241-1/+1
| | | | | Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
* Fix ImportsSimo Sorce2014-01-241-2/+2
| | | | | | Based on patches by Petr Voborni Signed-off-by: Simo Sorce <simo@redhat.com>
* Rename src package to ipsilonSimo Sorce2014-01-241-0/+79
Signed-off-by: Petr Vobornik <pvoborni@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>