From 7876fb32e9af5b48ab858abc5d06022595bee4ee Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:43:54 +0900 Subject: [PATCH 1/9] =?UTF-8?q?build(auth):=20auth=20=EC=96=B4=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=EC=BC=80=EC=9D=B4=EC=85=98=20=EC=82=AD=EC=A0=9C=20?= =?UTF-8?q?=EB=B0=8F=20login=EC=9C=BC=EB=A1=9C=20=EB=8C=80=EC=B2=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/{auth => }/__init__.py | 0 backend/auth/admin.py | 3 --- backend/auth/apps.py | 6 ------ backend/auth/migrations/__init__.py | 0 backend/auth/models.py | 5 ----- backend/auth/tests.py | 3 --- backend/auth/views.py | 3 --- backend/login/urls.py | 8 ++++++++ 8 files changed, 8 insertions(+), 20 deletions(-) rename backend/{auth => }/__init__.py (100%) delete mode 100644 backend/auth/admin.py delete mode 100644 backend/auth/apps.py delete mode 100644 backend/auth/migrations/__init__.py delete mode 100644 backend/auth/models.py delete mode 100644 backend/auth/tests.py delete mode 100644 backend/auth/views.py create mode 100644 backend/login/urls.py diff --git a/backend/auth/__init__.py b/backend/__init__.py similarity index 100% rename from backend/auth/__init__.py rename to backend/__init__.py diff --git a/backend/auth/admin.py b/backend/auth/admin.py deleted file mode 100644 index 8c38f3f3..00000000 --- a/backend/auth/admin.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.contrib import admin - -# Register your models here. diff --git a/backend/auth/apps.py b/backend/auth/apps.py deleted file mode 100644 index 836fe02b..00000000 --- a/backend/auth/apps.py +++ /dev/null @@ -1,6 +0,0 @@ -from django.apps import AppConfig - - -class AuthConfig(AppConfig): - default_auto_field = 'django.db.models.BigAutoField' - name = 'auth' diff --git a/backend/auth/migrations/__init__.py b/backend/auth/migrations/__init__.py deleted file mode 100644 index e69de29b..00000000 diff --git a/backend/auth/models.py b/backend/auth/models.py deleted file mode 100644 index 956934e0..00000000 --- a/backend/auth/models.py +++ /dev/null @@ -1,5 +0,0 @@ -from django.contrib.auth.models import AbstractUser -from django.db import models - -class User(AbstractUser): - \ No newline at end of file diff --git a/backend/auth/tests.py b/backend/auth/tests.py deleted file mode 100644 index 7ce503c2..00000000 --- a/backend/auth/tests.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.test import TestCase - -# Create your tests here. diff --git a/backend/auth/views.py b/backend/auth/views.py deleted file mode 100644 index 91ea44a2..00000000 --- a/backend/auth/views.py +++ /dev/null @@ -1,3 +0,0 @@ -from django.shortcuts import render - -# Create your views here. diff --git a/backend/login/urls.py b/backend/login/urls.py new file mode 100644 index 00000000..1854e473 --- /dev/null +++ b/backend/login/urls.py @@ -0,0 +1,8 @@ +from django.urls import path +from .views import GoogleLoginView, Login42View + + +urlpatterns = [ + path('google/', GoogleLoginView.as_view(), name="google_login"), + path('42/', Login42View.as_view(), name="login_42"), +] From 0b9f357eed0ac46f97373079fa96d0b5f57db40a Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 10:44:36 +0900 Subject: [PATCH 2/9] =?UTF-8?q?feat(login):=20login=20=EC=96=B4=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=EC=BC=80=EC=9D=B4=EC=85=98=20API=20=EB=AA=85=EC=84=B8?= =?UTF-8?q?=20=EA=B8=B0=EB=B3=B8=20=ED=8B=80=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/serializers.py | 34 ++++++++++++++++++++++++++++++++++ backend/src/settings.py | 18 ++++++------------ backend/src/urls.py | 4 +++- 3 files changed, 43 insertions(+), 13 deletions(-) create mode 100644 backend/login/serializers.py diff --git a/backend/login/serializers.py b/backend/login/serializers.py new file mode 100644 index 00000000..b2cd5908 --- /dev/null +++ b/backend/login/serializers.py @@ -0,0 +1,34 @@ +from rest_framework import serializers +from drf_yasg.utils import swagger_auto_schema + + +@swagger_auto_schema( + tags=["login"], +) +class GoogleLoginSerializer(serializers.Serializer): + def to_representation(self, instance): + return { + "access_token": instance["access_token"], + "refresh_token": instance["refresh_token"], + "user": { + "id": instance["user"].id, + "email": instance["user"].email, + "name": instance["user"].name, + }, + } + + +@swagger_auto_schema( + tags=["login"], +) +class Login42Serializer(serializers.Serializer): + def to_representation(self, instance): + return { + "access_token": instance["access_token"], + "refresh_token": instance["refresh_token"], + "user": { + "id": instance["user"].id, + "email": instance["user"].email, + "name": instance["user"].name, + }, + } \ No newline at end of file diff --git a/backend/src/settings.py b/backend/src/settings.py index 8fa5e420..e0ac542b 100644 --- a/backend/src/settings.py +++ b/backend/src/settings.py @@ -18,7 +18,6 @@ BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) ENV_PATH = os.path.join(BASE_DIR, '..', '.env') - env = environ.Env() env.read_env(env_file=ENV_PATH) @@ -42,10 +41,10 @@ }, 'handlers': { 'logstash': { - 'level': 'INFO', # 모든 로그 레벨 포함 + 'level': 'INFO', # 모든 로그 레벨 포함 'class': 'logstash.TCPLogstashHandler', - 'host': 'logstash_container', # Logstash 서비스의 컨테이너 이름 - 'port': 5333, # Logstash 컨테이너가 로그를 수신하는 포트 + 'host': 'logstash_container', # Logstash 서비스의 컨테이너 이름 + 'port': 5333, # Logstash 컨테이너가 로그를 수신하는 포트 'version': 1, 'message_type': 'logstash', 'fqdn': False, @@ -55,20 +54,18 @@ 'loggers': { 'django': { 'handlers': ['logstash'], - 'level': 'DEBUG', # 모든 로그 레벨 포함 + 'level': 'DEBUG', # 모든 로그 레벨 포함 'propagate': True, }, # 필요에 따라 추가 로거 정의 }, } - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True ALLOWED_HOSTS = [] - # Application definition INSTALLED_APPS = [ @@ -78,8 +75,8 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'rest_framework', - 'drf_yasg', + 'rest_framework', + 'drf_yasg', ] MIDDLEWARE = [ @@ -123,7 +120,6 @@ } } - # Password validation # https://docs.djangoproject.com/en/4.2/ref/settings/#auth-password-validators @@ -142,7 +138,6 @@ }, ] - # Internationalization # https://docs.djangoproject.com/en/4.2/topics/i18n/ @@ -154,7 +149,6 @@ USE_TZ = True - # Static files (CSS, JavaScript, Images) # https://docs.djangoproject.com/en/4.2/howto/static-files/ diff --git a/backend/src/urls.py b/backend/src/urls.py index bf1e229a..b9ca857b 100644 --- a/backend/src/urls.py +++ b/backend/src/urls.py @@ -21,13 +21,14 @@ from drf_yasg.views import get_schema_view from drf_yasg import openapi + router = routers.DefaultRouter() schema_view = get_schema_view( openapi.Info( title="ft_transcendence API", default_version="v1.0.0", - description="Test description", + description="GunGonGamLee의 ft_transcendence API 문서입니다.", terms_of_service="https://www.google.com/policies/terms/", ), public=True, @@ -36,6 +37,7 @@ urlpatterns = [ path('admin/', admin.site.urls), + path('login/', include('login.urls')), ] # DEBUG 모드일 경우, ui 없이 swagger view를 사용할 수 있도록 설정 From efc5628240d188fd493f29a41b735bfb408ef33e Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:22:19 +0900 Subject: [PATCH 3/9] =?UTF-8?q?refactor(serializer):=20class=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/serializers.py | 37 +++++++++--------------------------- backend/src/urls.py | 16 +++------------- 2 files changed, 12 insertions(+), 41 deletions(-) diff --git a/backend/login/serializers.py b/backend/login/serializers.py index b2cd5908..7becd5e1 100644 --- a/backend/login/serializers.py +++ b/backend/login/serializers.py @@ -2,33 +2,14 @@ from drf_yasg.utils import swagger_auto_schema -@swagger_auto_schema( - tags=["login"], -) -class GoogleLoginSerializer(serializers.Serializer): - def to_representation(self, instance): - return { - "access_token": instance["access_token"], - "refresh_token": instance["refresh_token"], - "user": { - "id": instance["user"].id, - "email": instance["user"].email, - "name": instance["user"].name, - }, - } +class LoginRedirectSerializer(serializers.Serializer): + status = serializers.IntegerField(default=302) + redirect_uri = serializers.URLField(default='http://localhost:8000/login/authorization') -@swagger_auto_schema( - tags=["login"], -) -class Login42Serializer(serializers.Serializer): - def to_representation(self, instance): - return { - "access_token": instance["access_token"], - "refresh_token": instance["refresh_token"], - "user": { - "id": instance["user"].id, - "email": instance["user"].email, - "name": instance["user"].name, - }, - } \ No newline at end of file +class GoogleLoginSerializer(LoginRedirectSerializer): + pass + + +class FTLoginSerializer(LoginRedirectSerializer): + pass diff --git a/backend/src/urls.py b/backend/src/urls.py index b9ca857b..bce36874 100644 --- a/backend/src/urls.py +++ b/backend/src/urls.py @@ -22,8 +22,6 @@ from drf_yasg import openapi -router = routers.DefaultRouter() - schema_view = get_schema_view( openapi.Info( title="ft_transcendence API", @@ -36,17 +34,9 @@ ) urlpatterns = [ + path('swagger<format>/', schema_view.without_ui(cache_timeout=0), name='schema-json'), + path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), + path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), path('admin/', admin.site.urls), path('login/', include('login.urls')), ] - -# DEBUG 모드일 경우, ui 없이 swagger view를 사용할 수 있도록 설정 -if settings.DEBUG: - urlpatterns += [ - re_path(r'^swagger(?P<format>\.json|\.yaml)$', - schema_view.without_ui(cache_timeout=0), name='schema-json'), - re_path(r'^swagger/$', schema_view.with_ui('swagger', - cache_timeout=0), name='schema-swagger-ui'), - re_path(r'^redoc/$', schema_view.with_ui('redoc', - cache_timeout=0), name='schema-redoc'), - ] From 3be6d4e16dced96068b7501941b01e180f6c23f1 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:22:32 +0900 Subject: [PATCH 4/9] =?UTF-8?q?refactor(serializer):=20class=20=EC=9D=B4?= =?UTF-8?q?=EB=A6=84=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/urls.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/login/urls.py b/backend/login/urls.py index 1854e473..8b066def 100644 --- a/backend/login/urls.py +++ b/backend/login/urls.py @@ -1,8 +1,8 @@ from django.urls import path -from .views import GoogleLoginView, Login42View +from .views import GoogleLoginView, FTLoginView urlpatterns = [ path('google/', GoogleLoginView.as_view(), name="google_login"), - path('42/', Login42View.as_view(), name="login_42"), + path('42/', FTLoginView.as_view(), name="login_42"), ] From 5643317948f3aa668a96bbb03251c6c2456b4579 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 13:26:16 +0900 Subject: [PATCH 5/9] =?UTF-8?q?feat:=20user,=20login=20=EC=96=B4=ED=94=8C?= =?UTF-8?q?=EB=A6=AC=EC=BC=80=EC=9D=B4=EC=85=98=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/__init__.py | 0 backend/login/admin.py | 3 +++ backend/login/apps.py | 6 +++++ backend/login/migrations/__init__.py | 0 backend/login/models.py | 3 +++ backend/login/tests.py | 3 +++ backend/login/views.py | 36 ++++++++++++++++++++++++++++ backend/users/__init__.py | 0 backend/users/admin.py | 3 +++ backend/users/apps.py | 6 +++++ backend/users/migrations/__init__.py | 0 backend/users/models.py | 3 +++ backend/users/tests.py | 3 +++ backend/users/views.py | 3 +++ 14 files changed, 69 insertions(+) create mode 100644 backend/login/__init__.py create mode 100644 backend/login/admin.py create mode 100644 backend/login/apps.py create mode 100644 backend/login/migrations/__init__.py create mode 100644 backend/login/models.py create mode 100644 backend/login/tests.py create mode 100644 backend/login/views.py create mode 100644 backend/users/__init__.py create mode 100644 backend/users/admin.py create mode 100644 backend/users/apps.py create mode 100644 backend/users/migrations/__init__.py create mode 100644 backend/users/models.py create mode 100644 backend/users/tests.py create mode 100644 backend/users/views.py diff --git a/backend/login/__init__.py b/backend/login/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/login/admin.py b/backend/login/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/backend/login/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/backend/login/apps.py b/backend/login/apps.py new file mode 100644 index 00000000..ebd58e73 --- /dev/null +++ b/backend/login/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class LoginConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'login' diff --git a/backend/login/migrations/__init__.py b/backend/login/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/login/models.py b/backend/login/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/backend/login/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/backend/login/tests.py b/backend/login/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/backend/login/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/backend/login/views.py b/backend/login/views.py new file mode 100644 index 00000000..4a858499 --- /dev/null +++ b/backend/login/views.py @@ -0,0 +1,36 @@ +# login/views.py +from rest_framework.views import APIView +from rest_framework.response import Response +from drf_yasg.utils import swagger_auto_schema +from .serializers import GoogleLoginSerializer, FTLoginSerializer + + +class GoogleLoginView(APIView): + @swagger_auto_schema( + tags=["login"], + responses={302: GoogleLoginSerializer()}, + ) + def get(self, request): + response = validate_request(request) + serializer = GoogleLoginSerializer(data=request.data) + serializer.is_valid(raise_exception=True) + return Response(serializer.data) + + +class FTLoginView(APIView): + @swagger_auto_schema( + tags=["login"], + responses={ + e0 + }, + ) + def get(self, request): + request_data = { + 'redirect_uri': f'https://{request.get_host()}/login/authorization' + } + serializer = FTLoginSerializer(data=request_data) + serializer.is_valid(raise_exception=True) + redirect_uri = serializer.validated_data['redirect_uri'] + response = Response(status=302) + response['Location'] = redirect_uri + return response diff --git a/backend/users/__init__.py b/backend/users/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/users/admin.py b/backend/users/admin.py new file mode 100644 index 00000000..8c38f3f3 --- /dev/null +++ b/backend/users/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/backend/users/apps.py b/backend/users/apps.py new file mode 100644 index 00000000..72b14010 --- /dev/null +++ b/backend/users/apps.py @@ -0,0 +1,6 @@ +from django.apps import AppConfig + + +class UsersConfig(AppConfig): + default_auto_field = 'django.db.models.BigAutoField' + name = 'users' diff --git a/backend/users/migrations/__init__.py b/backend/users/migrations/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/users/models.py b/backend/users/models.py new file mode 100644 index 00000000..71a83623 --- /dev/null +++ b/backend/users/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/backend/users/tests.py b/backend/users/tests.py new file mode 100644 index 00000000..7ce503c2 --- /dev/null +++ b/backend/users/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/backend/users/views.py b/backend/users/views.py new file mode 100644 index 00000000..91ea44a2 --- /dev/null +++ b/backend/users/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. From 652eea5082833725e2be201c31087372b1ef1a28 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:23:55 +0900 Subject: [PATCH 6/9] =?UTF-8?q?feat(login):=2042=20=EB=A1=9C=EA=B7=B8?= =?UTF-8?q?=EC=9D=B8=20api=20=EB=AA=85=EC=84=B8=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/schema/__init__.py | 0 backend/login/schema/responses.py | 30 ++++++++++++++++++++++++++++++ backend/login/serializers.py | 15 --------------- backend/login/views.py | 29 +++++++++++------------------ 4 files changed, 41 insertions(+), 33 deletions(-) create mode 100644 backend/login/schema/__init__.py create mode 100644 backend/login/schema/responses.py delete mode 100644 backend/login/serializers.py diff --git a/backend/login/schema/__init__.py b/backend/login/schema/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/backend/login/schema/responses.py b/backend/login/schema/responses.py new file mode 100644 index 00000000..3ca74968 --- /dev/null +++ b/backend/login/schema/responses.py @@ -0,0 +1,30 @@ +from drf_yasg import openapi + +ft_login_response_schema = { + 302: openapi.Response( + description="42 인증 후 '/login/authorization'으로 리다이렉트", + headers={ + "Location": { + "type": "string", + "description": "Redirect URI", + "format": "uri", + } + }, + schema=openapi.Schema( + type=openapi.TYPE_OBJECT, + properties={ + "Location": openapi.Schema( + type=openapi.TYPE_STRING, + description="Redirect URI", + format=openapi.FORMAT_URI, + pattern=r"^/login/authorization\?code={code}&" + "state={state}&is_new_user=(true|false)$", + ) + }, + ), + examples={ + "application/json": { + "Location": "/login/authorization?code=1234567890&state=1234567890&is_new_user=true" + } + } + ) +} diff --git a/backend/login/serializers.py b/backend/login/serializers.py deleted file mode 100644 index 7becd5e1..00000000 --- a/backend/login/serializers.py +++ /dev/null @@ -1,15 +0,0 @@ -from rest_framework import serializers -from drf_yasg.utils import swagger_auto_schema - - -class LoginRedirectSerializer(serializers.Serializer): - status = serializers.IntegerField(default=302) - redirect_uri = serializers.URLField(default='http://localhost:8000/login/authorization') - - -class GoogleLoginSerializer(LoginRedirectSerializer): - pass - - -class FTLoginSerializer(LoginRedirectSerializer): - pass diff --git a/backend/login/views.py b/backend/login/views.py index 4a858499..42d3bc8f 100644 --- a/backend/login/views.py +++ b/backend/login/views.py @@ -2,35 +2,28 @@ from rest_framework.views import APIView from rest_framework.response import Response from drf_yasg.utils import swagger_auto_schema -from .serializers import GoogleLoginSerializer, FTLoginSerializer +from .schema.responses import ft_login_response_schema class GoogleLoginView(APIView): @swagger_auto_schema( tags=["login"], - responses={302: GoogleLoginSerializer()}, ) def get(self, request): - response = validate_request(request) - serializer = GoogleLoginSerializer(data=request.data) - serializer.is_valid(raise_exception=True) - return Response(serializer.data) + + # serializer = GoogleLoginSerializer(data=request.data) + # serializer.is_valid(raise_exception=True) + return Response('') class FTLoginView(APIView): @swagger_auto_schema( tags=["login"], - responses={ - e0 - }, + operation_id="42_login", + operation_summary="42 OAuth 로그인", + operation_description="42 OAuth 로그인 후 '/login/authorization'으로 리다이렉트", + responses=ft_login_response_schema, ) def get(self, request): - request_data = { - 'redirect_uri': f'https://{request.get_host()}/login/authorization' - } - serializer = FTLoginSerializer(data=request_data) - serializer.is_valid(raise_exception=True) - redirect_uri = serializer.validated_data['redirect_uri'] - response = Response(status=302) - response['Location'] = redirect_uri - return response + return Response('') + From cc9fb4f984921c3195ef90e73573bb53b2f96c07 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:35:05 +0900 Subject: [PATCH 7/9] =?UTF-8?q?feat(login):=20=EC=9E=84=EC=8B=9C=20respons?= =?UTF-8?q?e=20message=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/login/schema/responses.py | 11 +++++++++-- backend/login/views.py | 12 ++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/backend/login/schema/responses.py b/backend/login/schema/responses.py index 3ca74968..7b468786 100644 --- a/backend/login/schema/responses.py +++ b/backend/login/schema/responses.py @@ -1,8 +1,9 @@ from drf_yasg import openapi -ft_login_response_schema = { + +common_login_response_schema = { 302: openapi.Response( - description="42 인증 후 '/login/authorization'으로 리다이렉트", + description="Change description", headers={ "Location": { "type": "string", @@ -28,3 +29,9 @@ } ) } + +google_login_response_schema = common_login_response_schema.copy() +google_login_response_schema[302].description = "구글 인증 후 '/login/authorization'으로 리다이렉트" + +ft_login_response_schema = common_login_response_schema.copy() +ft_login_response_schema[302].description = "42 인증 후 '/login/authorization'으로 리다이렉트" diff --git a/backend/login/views.py b/backend/login/views.py index 42d3bc8f..06241166 100644 --- a/backend/login/views.py +++ b/backend/login/views.py @@ -2,18 +2,18 @@ from rest_framework.views import APIView from rest_framework.response import Response from drf_yasg.utils import swagger_auto_schema -from .schema.responses import ft_login_response_schema +from .schema.responses import ft_login_response_schema, google_login_response_schema class GoogleLoginView(APIView): @swagger_auto_schema( tags=["login"], + operation_summary="구글 OAuth 로그인", + operation_description="구글 OAuth 로그인 후 '/login/authorization'으로 리다이렉트", + responses=google_login_response_schema, ) def get(self, request): - - # serializer = GoogleLoginSerializer(data=request.data) - # serializer.is_valid(raise_exception=True) - return Response('') + return Response(status=302, data={"message": "구글 OAuth 로그인"}) class FTLoginView(APIView): @@ -25,5 +25,5 @@ class FTLoginView(APIView): responses=ft_login_response_schema, ) def get(self, request): - return Response('') + return Response(status=302, data={"message": "42 OAuth 로그인"}) From a1a0898a59d4ebb820bc9f115fcb3ee805ae200a Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:37:52 +0900 Subject: [PATCH 8/9] =?UTF-8?q?build(github):=20github=20=ED=8F=B4?= =?UTF-8?q?=EB=8D=94=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- {backend/.github => .github}/ISSUE_TEMPLATE/bug_report.md | 0 {backend/.github => .github}/ISSUE_TEMPLATE/feature_request.md | 0 {backend/.github => .github}/pull_request_template.md | 0 {backend/.github => .github}/workflows/convention_checker.yml | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename {backend/.github => .github}/ISSUE_TEMPLATE/bug_report.md (100%) rename {backend/.github => .github}/ISSUE_TEMPLATE/feature_request.md (100%) rename {backend/.github => .github}/pull_request_template.md (100%) rename {backend/.github => .github}/workflows/convention_checker.yml (100%) diff --git a/backend/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 100% rename from backend/.github/ISSUE_TEMPLATE/bug_report.md rename to .github/ISSUE_TEMPLATE/bug_report.md diff --git a/backend/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md similarity index 100% rename from backend/.github/ISSUE_TEMPLATE/feature_request.md rename to .github/ISSUE_TEMPLATE/feature_request.md diff --git a/backend/.github/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from backend/.github/pull_request_template.md rename to .github/pull_request_template.md diff --git a/backend/.github/workflows/convention_checker.yml b/.github/workflows/convention_checker.yml similarity index 100% rename from backend/.github/workflows/convention_checker.yml rename to .github/workflows/convention_checker.yml From 01234d93949a7279082eae7e36dca79c82f03ac1 Mon Sep 17 00:00:00 2001 From: yena <50291995+nyj001012@users.noreply.github.com> Date: Thu, 11 Jan 2024 14:39:47 +0900 Subject: [PATCH 9/9] =?UTF-8?q?refactor:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20volume=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- volumes/elasticsearch/config/elasticsearch.yml | 3 --- volumes/logstash/config/logstash.yml | 8 -------- 2 files changed, 11 deletions(-) delete mode 100644 volumes/elasticsearch/config/elasticsearch.yml delete mode 100644 volumes/logstash/config/logstash.yml diff --git a/volumes/elasticsearch/config/elasticsearch.yml b/volumes/elasticsearch/config/elasticsearch.yml deleted file mode 100644 index b6cde786..00000000 --- a/volumes/elasticsearch/config/elasticsearch.yml +++ /dev/null @@ -1,3 +0,0 @@ -cluster.name: "docker-cluster" -network.host: 0.0.0.0 -xpack.security.enabled: true diff --git a/volumes/logstash/config/logstash.yml b/volumes/logstash/config/logstash.yml deleted file mode 100644 index b5dd2ff3..00000000 --- a/volumes/logstash/config/logstash.yml +++ /dev/null @@ -1,8 +0,0 @@ -http.host : "0.0.0.0" -path.config : /usr/share/logstash/pipeline/logstash.conf -pipeline.workers : 2 # 한 번에 실행할 스레드 수 -pipeline.batch.size: 125 # 한 번에 처리할 이벤트 수 -pipeline.batch.delay: 50 # 미처리된 이벤트 처리 전 대기 시간 50밀리초 - -log.level: info -