Skip to content

Fix: migrations downgrade config, mapping error, schema paginator not case sensitive#980

Merged
rimu-stack merged 4 commits intodevfrom
feature/1258_smfixes
Apr 10, 2026
Merged

Fix: migrations downgrade config, mapping error, schema paginator not case sensitive#980
rimu-stack merged 4 commits intodevfrom
feature/1258_smfixes

Conversation

@milov-dmitriy
Copy link
Copy Markdown
Collaborator

Часть правок связаны с задачей 1258

  • На downgrade для БД теперь отдельная команда, нужна для того, чтобы в Э можно было проверить лицензицию
  • Пагинатор обжектКлассов и атрибутТипов регистронезависимый + тесты на это
  • Добавил мапинг ошибки HTTP_401_UNAUTHORIZED для схемы
  • В legacy/attribute_type_dao исправил присвоение для свойства name

@milov-dmitriy milov-dmitriy self-assigned this Apr 9, 2026
@milov-dmitriy milov-dmitriy added bug Something isn't working python Pull requests that update Python code high priority ldap labels Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 17:59
Copy link
Copy Markdown
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 updates LDAP schema APIs and tooling to support database downgrades via the app CLI, improves schema list searching to be case-insensitive, extends error mapping for unauthorized access, and fixes a legacy attribute type DTO mapping.

Changes:

  • Add --downgrade REV CLI command (and update Makefile targets to use it) for database rollback.
  • Make schema paginator search case-insensitive for objectClasses and attributeTypes + add tests.
  • Map UnauthorizedError to HTTP 401 for the LDAP schema API; fix legacy attribute type name mapping.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/test_api/test_ldap_schema/test_object_class_router.py Adds test ensuring object class pagination search is case-insensitive.
tests/test_api/test_ldap_schema/test_attribute_type_router.py Adds test ensuring attribute type pagination search is case-insensitive.
Makefile Switches migration rerun commands to use the new app --downgrade flag.
app/multidirectory.py Adds --downgrade CLI option and routes it to Alembic downgrade.
app/ldap_protocol/ldap_schema/object_class/object_class_dao.py Changes paginator query filtering to use ilike for case-insensitive search.
app/ldap_protocol/ldap_schema/attribute_type/attribute_type_dao.py Changes paginator query filtering to use ilike for case-insensitive search.
app/ldap_protocol/ldap_schema/_legacy/attribute_type/attribute_type_dao.py Fixes legacy DTO conversion to set name from the model name.
app/api/ldap_schema/init.py Adds UnauthorizedError -> 401 mapping for schema routes.

Copy link
Copy Markdown
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

Copilot reviewed 11 out of 11 changed files in this pull request and generated 3 comments.

postgresql_using="hash",
),
Index("idx_Directory_name_hash", "name", postgresql_using="hash"),
Index("idx_Directory_name_gin_trgm", "name", postgresql_using="gin"),
"Directory",
[sa.literal_column("name gin_trgm_ops")],
unique=False,
postgresql_using="gin",
@rimu-stack rimu-stack merged commit b43e4c7 into dev Apr 10, 2026
10 checks passed
@rimu-stack rimu-stack deleted the feature/1258_smfixes branch April 10, 2026 14:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working high priority ldap python Pull requests that update Python code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants