The keywords "MUST", "SHOULD", and "MAY" in this file are to be interpreted as described in RFC2119.
Project: Integration for bi-directional synchronization of data between OS2mo and LDAP / Active Directory.
The integration SHOULD be configured using environment variables (see mo_ldap_import_export/config.py for details).
What to synchronize MAY be configured using Jinja templates (envvar: CONVERSION_MAPPING).
- A change MAY happen in OS2mo.
- OS2mo SHOULD emit an event on its event system.
- FastRAMQPI SHOULD pick up the event and send a HTTP request to the integration.
- The integration SHOULD receive the HTTP request and SHOULD call
mo_to_ldap_handlerorhttp_process_*. - The handler SHOULD decide the desired state in LDAP (using configured Jinja templates).
- The handler SHOULD call
ldapapi.ensure_ldap_objectwith the desired state.
- A change MAY happen in LDAP.
- The
LDAPEventGeneratorSHOULD detect the event and emit it on OS2mo's event system. - FastRAMQPI SHOULD pick up the event and send a HTTP request to the integration.
- The integration SHOULD receive the HTTP request and SHOULD call
http_process_uuid. - The handler SHOULD decide the desired state in MO (using configured Jinja templates).
- The handler SHOULD call functions on
MOAPIwith the desired state.
This project uses docker compose for the development environment.
The development stack MAY be started using docker compose up --build --detach
- Tests MUST be run using:
docker compose exec mo_ldap_import_export pytest .... - Tests MUST NOT be run outside the docker container.
- Test-targeting MUST be used as the entire test-suite MUST NOT be run at once.
Example:
docker compose exec mo_ldap_import_export pytest tests/integration/test_employee.py
- Tests SHOULD be added for new functionality.
- Integration-tests SHOULD be preferred over unit-tests.
- Unit-tests SHOULD only be written for pure functions.
- Mocks SHOULD be avoided.
- Unit-tests MAY be eliminated in favor of integration-tests.
- Pythonic list comprehensions and generators SHOULD be used instead of
map/filter. - Use
one,onlyorfirstfrommore_itertoolsinstead of[0].
pre-commit run --all-filesSHOULD pass before committing.- Commits SHOULD adhere to the conventional commits style.
- Commit title SHOULD include a ticket number:
fix(ldap2mo): [#12345] ensure dry-run termination works. - Branch names SHOULD include a ticket number:
fix_12345_ensure_dry_run_termination - Branches SHOULD be rebased instead of merged.
autogenerated_graphql_clientMUST NOT be edited manually.autogenerated_graphql_clientMAY be updated usingpoetry run tools/regen_client.shifqueries/*has changed.