Conversation
added 4 commits
March 2, 2026 12:21
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors LDAP-protocol “schema” usage by moving view-layer models into the api package and introducing DTOs where appropriate, updating imports across API, services, and tests.
Changes:
- Updated API routers/adapters and tests to import request/response schemas from
api.*.schemasinstead ofldap_protocol.*.schemas. - Split DHCP Kea API request dataclasses out of
ldap_protocol.dhcp.schemasinto a newldap_protocol.dhcp.dtosmodule and updated call sites. - Migrated some LDAP-protocol response models from
dataclasstopydantic.BaseModeland introduced new DTOs (e.g.,OAuth2FormDTO).
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/test_api/test_dhcp/test_adapter.py | Switches DHCP schema imports to api.dhcp.schemas for tests. |
| tests/test_api/test_audit/test_router.py | Switches audit schema imports to api.audit.schemas for tests. |
| interface | Updates subproject commit pointer. |
| app/ldap_protocol/policies/audit/schemas.py | Converts audit response models from dataclasses to Pydantic models and updates module docstring. |
| app/ldap_protocol/policies/audit/monitor.py | Replaces OAuth2 form type dependency with a new DTO. |
| app/ldap_protocol/policies/audit/dataclasses.py | Adds OAuth2FormDTO dataclass. |
| app/ldap_protocol/kerberos/template_render.py | Switches render context import/type to KDCContextDTO from a dtos module. |
| app/ldap_protocol/kerberos/service.py | Switches multiple types/imports to *DTO classes from a dtos module. |
| app/ldap_protocol/kerberos/schemas.py | Renames kerberos dataclasses to *DTO variants. |
| app/ldap_protocol/dhcp/schemas.py | Removes Kea DHCP API request dataclasses from schemas module; keeps Pydantic request models. |
| app/ldap_protocol/dhcp/retorts.py | Points retorts at new DHCP DTO module. |
| app/ldap_protocol/dhcp/kea_dhcp_repository.py | Updates repository to use DTOs for Kea API request payloads. |
| app/ldap_protocol/dhcp/dtos.py | New module containing Kea DHCP API request dataclasses. |
| app/ldap_protocol/dhcp/init.py | Stops re-exporting DHCP schemas from ldap_protocol.dhcp. |
| app/ldap_protocol/auth/schemas.py | Renames/reshapes auth response model(s) and removes session content schema. |
| app/ldap_protocol/auth/mfa_manager.py | Uses MFA schemas from api.auth.schemas instead of LDAP protocol schemas. |
| app/ldap_protocol/auth/auth_manager.py | Uses LoginResponse / OAuth2Form from api.auth.schemas and updates return structure. |
| app/api/dhcp/router.py | Uses DHCP schemas from api.dhcp.schemas in API layer. |
| app/api/dhcp/adapter.py | Uses DHCP schemas from api.dhcp.schemas in adapter. |
| app/api/auth/router_mfa.py | Uses MFA schemas from api.auth.schemas in API layer. |
| app/api/auth/router_auth.py | Uses auth schemas from api.auth.schemas in API layer. |
| app/api/auth/adapters/mfa.py | Uses MFA schemas from api.auth.schemas in adapter. |
| app/api/auth/adapters/auth.py | Uses auth schemas from api.auth.schemas in adapter. |
| app/api/audit/router.py | Uses audit schemas from api.audit.schemas in API layer. |
| app/api/audit/adapter.py | Uses audit schemas from api.audit.schemas in adapter and removes a type: ignore. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
milov-dmitriy
requested changes
Mar 2, 2026
…ve response handling
milov-dmitriy
approved these changes
Mar 2, 2026
Naksen
requested changes
Mar 2, 2026
Naksen
approved these changes
Mar 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Задача: https://tracker.yandex.ru/MULTIDIRECTORY-916
Перенес все модели, относящиеся к слою отображения, в api
p.s. Осталось только в ldap запросах, т.к. под них нет адаптеров и т.д.