feat: ship MVP itinerary optimization, weather, AI key prefs, and MCP tools

This commit is contained in:
2026-03-08 13:49:32 +00:00
parent 9eb0325c7a
commit 8c0637c518
25 changed files with 1888 additions and 511 deletions

View File

@@ -0,0 +1,33 @@
from rest_framework import viewsets
from rest_framework.exceptions import APIException
from rest_framework.permissions import IsAuthenticated
from integrations.models import (
EncryptionConfigurationError,
UserAPIKey,
get_field_fernet,
)
from integrations.serializers import UserAPIKeySerializer
class APIKeyConfigurationError(APIException):
status_code = 503
default_detail = (
"API key storage is unavailable due to server encryption configuration."
)
default_code = "api_key_encryption_unavailable"
class UserAPIKeyViewSet(viewsets.ModelViewSet):
serializer_class = UserAPIKeySerializer
permission_classes = [IsAuthenticated]
def initial(self, request, *args, **kwargs):
try:
get_field_fernet()
except EncryptionConfigurationError as exc:
raise APIKeyConfigurationError(detail=str(exc)) from exc
return super().initial(request, *args, **kwargs)
def get_queryset(self):
return UserAPIKey.objects.filter(user=self.request.user).order_by("provider")