Add NHN Cloud API integration with async task support
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled

- NHN Cloud API packages: token, vpc, compute, nks, storage
- REST API endpoints with Swagger documentation
- Async task processing for long-running operations
- CORS configuration for frontend integration
- Enhanced logging for debugging API calls

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-14 01:29:21 +09:00
parent 256fed485e
commit 8c7739ffad
32 changed files with 4059 additions and 0 deletions

31
nhn/utils.py Normal file
View File

@ -0,0 +1,31 @@
import requests
from django.conf import settings
import logging
logger = logging.getLogger(__name__)
def verify_token_with_auth_server(token: str):
"""
Verify token with external auth server.
"""
url = settings.AUTH_VERIFY_URL
if not url:
logger.warning("AUTH_VERIFY_URL is not configured.")
return None
try:
response = requests.post(
url,
json={"token": token},
headers={"Content-Type": "application/json"},
timeout=5,
)
if response.status_code == 200:
return response.json()
else:
logger.error(f"Auth server returned status {response.status_code}")
return None
except requests.RequestException as e:
logger.error(f"Failed to verify token: {e}")
return None