Projet

Général

Profil

Development #6350

Plan LDAP provisionning from A2 directory

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

Statut:
Fermé
Priorité:
Normal
Assigné à:
Catégorie:
LDAP
Version cible:
Début:
26 janvier 2015
Echéance:
% réalisé:

100%

Temps estimé:
Patch proposed:
Non
Planning:

Description

It should be developped with use of the CAS module in mind.


Fichiers

Historique

#1

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Priorité changé de Normal à Haut
#2

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Version cible mis à future
#3

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Version cible changé de future à 2.1.12
#5

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Version cible changé de 2.1.12 à 2.1.13
#6

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Fichier 0001-utils-add-an-helper-function-to-cut-an-iterable-as-b.patch ajouté
  • Fichier 0002-utils-add-helper-function-to-lowercase-the-keys-of-a.patch ajouté
  • Fichier 0003-utils-add-a-helper-function-to-convert-a-dictionnary.patch ajouté
  • Fichier 0004-add-new-application-authentic2_provisionning.patch ajouté

Here is the start of a provisionning application for a2. The application provide just one command provision. It only targets LDAP dictories for now, it allow to select a group of user (a Django filter can be provided) and to create LDAP records based on their attributes. LDAP records matching a filter but none of the users are deleted, this behaviour can be disabled. All configuration is done through a setting named A2_PROVISIONNING_RESOURCES, an example configuration take from the unittest is given later.

This patch serie also include start of test framework for working with OpenLDAP, the class authentic2_provisionning.ldap_utils.Slapd allow to create a temporary OpenLDAP server to initialize its configuration and its database from scratch. It's currently used to test the provisionning command.

A2_PROVISIONNING_RESSOURCES = [{
            'name': 'ldap',
            'url': self.slapd.ldapi_url,
            'bind_dn': 'uid=admin,o=orga',
            'bind_pw': 'admin',
            'base_dn': 'o=orga',
            'rdn_attributes': ['uid',],
            'attribute_mapping': {
                'uid': 'django_user_username',
                'givenName': 'django_user_first_name',
                'sn': 'django_user_last_name',
                'mail': 'django_user_email',
            },
            'format_mapping': {
                'cn': ['{django_user_first_name} {django_user_last_name}'],
            },
            'static_attributes': {
                'objectclass': 'inetorgperson',
            },
            'ldap_filter': '(objectclass=inetorgperson)',
        }]

The goal is to extend this sripts to other databases like SQL, SCIM in the future and to allow creating ressource instances from the manager.

This is lightweight provisionning, the goal is not to handle complex use cases needing user workflows or validation.

#7

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Statut changé de Nouveau à Solution déployée
#8

Mis à jour par Thomas Noël il y a environ 9 ans

Ack for 1 and 2. In 3, please use dict() instead of dict comprehension (python 2.6).

#9

Mis à jour par Thomas Noël il y a environ 9 ans

patch 4, about app_settings and ldap_utils.py:

  • app_settings.py: comment with "pgt" is not very clear...
  • ldap_utils.py: line 22 "PATHS" in global...? In fact, I think SLAPD_PATH and SLAPADD_PATH should be in app_settings
  • time.sleep(0) ...?
I've just start to read management/commands/provision.py:
  • s/juste/just/ because we don't speak french
  • wel... that's all for today...
#10

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

Thomas Noël a écrit :

patch 4, about app_settings and ldap_utils.py:

  • app_settings.py: comment with "pgt" is not very clear...

Ok.

  • ldap_utils.py: line 22 "PATHS" in global...? In fact, I think SLAPD_PATH and SLAPADD_PATH should be in app_settings

It's only used by tests, the goal is for the test to run easily on any platform.

  • time.sleep(0) ...?

There is a comment to explain: it forces the process to yield to the kernel so that slapd has a chance to initialize; it's cooperative multiprocessing :)

I've just start to read management/commands/provision.py:
  • s/juste/just/ because we don't speak french

Ok.

#11

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Fichier 0001-utils-add-an-helper-function-to-cut-an-iterable-as-b.patch supprimé
#12

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Fichier 0002-utils-add-helper-function-to-lowercase-the-keys-of-a.patch supprimé
#13

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Fichier 0003-utils-add-a-helper-function-to-convert-a-dictionnary.patch supprimé
#14

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Fichier 0004-add-new-application-authentic2_provisionning.patch supprimé
#16

Mis à jour par Benjamin Dauvergne il y a environ 9 ans

  • Version cible changé de 2.1.13 à 2.2.0
#17

Mis à jour par Benjamin Dauvergne il y a presque 9 ans

  • Statut changé de Solution déployée à Résolu (à déployer)
#18

Mis à jour par Benjamin Dauvergne il y a presque 9 ans

  • % réalisé changé de 0 à 100
#19

Mis à jour par Benjamin Dauvergne il y a presque 9 ans

  • Statut changé de Résolu (à déployer) à En cours
#20

Mis à jour par Thomas Noël il y a presque 9 ans

À relire, tout me parait ok, je me demande cependant si un nom comme "authentic2_ldap_provisionning" ne serait pas préférable à "authentic2_provisionning" tout court... Mais si le plan c'est d'avoir à terme d'autres outils de provisionning dedans laissons ainsi (peut-être alors renommer la commande ldap-provisionning voir openldap-provisionning) ?

A part ce détail, qui peut être jugé important, c'est un «ack».

#21

Mis à jour par Benjamin Dauvergne il y a presque 9 ans

Oui c'est un peu l'idée mais à voir l'état du code je renommerai bien en ldap-provisionning pour l'instant, au moins la commande.

#22

Mis à jour par Thomas Noël il y a presque 9 ans

Je note juste pour confirmation ou clarification : ça me va très bien de renommer la commande ldap-provisionning.

#23

Mis à jour par Benjamin Dauvergne il y a presque 9 ans

  • Priorité changé de Haut à Normal
#24

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

  • Statut changé de En cours à Fermé
#25

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

  • Statut changé de Fermé à Solution déployée
#26

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

  • Statut changé de Solution déployée à Fermé

Formats disponibles : Atom PDF