Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication for movies #3

Merged
merged 4 commits into from
Mar 16, 2024
Merged

Authentication for movies #3

merged 4 commits into from
Mar 16, 2024

Conversation

Ezereul
Copy link
Owner

@Ezereul Ezereul commented Mar 16, 2024

В сервис выдачи контента добавлена внешняя аутентификация

Ezereul added 4 commits March 15, 2024 15:49
# Conflicts:
#	auth/.dockerignore
#	auth/src/core/logger.py
#	auth/src/main.py
#	movies_api/src/core/api_settings.py
@Ezereul Ezereul requested a review from LuchnikKek March 16, 2024 09:13
Copy link
Collaborator

@LuchnikKek LuchnikKek left a comment

Choose a reason for hiding this comment

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

Супер. Использование __call__() у класса JWTBearer - это прямо FastAPI-style.

@Ezereul Ezereul merged commit f2e8368 into dev Mar 16, 2024
@Ezereul Ezereul deleted the feature/movies-auth branch March 16, 2024 14:08
Ezereul added a commit that referenced this pull request Mar 17, 2024
* base structure

* copy ETL dir

* copy configs dir

* poetry dependencies

* remove requirements.txt

* rate limit added

* imports fix

* second redis db for rate limit

* another redis db for rate limit

* path for correct alembic work with imports

* delete debug prints

* exception -> authjwtexception

* basic docker-compose.yml
still not ready and not working, just stash commit

* basic `.env` variables renaming
WIP, just stash commit

* just trying to apply changes from `dev` branch to `feature/docker-compose`.
hope I did not broke anything...

* small .gitignore addition

* Dockerfile for movies_admin

* `entrypoint.sh` to create superuser
`uwsgi.ini` with uwsgi config

* docker-compose.yml rename services

* successful starts (no static)
uwsgi changed to pyuwsgi, cause [uwsgi has no binary scripts for pip wheel](unbit/uwsgi#1218)

* movies_admin with static

* Dockerfile optimized
demo site.conf for multiple services

* ETL starts and works

* Movies API configured and works

* Auth API configured and works
The last broken thing is - Auth API requests works only by 8000 port. Directly from 0.0.0.0:80 Nginx sends errors.
Also did not start tests yet.

* Auth API is set up and works

* Fixed path for tests

* Fixed broken auth service
now docker-compose.yml works perfectly (but tests not)

* Tests for movies
Add `make tests_movies` to run Movies tests.
Fix broken imports in persons tests.

* Auth fixes
tests/ dir now added to image

* Auth routers fix

* Authentication for movies  (#3)

* authentication for movies_api

* imports in auth api

* env path

* Login history partition (#4)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* Yandex OAuth (#5)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* модель для социального аккаунта, эндпоинт для аутентификации через стороннее приложение

* - сохранение в истории входов при аутентификации через яндекс
- отлаженная аутентификация через яндекс

* linters

* movies_api linters

* метод для создания SocialAccount

* Django admin authorization connected to FastAPI (#6)

* Add User model
Fix migrations was not applied
Error was caused by `dump.sql`, which also contains info about migrations.
Update Filmwork and Genre models to allow store None on some fields which is None on dataset.
Admin still not starts. WIP.

* Errors fix
Backend again starts but not synchronized

* Data migration with superuser WIP
Cannot find where users stored

* Superuser data migration refactoring
Fix error with User schema

* Authentication backend on the home straight
Remains to change raw sql data to be consistent with new User model

* Admin django-backend finally connected to FastAPI
Fix migrations
Fix stuff->staff typo
Small refactoring (not enough, but little is better than nothing)

* rename migration 4->5
remove unused constants

* Setup tracing (#7)

* quick fix:
rename migration file to match ascending order
change cut uuid to username in admin panel

* add Open Telemetry to project
fix OIDC env_prefix

* setup simple tracing

* quickfix

* readme

---------

Co-authored-by: LuchnikKek <[email protected]>
LuchnikKek added a commit that referenced this pull request Mar 17, 2024
* base structure

* copy ETL dir

* copy configs dir

* poetry dependencies

* remove requirements.txt

* rate limit added

* imports fix

* second redis db for rate limit

* another redis db for rate limit

* path for correct alembic work with imports

* delete debug prints

* exception -> authjwtexception

* basic docker-compose.yml
still not ready and not working, just stash commit

* basic `.env` variables renaming
WIP, just stash commit

* just trying to apply changes from `dev` branch to `feature/docker-compose`.
hope I did not broke anything...

* small .gitignore addition

* Dockerfile for movies_admin

* `entrypoint.sh` to create superuser
`uwsgi.ini` with uwsgi config

* docker-compose.yml rename services

* successful starts (no static)
uwsgi changed to pyuwsgi, cause [uwsgi has no binary scripts for pip wheel](unbit/uwsgi#1218)

* movies_admin with static

* Dockerfile optimized
demo site.conf for multiple services

* ETL starts and works

* Movies API configured and works

* Auth API configured and works
The last broken thing is - Auth API requests works only by 8000 port. Directly from 0.0.0.0:80 Nginx sends errors.
Also did not start tests yet.

* Auth API is set up and works

* Fixed path for tests

* Fixed broken auth service
now docker-compose.yml works perfectly (but tests not)

* Tests for movies
Add `make tests_movies` to run Movies tests.
Fix broken imports in persons tests.

* Auth fixes
tests/ dir now added to image

* Auth routers fix

* Authentication for movies  (#3)

* authentication for movies_api

* imports in auth api

* env path

* Login history partition (#4)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* Yandex OAuth (#5)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* модель для социального аккаунта, эндпоинт для аутентификации через стороннее приложение

* - сохранение в истории входов при аутентификации через яндекс
- отлаженная аутентификация через яндекс

* linters

* movies_api linters

* метод для создания SocialAccount

* Django admin authorization connected to FastAPI (#6)

* Add User model
Fix migrations was not applied
Error was caused by `dump.sql`, which also contains info about migrations.
Update Filmwork and Genre models to allow store None on some fields which is None on dataset.
Admin still not starts. WIP.

* Errors fix
Backend again starts but not synchronized

* Data migration with superuser WIP
Cannot find where users stored

* Superuser data migration refactoring
Fix error with User schema

* Authentication backend on the home straight
Remains to change raw sql data to be consistent with new User model

* Admin django-backend finally connected to FastAPI
Fix migrations
Fix stuff->staff typo
Small refactoring (not enough, but little is better than nothing)

* rename migration 4->5
remove unused constants

* Setup tracing (#7)

* quick fix:
rename migration file to match ascending order
change cut uuid to username in admin panel

* add Open Telemetry to project
fix OIDC env_prefix

* setup simple tracing

* quickfix

* readme

* Add README.md (#9)

---------

Co-authored-by: Maxim Isaev <[email protected]>
Ezereul added a commit that referenced this pull request Mar 18, 2024
* base structure

* copy ETL dir

* copy configs dir

* poetry dependencies

* remove requirements.txt

* rate limit added

* imports fix

* second redis db for rate limit

* another redis db for rate limit

* path for correct alembic work with imports

* delete debug prints

* exception -> authjwtexception

* basic docker-compose.yml
still not ready and not working, just stash commit

* basic `.env` variables renaming
WIP, just stash commit

* just trying to apply changes from `dev` branch to `feature/docker-compose`.
hope I did not broke anything...

* small .gitignore addition

* Dockerfile for movies_admin

* `entrypoint.sh` to create superuser
`uwsgi.ini` with uwsgi config

* docker-compose.yml rename services

* successful starts (no static)
uwsgi changed to pyuwsgi, cause [uwsgi has no binary scripts for pip wheel](unbit/uwsgi#1218)

* movies_admin with static

* Dockerfile optimized
demo site.conf for multiple services

* ETL starts and works

* Movies API configured and works

* Auth API configured and works
The last broken thing is - Auth API requests works only by 8000 port. Directly from 0.0.0.0:80 Nginx sends errors.
Also did not start tests yet.

* Auth API is set up and works

* Fixed path for tests

* Fixed broken auth service
now docker-compose.yml works perfectly (but tests not)

* Tests for movies
Add `make tests_movies` to run Movies tests.
Fix broken imports in persons tests.

* Auth fixes
tests/ dir now added to image

* Auth routers fix

* Authentication for movies  (#3)

* authentication for movies_api

* imports in auth api

* env path

* Login history partition (#4)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* Yandex OAuth (#5)

* history partition function

* partition migrations and partition utils

* новая логика для сервиса истории входов после добавления партицирования

* relativedelta вместо условных операторов

* модель для социального аккаунта, эндпоинт для аутентификации через стороннее приложение

* - сохранение в истории входов при аутентификации через яндекс
- отлаженная аутентификация через яндекс

* linters

* movies_api linters

* метод для создания SocialAccount

* Django admin authorization connected to FastAPI (#6)

* Add User model
Fix migrations was not applied
Error was caused by `dump.sql`, which also contains info about migrations.
Update Filmwork and Genre models to allow store None on some fields which is None on dataset.
Admin still not starts. WIP.

* Errors fix
Backend again starts but not synchronized

* Data migration with superuser WIP
Cannot find where users stored

* Superuser data migration refactoring
Fix error with User schema

* Authentication backend on the home straight
Remains to change raw sql data to be consistent with new User model

* Admin django-backend finally connected to FastAPI
Fix migrations
Fix stuff->staff typo
Small refactoring (not enough, but little is better than nothing)

* rename migration 4->5
remove unused constants

* Setup tracing (#7)

* quick fix:
rename migration file to match ascending order
change cut uuid to username in admin panel

* add Open Telemetry to project
fix OIDC env_prefix

* setup simple tracing

* quickfix

* readme

* Add README.md (#9)

* Review changes (#12)

* login_via_yandex переписан с возможностью добавления новых провайдеров для oauth

* HTTPStatus вместо хардкодинга

* Добавлена возможность отключать трейсинг с помощью переменной окружения AUTH_ENABLE_TRACING

* Порт и хост для Jaeger вынесены в .env

* Замена старого тайпинга

* Замена магических чисел на константы

* linters

---------

Co-authored-by: LuchnikKek <[email protected]>
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.

2 participants