Commit Graph

49 Commits

Author SHA1 Message Date
1b48675b92 [0.9.7] - 2025-08-18
Some checks failed
Deploy on push / deploy (push) Failing after 2m22s
### 🔄 Изменения
- **SQLAlchemy KeyError** - исправление ошибки `KeyError: Reaction` при инициализации
- **Исправлена ошибка SQLAlchemy**: Устранена проблема `InvalidRequestError: When initializing mapper Mapper[Shout(shout)], expression Reaction failed to locate a name (Reaction)`

### 🧪 Тестирование
- **Исправление тестов** - адаптация к новой структуре моделей
- **RBAC инициализация** - добавление `rbac.initialize_rbac()` в `conftest.py`
- **Создан тест для getSession**: Добавлен комплексный тест `test_getSession_cookies.py` с проверкой всех сценариев
- **Покрытие edge cases**: Тесты проверяют работу с валидными/невалидными токенами, отсутствующими пользователями
- **Мокирование зависимостей**: Использование unittest.mock для изоляции тестируемого кода

### 🔧 Рефакторинг
- **Упрощена архитектура**: Убраны сложные конструкции с отложенными импортами, заменены на чистую архитектуру
- **Перемещение моделей** - `Author` и связанные модели перенесены в `orm/author.py`: Вынесены базовые модели пользователей (`Author`, `AuthorFollower`, `AuthorBookmark`, `AuthorRating`) из `orm.author` в отдельный модуль
- **Устранены циклические импорты**: Разорван цикл между `auth.core` → `orm.community` → `orm.author` через реструктуризацию архитектуры
- **Создан модуль `utils/password.py`**: Класс `Password` вынесен в utils для избежания циклических зависимостей
- **Оптимизированы импорты моделей**: Убран прямой импорт `Shout` из `orm/community.py`, заменен на строковые ссылки

### 🔧 Авторизация с cookies
- **getSession теперь работает с cookies**: Мутация `getSession` теперь может получать токен из httpOnly cookies даже без заголовка Authorization
- **Убрано требование авторизации**: `getSession` больше не требует декоратор `@login_required`, работает автономно
- **Поддержка dual-авторизации**: Токен может быть получен как из заголовка Authorization, так и из cookie `session_token`
- **Автоматическая установка cookies**: Middleware автоматически устанавливает httpOnly cookies при успешном `getSession`
- **Обновлена GraphQL схема**: `SessionInfo` теперь содержит поля `success`, `error` и опциональные `token`, `author`
- **Единообразная обработка токенов**: Все модули теперь используют централизованные функции для работы с токенами
- **Улучшена обработка ошибок**: Добавлена детальная валидация токенов и пользователей в `getSession`
- **Логирование операций**: Добавлены подробные логи для отслеживания процесса авторизации

### 📝 Документация
- **Обновлена схема GraphQL**: `SessionInfo` тип теперь соответствует новому формату ответа
- Обновлена документация RBAC
- Обновлена документация авторизации с cookies
2025-08-18 14:25:25 +03:00
9a2b792f08 refactored
Some checks failed
Deploy on push / deploy (push) Failing after 6s
2025-08-17 17:56:31 +03:00
e78e12eeee circular-fix
Some checks failed
Deploy on push / deploy (push) Failing after 17s
2025-08-17 16:33:54 +03:00
809bda2b56 search-fix, devstart-fix, cache-fix, logs-less
Some checks failed
Deploy on push / deploy (push) Failing after 5s
2025-07-31 19:13:23 +03:00
e7230ba63c tests-passed 2025-07-31 18:55:59 +03:00
952b294345 0.5.8-panel-upgrade-community-crud-fix
All checks were successful
Deploy on push / deploy (push) Successful in 6s
2025-06-30 21:25:26 +03:00
3327976586 Improve topic sorting: add popular sorting by publications and authors count 2025-06-02 02:56:11 +03:00
90260534eb sigil-on
All checks were successful
Deploy on push / deploy (push) Successful in 6s
2025-05-30 14:08:29 +03:00
f8ad73571c author-followers-fix 2025-05-30 13:48:02 +03:00
d917d63bf2 distinct-fix 2025-05-30 08:51:24 +03:00
e375db4125 author_id-fix
All checks were successful
Deploy on push / deploy (push) Successful in 6s
2025-05-29 18:56:55 +03:00
d4c16658bd author-user-fix
All checks were successful
Deploy on push / deploy (push) Successful in 6s
2025-05-29 12:15:06 +03:00
ab39b534fe auth fixes, search connected 2025-05-22 04:34:30 +03:00
5874d3ccae create_draft fix 2025-05-21 18:29:46 +03:00
d3a760b6ba auth-wip 2025-05-21 01:34:02 +03:00
2d382be794 upgrade schema, resolvers, panel added 2025-05-16 09:23:48 +03:00
f20000f1f6 topic.stat.authors-fix2
All checks were successful
Deploy on push / deploy (push) Successful in 45s
2025-04-10 18:46:09 +03:00
7d50638b3a topic.stat.authors-fix
All checks were successful
Deploy on push / deploy (push) Successful in 1m20s
2025-04-10 18:39:31 +03:00
615f1fe468 topics+authors-reimplemented-cache
All checks were successful
Deploy on push / deploy (push) Successful in 5s
2025-03-22 11:47:19 +03:00
e1a1b4dc7d fx
All checks were successful
Deploy on push / deploy (push) Successful in 44s
2025-03-20 12:25:18 +03:00
ca01181f37 jsonfix
All checks were successful
Deploy on push / deploy (push) Successful in 44s
2025-03-20 12:24:30 +03:00
247fc98760 cachedep-fix+orjson+fmt
All checks were successful
Deploy on push / deploy (push) Successful in 1m16s
2025-03-20 11:55:21 +03:00
37a9a284ef 0.4.9-drafts 2025-02-09 17:18:01 +03:00
dce05342df fmt
All checks were successful
Deploy on push / deploy (push) Successful in 58s
2025-02-04 15:27:59 +03:00
56db33d7f1 get_my_rates_comments-fix
All checks were successful
Deploy on push / deploy (push) Successful in 55s
2025-02-04 02:53:01 +03:00
40b4703b1a get_cached_topic_followers-fix
All checks were successful
Deploy on push / deploy (push) Successful in 55s
2025-02-04 01:40:00 +03:00
5acae03c55 fmt 2025-01-21 10:09:28 +03:00
ae7580252b invcache-fix6 2025-01-16 06:49:15 +03:00
7c85f51436 invcache-fix5 2025-01-16 06:42:12 +03:00
83ec475cc8 invcache-fix4 2025-01-16 06:01:47 +03:00
c1c095a73c invcache-fix3 2025-01-16 06:00:15 +03:00
c4e84364c6 invcache-fix 2025-01-16 05:53:37 +03:00
8287b82554 invalidate-cache-fix 2025-01-16 05:46:31 +03:00
56fe8bebbe invalidate-cache-fix 2025-01-16 05:45:53 +03:00
4fffd1025f debug-update-shout-2 2025-01-16 05:42:53 +03:00
5095b0b4c0 get-with-stat-as-arg
All checks were successful
Deploy on push / deploy (push) Successful in 1m11s
2024-08-14 18:33:11 +03:00
4c126fd859 cache-author-fiz 2024-08-14 16:30:52 +03:00
c5ee827230 merged
Some checks failed
Deploy on push / deploy (push) Failing after 11s
2024-08-12 11:00:01 +03:00
208de158bc imports sort
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-09 09:37:06 +03:00
56f1506450 followers-ids-fix
Some checks failed
Deploy on push / deploy (push) Failing after 10s
2024-08-09 07:35:45 +03:00
fae5f6f735 get-objects
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-09 07:26:04 +03:00
983f25d6d3 debug-followers
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-09 07:22:55 +03:00
1c9f6f30d9 debug:get_cached_topic_followers
Some checks failed
Deploy on push / deploy (push) Failing after 10s
2024-08-09 07:14:33 +03:00
13acff1708 get_cached_topic_followers-fix
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-08 18:00:50 +03:00
69a848d6a7 redis-fix 2024-08-08 17:54:15 +03:00
e4266b0bab get_cached_topic_by_slug-fix
Some checks failed
Deploy on push / deploy (push) Failing after 11s
2024-08-08 17:46:25 +03:00
1af63dee81 shout-stats-fix
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-07 10:22:37 +03:00
d4982017f6 refactored-starting
Some checks failed
Deploy on push / deploy (push) Failing after 9s
2024-08-07 09:51:09 +03:00
60a56fd098 moved 2024-08-07 08:57:56 +03:00