Projet

Général

Profil

Bug #5399

Store LDAP users password in session

Ajouté par Benjamin Dauvergne il y a plus de 9 ans. Mis à jour il y a plus de 9 ans.

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
-
Version cible:
-
Début:
05 septembre 2014
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Oui
Planning:

Description

LDAP passwords have to be kept around for two reasons:
  • some LDAP attributes could be only readable by the User and not the identity which Authentic use to bind to the LDAP with the user credentials (service user),
  • user's passwords are usually only modifiable by the user himself.

Currently the password is stored after successful authentication using the Django cache framework using a cache named 'ldap' if it exists and otherwise the default cache. They must use a shared cache (file, SQL, memcache but not locmem, the default). As the cache subsystem is not usually configured like that it makes using LDAP more difficult than necessary.

The provided patch add a middleware to keep the request around in a thread local variable and use it from the LDAPUser subclass of Django's User to retrieve the request session and store LDAP credentials. As session are always stored in a shared cache (default is SQL) it resolves the described problem of initial configuration by not needing it anymore.


Fichiers

Révisions associées

Révision dbbd1ac2 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 9 ans

Add middleware to keep request in thread local storage (refs #5281, refs #5399)

Révision e95a7326 (diff)
Ajouté par Benjamin Dauvergne il y a plus de 9 ans

Store LDAP users passwords in request.session instead of using the Django cache (fixes #5399)

Historique

#1

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-Add-a-middleware-to-store-the-current-request-in-a-t.patch supprimé
#2

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-Add-a-middleware-to-store-the-current-request-in-a-t.patch ajouté
#3

Mis à jour par Frédéric Péters il y a plus de 9 ans

Wouldn't it be more appropriate to reuse the code from #5281 to get access to the request object of the current thread?

In ldap_backend.py, what justifies moving the get/set_cached_password code outside? It doesn't look unused anywhere else; as it is it adds un unncessary depth to the flow, imo.

#4

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0002-Store-LDAP-users-passwords-in-request.session-instea.patch supprimé
#5

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Fichier 0001-Add-a-middleware-to-store-the-current-request-in-a-t.patch supprimé
#7

Mis à jour par Frédéric Péters il y a plus de 9 ans

Super.

#8

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Statut changé de En cours à Résolu (à déployer)
  • % réalisé changé de 0 à 100
#9

Mis à jour par Benjamin Dauvergne il y a plus de 9 ans

  • Statut changé de Résolu (à déployer) à Fermé

Formats disponibles : Atom PDF