Write auxiliary data when updating/creating objects #48

Open
opened 2022-10-29 22:38:42 +02:00 by nik · 8 comments
Owner

Some LDAP implementations rely on special state objects to track IDs. An example is Puavo's ID tracking object:

cn=IdPool,o=puavo
objectClass: top
objectClass: puavoIdPool
cn: IdPool
puavoNextRid: 3
puavoNextDatabaseId: 1
puavoNextKadminPort: 10004
puavoNextGidNumber: 10007
puavoNextUidNumber: 10005
puavoNextId: 17

We need a method to update values in such ID objects when modifying the tree from AlekSIS.

Some LDAP implementations rely on special state objects to track IDs. An example is Puavo's ID tracking object: ```ldif cn=IdPool,o=puavo objectClass: top objectClass: puavoIdPool cn: IdPool puavoNextRid: 3 puavoNextDatabaseId: 1 puavoNextKadminPort: 10004 puavoNextGidNumber: 10007 puavoNextUidNumber: 10005 puavoNextId: 17 ``` We need a method to update values in such ID objects when modifying the tree from AlekSIS.
Author
Owner

assigned to @magicfelix

assigned to @magicfelix
Member

assigned to @nik and unassigned @magicfelix

assigned to @nik and unassigned @magicfelix
Member

Also includes the general implementation of AlekSIS -> LDAP sync (using signals?), which is currently not implemented and only possile by using write_model_to_ldap manually.

Also includes the general implementation of AlekSIS -> LDAP sync (using signals?), which is currently not implemented and only possile by using `write_model_to_ldap` manually.
Author
Owner

So, here are two ideas how to implement this, both somewhat related. @magicfelix Do you have an opinion? DOes any of these solutions sound good? If so, can you implement it with my guidance?

Sync the ID pool object like any other, then refer to it

  1. Implement a Django model PuavoIdPool, and configure an LDAP mapping set for it just like with any other model.
  2. Add configuration to LDAP attribute mappings to refer to fields in that model
  3. Add logic to LDAP sync ensuring the pool model is synced before and after the real object

This implementation needs a model specific to the target, e.g. Puavo.

Use raw LDAP for the references

  1. For each LDAP attribute mapping, add a configuration for a "Pool LDAP DN" and "Pool LDAP attribute".
  2. Also add an option specifying what to do with the data retrieved from the pool:
    • Use only (use the value, but don't change it)
    • Use and increment (Use the value, then increment it in LDAP afterwards)
    • Increment and use (Increment the value first, then use the incremented value)
  3. Implement a method to refer to the pool value in the "write template"
  4. Use raw LDAP to do the necessary reads/write during sync
  5. In the frontend: These additional fields should not clutter the UI. Maybe use an Ausklappable of some sort.
So, here are two ideas how to implement this, both somewhat related. @magicfelix Do you have an opinion? DOes any of these solutions sound good? If so, can you implement it with my guidance? ## Sync the ID pool object like any other, then refer to it 1. Implement a Django model `PuavoIdPool`, and configure an LDAP mapping set for it just like with any other model. 2. Add configuration to LDAP attribute mappings to refer to fields in that model 3. Add logic to LDAP sync ensuring the pool model is synced before and after the real object This implementation needs a model specific to the target, e.g. Puavo. ## Use raw LDAP for the references 1. For each LDAP attribute mapping, add a configuration for a "Pool LDAP DN" and "Pool LDAP attribute". 2. Also add an option specifying what to do with the data retrieved from the pool: * Use only (use the value, but don't change it) * Use and increment (Use the value, then increment it in LDAP afterwards) * Increment and use (Increment the value first, then use the incremented value) 3. Implement a method to refer to the pool value in the "write template" 4. Use raw LDAP to do the necessary reads/write during sync 5. In the frontend: These additional fields should not clutter the UI. Maybe use an Ausklappable of some sort.
Author
Owner

Please break that out into a separate issue (or is there a good reason that these issues are related?)

Please break that out into a separate issue (or is there a good reason that these issues are related?)
Member

Opened #53

Opened #53
Author
Owner

Use raw LDAP for the references

This is the way to go.

> Use raw LDAP for the references This is the way to go.
Member

assigned to @magicfelix and unassigned @nik

assigned to @magicfelix and unassigned @nik
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
aleksis/AlekSIS-App-LDAP#48
No description provided.