Skip to content

Add: AttributeType system_flags#926

Open
milov-dmitriy wants to merge 2 commits intodevfrom
add_attribute_type_system_flags_task_1160
Open

Add: AttributeType system_flags#926
milov-dmitriy wants to merge 2 commits intodevfrom
add_attribute_type_system_flags_task_1160

Conversation

@milov-dmitriy
Copy link
Collaborator

@milov-dmitriy milov-dmitriy commented Feb 5, 2026

Для задачи по геораспределению необходимо понимать, какие атрибуты реплицируемы, а какие нет.

Для каждого Типа атрибута добавлено свойство system_flags (aka systemFlags в AD см.доку):

  • добавлена миграция;
  • доработана соответствующие AttributeType: DTO, Schema и Entity;
  • для работы с system_flags у сущностей AttributeType добавлен отдельный UseCase.

Открытые вопросы:

  • Нужно ли определять AttributeTypeSystemFlagsUseCase в AttributeTypeUseCase ?
    p.s. На данный момент эта бизнес логика нигде не используется. Кажется, что это избыточная модификация.
  • ..UseCase для AttributeTypeSystemFlagsUseCase это подходящий выбор?
    p.s. Мне не нравится использование одного UseCase внутри другого UseCase. Как я думаю, в теории было бы правильно делать отдельный UseCase в котором была бы работа только с AttributeType и с AttributeType.system_flags.

Задача: 1160

@milov-dmitriy milov-dmitriy self-assigned this Feb 5, 2026
Copilot AI review requested due to automatic review settings February 5, 2026 11:37
@milov-dmitriy milov-dmitriy added python Pull requests that update Python code ldap labels Feb 5, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the system_flags attribute to AttributeType entities to enable identification of replicable vs non-replicable attributes for geo-distribution. The implementation follows the Active Directory systemFlags specification and includes a dedicated UseCase for managing system flags.

Changes:

  • Added system_flags integer field to AttributeType entities, DTOs, and schemas with a default value of 0
  • Created migration to add the column and populate non-replicated attributes based on AD specification
  • Implemented AttributeTypeSystemFlagsUseCase with methods to check and set replication flags
  • Added integration methods in AttributeTypeUseCase that delegate to the system flags use case

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/entities.py Added system_flags field to AttributeType entity with default value 0
app/ldap_protocol/ldap_schema/dto.py Added system_flags field to AttributeTypeDTO
app/api/ldap_schema/schema.py Added system_flags field to AttributeTypeSchema with default value 0
app/repo/pg/tables.py Added system_flags column to AttributeTypes table with server_default
app/ldap_protocol/ldap_schema/attribute_type_system_flags.py New file implementing IntFlag enum and UseCase for system flags operations
app/ldap_protocol/ldap_schema/attribute_type_use_case.py Added delegation methods for replication flag operations
app/api/ldap_schema/adapters/attribute_type.py Updated converter to handle system_flags in update operations
app/ldap_protocol/utils/raw_definition_parser.py Added system_flags=0 when creating AttributeType from raw definition
app/alembic/versions/2dadf40c026a_add_system_flags_to_attribute_types.py New migration adding system_flags column and populating non-replicated attributes
app/alembic/versions/275222846605_initial_ldap_schema.py Retroactively updated to include system_flags in initial schema and cleanup
app/ioc.py Added provider for AttributeTypeSystemFlagsUseCase
tests/conftest.py Refactored DAO providers to use shorthand syntax and added fixture for system flags use case
tests/test_api/test_ldap_schema/test_attribute_type_router.py Added test verifying system_flags can be set and retrieved via API

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ldap python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant