v0.0.23 | NHN Cloud 프로젝트에 dns_appkey 필드 추가
Some checks failed
Build And Test / build-and-push (push) Failing after 36s
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:
@ -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(
|
||||
|
||||
Reference in New Issue
Block a user