작업대기 시리얼라이저부터 해야함

This commit is contained in:
2025-05-20 08:29:52 +09:00
parent b625e222f4
commit b172945fc5
15 changed files with 381 additions and 0 deletions

0
ansible/__init__.py Normal file
View File

3
ansible/admin.py Normal file
View File

@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
ansible/apps.py Normal file
View File

@ -0,0 +1,6 @@
from django.apps import AppConfig
class AnsibleConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'ansible'

17
ansible/authentication.py Normal file
View File

@ -0,0 +1,17 @@
from rest_framework_simplejwt.authentication import JWTAuthentication
from rest_framework_simplejwt.exceptions import InvalidToken
class StatelessUser:
def __init__(self, email):
self.email = email
self.is_authenticated = True
def __str__(self):
return self.email
class StatelessJWTAuthentication(JWTAuthentication):
def get_user(self, validated_token):
email = validated_token.get("email") # msa-django-auth에서 넣어준 필드
if not email:
raise InvalidToken("Token에 'email' 항목이 없습니다.")
return StatelessUser(email=email)

View File

3
ansible/models.py Normal file
View File

@ -0,0 +1,3 @@
from django.db import models
# Create your models here.

3
ansible/tests.py Normal file
View File

@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
ansible/views.py Normal file
View File

@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.