Refactor services unification krb5#607
Merged
Mastermind-U merged 37 commits intorefactor_services_unificationfrom Jul 21, 2025
Merged
Refactor services unification krb5#607Mastermind-U merged 37 commits intorefactor_services_unificationfrom
Mastermind-U merged 37 commits intorefactor_services_unificationfrom
Conversation
rimu-stack
reviewed
Jul 1, 2025
milov-dmitriy
approved these changes
Jul 3, 2025
Collaborator
milov-dmitriy
left a comment
There was a problem hiding this comment.
считаю, что все хорошо
я бы вливал этот рефакторинг. в будущем будет точно понятно в правильном направлении рефачим или нет, если что - снова порефачим
Mastermind-U
suggested changes
Jul 14, 2025
Contributor
Mastermind-U
left a comment
There was a problem hiding this comment.
Перенеси всё это из utils в ldap_protocol/kerberos/service
added 13 commits
July 16, 2025 13:41
… enhanced Kerberos management
…erberos_service modules
… KerberosService classes
…PStructureManager and streamline error handling in KerberosService
…o simplify error management in krb5_router
… for clarity in LDAPStructureManager and KerberosService
…atting in KerberosService
…return type description in KerberosService
…ed clarity and type safety in KerberosService
…vice to enhance clarity
…ters into a single KerberosAdminDnGroup object in KerberosService
Mastermind-U
suggested changes
Jul 17, 2025
added 2 commits
July 17, 2025 15:21
…esponse from kerberos_adapter, enhancing code clarity and reducing complexity
…eamingResponse and adjust imports for improved clarity and type safety
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR centralizes Kerberos logic into a dedicated service and adapter, refactors the FastAPI routes to delegate work through a KerberosFastAPIAdapter, and updates the application and test DI setup to register the new components.
- Introduce
KerberosServicewith supporting schemas, exceptions, LDAP structure manager, and Jinja2 template renderer - Add
KerberosFastAPIAdapterand refactorkrb5_router.pyto use the adapter instead of inline logic - Register
KerberosServiceand adapter in DI setup (ioc.py,tests/conftest.py) and add an exception handler forKerberosDependencyError
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 |
|---|---|
| tests/conftest.py | Register KerberosService and KerberosFastAPIAdapter in tests |
| app/multidirectory.py | Add exception handler for KerberosDependencyError |
| app/ldap_protocol/kerberos/template_render.py | New TemplateRenderer for krb5 and kdc conf rendering |
| app/ldap_protocol/kerberos/service.py | New KerberosService with domain logic |
| app/ldap_protocol/kerberos/schemas.py | New dataclasses for Kerberos contexts and requests |
| app/ldap_protocol/kerberos/ldap_structure.py | New LDAPStructureManager for creation/rollback |
| app/ldap_protocol/kerberos/exceptions.py | Define Kerberos-specific exceptions |
| app/ldap_protocol/identity/identity_manager.py | Update authenticate_user to use verify_password |
| app/ioc.py | Register Kerberos service and adapter providers |
| app/api/main/krb5_router.py | Refactor endpoints to delegate to KerberosFastAPIAdapter |
| app/api/main/adapters/kerberos.py | New FastAPI adapter wrapping KerberosService |
| app/api/exception_handlers.py | Add handle_kerberos_dependency_error handler |
…inability by removing unused schema import
added 7 commits
July 17, 2025 16:04
…atement in get_status method for improved clarity
…ter using a decorator to streamline exception management and improve code clarity
…apper return type in error handling decorator
…irectly returning aiter_bytes in StreamingResponse for improved clarity
…ncIterator for improved type safety and clarity
…ytes input by converting it to an AsyncGenerator for improved streaming response handling
…tor instead of AsyncGenerator for improved type consistency
… code clarity and maintainability
added 4 commits
July 21, 2025 15:02
- Shortened the docstring for the _sc method to match the concise style of other methods. - Now clearly states that Kerberos exceptions are converted to HTTPException. - Ensured consistency of docstring formatting across the adapter.
- Made the _sc method docstring concise and consistent with other methods. - Clearly states that Kerberos exceptions are converted to HTTPException.
- Removed dataclass version of KerberosSetupRequest and ensured only the Pydantic model is used. - Updated all imports and type annotations to reference the Pydantic model from api.main.schema. - Fixed import paths to use the correct relative imports for KerberosSetupRequest.
- Reformatted long function call to multiple lines in service.py to satisfy line length requirements.
Mastermind-U
approved these changes
Jul 21, 2025
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.
No description provided.