Add: AttributeType ldap_display_name#974
Add: AttributeType ldap_display_name#974milov-dmitriy wants to merge 5 commits intofeature/1258_ldap_schema_move_from_models_to_directoriesfrom
Conversation
There was a problem hiding this comment.
Pull request overview
PR adds support for the LDAP schema attribute type field ldap_display_name (mapped to LDAP lDAPDisplayName) and updates DTOs/API schemas, persistence, parsers, and tests accordingly.
Changes:
- Added
ldap_display_nametoAttributeTypeDTO/AttributeTypeSchemaand propagated it through API and LDAP schema layers. - Persisted
lDAPDisplayNamewhen creating attribute types; derived a default display name fromnamein some creation/parsing paths. - Updated API/LDAP tests and initial schema bootstrap to include the new field.
Reviewed changes
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_ldap/test_ldap_schema/test_attribute_type_system_flags_use_case.py | Updates AttributeTypeDTO construction in tests to include ldap_display_name. |
| tests/test_api/test_ldap_schema/test_object_class_router_datasets.py | Adds ldap_display_name to expected attribute type payloads in datasets. |
| tests/test_api/test_ldap_schema/test_entity_type_router.py | Updates attribute type API schema instances to include ldap_display_name. |
| tests/test_api/test_ldap_schema/test_attribute_type_router_datasets.py | Updates attribute type datasets to include ldap_display_name. |
| tests/test_api/test_ldap_schema/test_attribute_type_router.py | Updates API tests for create/modify payloads to include ldap_display_name. |
| tests/conftest.py | Updates test bootstrap attribute types to include ldap_display_name. |
| app/ldap_protocol/ldap_schema/raw_definition_parser.py | Derives ldap_display_name when building DTOs from raw schema definitions. |
| app/ldap_protocol/ldap_schema/dto.py | Adds ldap_display_name to AttributeTypeDTO. |
| app/ldap_protocol/ldap_schema/attribute_type/constants.py | Introduces constant for LDAP attribute name lDAPDisplayName. |
| app/ldap_protocol/ldap_schema/attribute_type/attribute_type_use_case.py | Writes lDAPDisplayName on create; derives it if missing/empty. |
| app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py | Reads lDAPDisplayName from directory attributes into DTO. |
| app/ldap_protocol/ldap_schema/_legacy/object_class/object_class_dao.py | Adds linking for ldap_display_name in legacy object class conversion. |
| app/ldap_protocol/ldap_schema/_legacy/attribute_type/attribute_type_dao.py | Ensures legacy AttributeType conversion populates ldap_display_name. |
| app/api/ldap_schema/schema.py | Adds required ldap_display_name to API schema model. |
| app/api/ldap_schema/adapters/object_class.py | Adds (commented-out) converter recipe code related to ldap_display_name. |
| app/api/ldap_schema/adapters/attribute_type.py | Supplies placeholder ldap_display_name in update-schema-to-DTO conversion. |
| app/alembic/versions/275222846605_initial_ldap_schema.py | Populates ldap_display_name for a couple of bootstrapped attribute types. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated 5 comments.
Comments suppressed due to low confidence (1)
app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py:1
- This will raise a
KeyError(orIndexError) for any existing AttributeType entries that don’t yet havelDAPDisplayNamepersisted. Since this PR introduces a new attribute, it’s likely there is pre-existing data without that key. Consider a safe fallback (e.g., derive fromdirectory.namewhen missing) and/or add a data migration/backfill to ensure the attribute exists on all stored AttributeTypes before this code runs.
"""Attribute Type DAO.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 19 out of 19 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
app/ldap_protocol/ldap_schema/_legacy/attribute_type/attribute_type_dao.py
Show resolved
Hide resolved
| "attribute_type_schema": AttributeTypeSchema( | ||
| oid="1.2.3.4", | ||
| name="testAttributeType0", | ||
| ldap_display_name="testAttributeType0", |
There was a problem hiding this comment.
в схеме по-моему вообще не нужен ldap_display_name, он же автоматом в name проставляется
Добавил поле
ldap_display_nameк Типам Атрибутов