Open
Conversation
added 5 commits
February 9, 2026 12:09
… related API endpoints to utilize these schemas for better data handling and validation.
…ests, update API endpoints to accept parameters directly for improved clarity and simplicity.
…ary line breaks for improved readability.
…API interactions - Introduced new request models: AddPrincipalRequest, KtaddRequest, and ModifyPrincipalRequest for better structure and validation. - Updated API endpoints to use the new request models, ensuring correct JSON structure for principal creation and keytab addition. - Enhanced error handling and logging for keytab operations. - Refactored existing methods to accommodate new parameters for encryption algorithms and random key generation.
…o improve parameter handling and request structure - Modified the API endpoints for adding and renaming principals to align with new request models. - Adjusted assertions in tests to reflect changes in the expected arguments for kadmin methods. - Enhanced clarity by consolidating parameters in API requests.
2d19d1a to
77d0720
Compare
…g unnecessary None return
Naksen
requested changes
Feb 9, 2026
| dependencies=[Depends(verify_auth), Depends(require_master_db)], | ||
| error_map=error_map, | ||
| ) | ||
| async def rename_principal( |
| principal_new_name: str, | ||
| ) -> None: | ||
| """Rename principal in Kerberos. | ||
| async def rename_principal(self, request: PrincipalPutRequest) -> None: |
|
|
||
| @abstractmethod | ||
| async def rename_princ(self, name: str, new_name: str) -> None: ... | ||
| async def rename_princ( |
|
|
||
| @logger_wraps() | ||
| async def rename_princ(self, name: str, new_name: str) -> None: | ||
| async def rename_princ( |
|
|
||
| else: | ||
| if not is_stub: | ||
| logger.success(f"Executed {name}") |
| async def modify_principal( | ||
| self, | ||
| principal_name: str, | ||
| new_principal_name: str | None = None, |
Collaborator
There was a problem hiding this comment.
Put запрос с full modify разве нет ? почему изменения опциональны ?
| """Request model for modifying principal.""" | ||
|
|
||
| principal_name: str | ||
| new_principal_name: str | None = Field(default=None) |
Collaborator
There was a problem hiding this comment.
схем отличается от той, что в клиенте
| ) | ||
|
|
||
| if password is not None: | ||
| if password == "": |
Collaborator
There was a problem hiding this comment.
Зачем пересоздавать принципал, если передан пустой пароль ?
| :param Annotated[AbstractKRBManager, Depends kadmin: kadmin abstract | ||
| :param Annotated[str, Body name: principal name | ||
| :param Annotated[str, Body password: principal password | ||
| <<<<<<< Updated upstream |
Collaborator
There was a problem hiding this comment.
Чет не понял. А ручка reset_principal_pw остается ? Почему теперь две ручки могут изменить пароль принципалу ?
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.
Добавление функционала в работу с kadmin_api
в ktadd был добавлен атрибут is_rand_key
изменил создание принципала и модификацию. теперь это post и put соответственно по урлу /principal
в kadmind добавленпа обработка algorithms