Skip to content

sqladmin админка#251

Merged
petrCher merged 18 commits into
mainfrom
petr-sqladmin
Jul 6, 2026
Merged

sqladmin админка#251
petrCher merged 18 commits into
mainfrom
petr-sqladmin

Conversation

@petrCher

@petrCher petrCher commented May 9, 2026

Copy link
Copy Markdown
Member

Изменения

Добавлена sqladmin-админка для управления скоупами, группами и пользователями(только работа с группами для пользователей)

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

Для аутентификации в админке используется AdminAuth с логином и паролем из .env (ADMIN_LOGIN, ADMIN_PASSWORD, ADMIN_SECRET_KEY).
Логика изменения групп у пользователя и CRUD-операций над группами вынесена в отдельные функции (patch_user_groups, create_group_logic, patch_group_logic, delete_group_id, create_scope_logic) и используется как эндпоинтах, так и в админке.
Для работы с soft delete переопределены методы update_model, delete_model, insert_model.
Удалённые записи скрыты из списков через list_query и count_query, а из форм — через FilteredModelConverter.

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

Code Coverage

Coverage Report
FileStmtsMissCoverMissing
auth_backend
   __main__.py330%1–5
   base.py12467%6–9
   exceptions.py45687%32, 50–52, 57, 78
auth_backend/admin
   admin.py933661%32, 35, 38–42, 45–49, 52–54, 78, 81, 84–89, 92–100, 103–104, 127, 130, 133–136
   auth.py412929%15–25, 28–32, 35–36, 40–50
   filter.py171135%13–24
auth_backend/auth_method
   base.py63494%52, 54, 61, 143
   method_mixins.py32294%27, 50
   oauth.py561770%38, 44, 49–54, 58–69, 95–100
   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.py1035448%58–85, 100–118, 131, 139, 147–167, 172–186
   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.py152895%47, 56, 60, 121, 215, 224, 228, 241
   dynamic_settings.py27774%24–31
auth_backend/routes
   base.py37295%25–26
   exc_handlers.py43686%31, 56, 69, 95, 117, 125
   groups.py92397%82, 149, 151
   oidc.py34197%94
   scopes.py39392%17, 56–57
   user.py972772%53, 55, 57–66, 72–78, 90–110, 163, 173
   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
TOTAL3300110267% 

Summary

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

@github-actions

github-actions Bot commented May 9, 2026

Copy link
Copy Markdown

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

@petrCher petrCher linked an issue May 10, 2026 that may be closed by this pull request
@petrCher

Copy link
Copy Markdown
Member Author
Снимок экрана 2026-05-11 в 00 12 13 Снимок экрана 2026-05-11 в 00 12 27 Снимок экрана 2026-05-11 в 00 12 21

@petrCher

Copy link
Copy Markdown
Member Author

выше скрины как выглядит админка

@petrCher petrCher requested a review from Temmmmmo May 10, 2026 21:24
@petrCher petrCher self-assigned this May 10, 2026
Comment thread auth_backend/routes/groups.py
Comment thread auth_backend/admin/auth.py Outdated
Comment thread auth_backend/admin/filter.py
Comment thread auth_backend/settings.py Outdated
Comment thread auth_backend/admin/filter.py
Comment thread .github/workflows/checks.yml
Comment thread auth_backend/admin/admin.py Outdated
Comment thread requirements.dev.txt
@morozov-tech morozov-tech requested a review from Zimovchik May 11, 2026 10:15
@petrCher petrCher added the new feature 🆕 Новая фича или запрос на нее label May 11, 2026
@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@github-actions

Copy link
Copy Markdown

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

@petrCher petrCher requested a review from morozov-tech May 11, 2026 20:54
Comment thread auth_backend/admin/auth.py
@petrCher petrCher requested review from Temmmmmo and removed request for Temmmmmo May 14, 2026 18:29
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

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

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown

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

@petrCher petrCher dismissed morozov-tech’s stale review July 6, 2026 06:32

was already approved

@petrCher petrCher merged commit a7c8a1a into main Jul 6, 2026
2 checks passed
@petrCher petrCher deleted the petr-sqladmin branch July 6, 2026 06:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new feature 🆕 Новая фича или запрос на нее

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Сделать sqladmin админку выдачи скоупов

3 participants