Skip to content

Conversation

@petrCher
Copy link
Member

@petrCher petrCher commented Aug 29, 2025

Изменения

При отвязке метода входа отправляется запрос в кафку, который потом обрабатывается в userdata-api

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

Для отвязки метода входа передаю значение value=None в кафку, также исправил ошибку, исправив request_user.id != user_id на request_user.user_id != user_id (исходя из структуры реквест юзера).

Check-List

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

@profcomff profcomff deleted a comment from github-actions bot Sep 6, 2025
Comment on lines -168 to +171
if cls.get_scope() not in (s.name for s in request_user.scopes) and request_user.id != user_id:
if cls.get_scope() not in (s.name for s in request_user.scopes) and request_user.user_id != user_id:
Copy link
Member

Choose a reason for hiding this comment

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

а ты проверял, что там реально так нужно? странно что не просто id

Copy link
Member Author

Choose a reason for hiding this comment

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

да, там в структуре у request_user поле id это просто обычный айдишник, который ничего не значит, а user_id отдельное поле связанное с таблицей юзера. Плюс я это протестил и работает только мой вариант

@petrCher petrCher requested a review from Zimovchik September 13, 2025 21:16
@profcomff profcomff deleted a comment from github-actions bot Oct 11, 2025
@petrCher petrCher removed the request for review from Zimovchik October 11, 2025 10:01
@github-actions
Copy link

github-actions bot commented Oct 13, 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.py632167%41, 47, 56–70, 74–85, 111–116
   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.py16811631%60–113, 131–169, 183–214, 219, 224, 230–240, 244–258, 262–291, 295–304
   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
TOTAL3135103867% 

Summary

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

@petrCher
Copy link
Member Author

Снимок экрана 2025-10-13 в 17 14 53 проверял работоспособность через гитхаб. Если что то я создал app oauth в гитхабе для тестов, так что все проверено честно)

@petrCher petrCher requested a review from Zimovchik October 13, 2025 15:00
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.

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

3 participants