Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR introduces server-side rejection of LDAP modify requests that attempt to change an entry’s RDN attribute, returning LDAP result code 67 (NOT_ALLOWED_ON_RDN).
Changes:
- Added an early check in
ModifyRequest.handle()to reject modifies that include the entry’srdnameattribute. - Added an LDAP CLI (
ldapmodify) test that asserts RDN modification is rejected with code 67. - Removed an API test that previously performed an RDN (
cn) modification.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| app/ldap_protocol/ldap_requests/modify.py | Adds RDN-modification rejection to the modify request handler. |
| tests/test_ldap/test_util/test_modify.py | Adds a new ldapmodify-based test for NOT_ALLOWED_ON_RDN. |
| tests/test_api/test_main/test_router/test_modify.py | Removes an API test that modified cn (RDN) via /entry/update. |
Comments suppressed due to low confidence (1)
tests/test_api/test_main/test_router/test_modify.py:295
- This PR removes an API-level test that exercised replacing the RDN attribute (
cn). Since the new behavior is to reject such modifies withNOT_ALLOWED_ON_RDN (67), it would be good to add/adjust an API test to assert the new result code for/entry/updatewhen attempting to modify the entry’s RDN attribute. Currently the new behavior is only covered vialdapmodifyCLI tests, leaving the API route untested for this regression.
@pytest.mark.asyncio
@pytest.mark.usefixtures("adding_test_user")
@pytest.mark.usefixtures("setup_session")
@pytest.mark.usefixtures("session")
async def test_api_modify_many(http_client: AsyncClient) -> None:
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rimu-stack
requested changes
Feb 11, 2026
e384c74 to
a71fe2e
Compare
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.
Задача: 1040
Теперь перед непосредственной обработкой modify запроса происходит проверка на изменение RDN. Если RDN пытаются изменить, то весь запрос реджектится, возвращается код 67(NOT ALLOWED ON RDN)
Сделано: