v0.0.23 | NHN Cloud 프로젝트에 dns_appkey 필드 추가
Some checks failed
Build And Test / build-and-push (push) Failing after 36s

- NHNCloudProject 모델에 dns_appkey 필드 추가
- 프로젝트 CRUD API에서 dns_appkey 처리

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-15 00:32:00 +09:00
parent e102d6766a
commit d79c57d11b
4 changed files with 30 additions and 1 deletions

View File

@ -0,0 +1,18 @@
# Generated by Django 4.2.14 on 2026-01-14 15:18
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0010_nhncloudproject'),
]
operations = [
migrations.AddField(
model_name='nhncloudproject',
name='dns_appkey',
field=models.CharField(blank=True, max_length=64, null=True, verbose_name='DNS Plus Appkey'),
),
]

View File

@ -163,6 +163,7 @@ class NHNCloudProject(models.Model):
username = models.EmailField(verbose_name="NHN Cloud Username")
encrypted_password = models.BinaryField(verbose_name="NHN Cloud API Password (암호화)")
storage_account = models.CharField(max_length=128, blank=True, null=True, verbose_name="Storage Account")
dns_appkey = models.CharField(max_length=64, blank=True, null=True, verbose_name="DNS Plus Appkey")
is_active = models.BooleanField(default=False, verbose_name="활성 프로젝트")
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)

View File

@ -455,6 +455,7 @@ class NHNCloudProjectListView(APIView):
"tenant_id": p.tenant_id,
"username": p.username,
"storage_account": p.storage_account or "",
"dns_appkey": p.dns_appkey or "",
"is_active": p.is_active,
"created_at": p.created_at.isoformat(),
} for p in projects]
@ -471,6 +472,7 @@ class NHNCloudProjectListView(APIView):
username = request.data.get("username")
password = request.data.get("password")
storage_account = request.data.get("storage_account", "")
dns_appkey = request.data.get("dns_appkey", "")
if not name or not tenant_id or not username or not password:
logger.warning(
@ -501,6 +503,7 @@ class NHNCloudProjectListView(APIView):
tenant_id=tenant_id,
username=username,
storage_account=storage_account,
dns_appkey=dns_appkey,
is_active=is_first,
)
# 암호화된 비밀번호 설정 후 저장
@ -518,6 +521,7 @@ class NHNCloudProjectListView(APIView):
"tenant_id": project.tenant_id,
"username": project.username,
"storage_account": project.storage_account or "",
"dns_appkey": project.dns_appkey or "",
"is_active": project.is_active,
"created_at": project.created_at.isoformat(),
}, status=status.HTTP_201_CREATED)
@ -557,6 +561,7 @@ class NHNCloudProjectDetailView(APIView):
"tenant_id": project.tenant_id,
"username": project.username,
"storage_account": project.storage_account or "",
"dns_appkey": project.dns_appkey or "",
"is_active": project.is_active,
"created_at": project.created_at.isoformat(),
})
@ -579,6 +584,7 @@ class NHNCloudProjectDetailView(APIView):
username = request.data.get("username")
password = request.data.get("password") # 비어있으면 변경 안함
storage_account = request.data.get("storage_account")
dns_appkey = request.data.get("dns_appkey")
# 필수 필드 검증
if not name or not tenant_id or not username:
@ -602,6 +608,8 @@ class NHNCloudProjectDetailView(APIView):
project.username = username
if storage_account is not None:
project.storage_account = storage_account
if dns_appkey is not None:
project.dns_appkey = dns_appkey
# 비밀번호가 제공된 경우에만 변경
if password:
@ -620,6 +628,7 @@ class NHNCloudProjectDetailView(APIView):
"tenant_id": project.tenant_id,
"username": project.username,
"storage_account": project.storage_account or "",
"dns_appkey": project.dns_appkey or "",
"is_active": project.is_active,
"created_at": project.created_at.isoformat(),
})
@ -724,6 +733,7 @@ class NHNCloudProjectPasswordView(APIView):
"username": project.username,
"password": decrypted_password,
"storage_account": project.storage_account or "",
"dns_appkey": project.dns_appkey or "",
})
except Exception as e:
logger.exception(

View File

@ -1 +1 @@
v0.0.22
v0.0.23