Skip to content

Conversation

@ValeryEstal
Copy link

Удаление юзердаты при отвязке метода входа

Изменения

Детали реализации

Check-List

  • Вы проверили свой код перед отправкой запроса?
  • Вы написали тесты к реализованным функциям?
  • Вы не забыли применить форматирование black и isort для Back-End или Prettier для Front-End?

Удаление юзердаты при отвязке метода входа
@ValeryEstal ValeryEstal requested a review from DaymasS March 1, 2025 16:40
@github-actions
Copy link

github-actions bot commented Mar 1, 2025

Code Coverage

Coverage Report
FileStmtsMissCoverMissing
auth_backend
   __main__.py330%1–5
   base.py12467%6–9
   exceptions.py45687%32, 50–52, 57, 78
auth_backend/auth_method
   base.py63494%52, 54, 61, 143
   method_mixins.py32294%27, 50
   oauth.py571868%38, 44, 49–55, 59–70, 96–101
   outer.py1142975%27, 34, 41, 48, 99, 105, 114, 168–173, 186–194, 206–212
   userdata_mixin.py19574%32, 37–40
auth_backend/auth_plugins
   airflow.py331652%26–37, 42–65
   authentic.py19010346%53–65, 70–83, 87–102, 106–112, 116–122, 129–131, 141–197, 204–254, 259, 264–265, 275–282, 311–317, 326, 331–341, 346–359
   coder.py321650%25–34, 39–52
   email.py2551495%91, 248, 333, 335, 340, 351–357, 404, 445, 496, 506
   github.py1046339%57–116, 130–174, 184, 189, 195–207
   google.py1126443%65–124, 138–166, 176, 182–186, 190–195, 199–208
   keycloak.py1046240%53–115, 125–175, 185, 190, 196–201
   lkmsu.py16411232%60–113, 131–169, 179–201, 206, 211, 217–227, 231–245, 249–278, 282–291
   mailu.py341847%25–34, 39–54
   postgres.py432053%29–35, 40–46, 51–63
   telegram.py1116145%56–90, 105–123, 133, 139, 149–169, 173–187
   vk.py1288236%71–123, 137–175, 185, 190, 196–213, 220–246
   yandex.py1278335%58–128, 141–179, 190, 196, 202–228
auth_backend/cli
   group.py13130%1–17
   process.py56560%1–72
   scope.py11110%1–20
   user.py20200%1–40
   user_group.py12120%1–25
auth_backend/kafka
   kafka.py502060%30–33, 42–44, 56–59, 72–82, 85, 93, 103
   kafkameta.py9278%8, 12
auth_backend/models
   base.py83594%79, 100–102, 106
   db.py146597%53, 57, 215, 219, 232
   dynamic_settings.py27774%24–31
auth_backend/routes
   base.py28293%21–22
   exc_handlers.py43686%31, 56, 69, 95, 117, 125
   groups.py84396%85, 135, 137
   oidc.py34197%94
   scopes.py36392%24, 53–54
   user.py942771%54, 56, 58–67, 73–79, 91–111, 162, 179
   user_session.py84693%80–89, 119, 121, 182, 189
auth_backend/schemas
   models.py100397%150–152
auth_backend/schemas/types
   scopes.py24675%30–32, 37, 40, 42
auth_backend/utils
   jwt.py57788%35–42
   oidc_token.py37878%26, 39–43, 48, 74
   security.py46296%41, 66
   smtp.py771877%76–79, 101–120
   string.py7186%12
   user_session_control.py41295%33, 41
TOTAL3126103167% 

Summary

Tests Skipped Failures Errors Time
72 6 💤 0 ❌ 0 🔥 12.618s ⏱️

@ValeryEstal
Copy link
Author

Внесены изменения в auth_backend/auth_method/oauth.py
Строка 53

@ValeryEstal ValeryEstal requested a review from Zimovchik March 28, 2025 11:04
Copy link
Member

@Temmmmmo Temmmmmo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

тестируй пж, что пишешь)

new_user = {"user_id": user_session.user.id}
old_user_params = await cls._delete_auth_methods(user_session.user, db_session=db.session)
old_user[cls.get_name()] = old_user_params
await cls._delete_userdata(user=user_session.user, db_session=db.session)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

мне вот очень интересно
а откуда ты взяла этот метод???)00)))

image его нет в проекте

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавила новый метод класса, проверь пожалуйста, насколько это корректно

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@classmethod
async def _delete_userdata(cls, user: User, *, db_session: DbSession) -> None:
    """Удаление  данных пользователя
    
    Args:
        user (User): Объект пользователя
        db_session (DbSession): Сессия базы данных
    Returns: 
        Ничего? 
    """
    raise NotImplementedError()

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Добавила @AbstractMethod после @classmethod

@github-actions
Copy link

github-actions bot commented Apr 6, 2025

💩 Code linting failed, use black and isort to fix it.

@ValeryEstal
Copy link
Author

Импортировала класс User в userdata_mixin.py, но все равно тесты не видят User

@petrCher petrCher closed this Oct 3, 2025
@petrCher petrCher deleted the Delete_user_data_unlinking_login_method branch October 3, 2025 14:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Удалять юзердату при отвязке метода входа

4 participants