LLM-Driven Extraction of Unstructured Data — Built for API Deployments & ETL Pipeline Workflows
Python ai-agentsdata-engineeringdocument-aigenerative-aiidpjson-extractionllmmcp-serverocrpdf-extractionprompt-engineeringstructured-output
API keys Access Fix. (#613)
alif705bb76bf6c
diff --git a/backend/api/api_key_views.py b/backend/api/api_key_views.pyindex 020685c60..c7c81e9c3 100644--- a/backend/api/api_key_views.py+++ b/backend/api/api_key_views.py@@ -5,6 +5,7 @@ from api.exceptions import APINotFound, PathVariablesNotFoundfrom api.key_helper import KeyHelperfrom api.models import APIKeyfrom api.serializers import APIKeyListSerializer, APIKeySerializer+from permissions.permission import IsOwnerfrom pipeline.exceptions import PipelineNotFoundfrom pipeline.pipeline_processor import PipelineProcessorfrom rest_framework import serializers, viewsets@@ -15,6 +16,7 @@ from rest_framework.response import Responseclass APIKeyViewSet(viewsets.ModelViewSet):queryset = APIKey.objects.all()+ permission_classes = [IsOwner]def get_serializer_class(self) -> serializers.Serializer:if self.action in ["api_keys"]:@@ -33,11 +35,13 @@ class APIKeyViewSet(viewsets.ModelViewSet):api = DeploymentHelper.get_api_by_id(api_id=api_id)if not api:raise APINotFound()+ self.check_object_permissions(request, api)keys = KeyHelper.list_api_keys_of_api(api_instance=api)elif pipeline_id:pipeline = PipelineProcessor.get_active_pipeline(pipeline_id=pipeline_id)if not pipeline:raise PipelineNotFound()+ self.check_object_permissions(request, pipeline)keys = KeyHelper.list_api_keys_of_pipeline(pipeline_instance=pipeline)else:raise PathVariablesNotFound(diff --git a/backend/pipeline/pipeline_processor.py b/backend/pipeline/pipeline_processor.pyindex 0fb42abb1..0bf5e491d 100644--- a/backend/pipeline/pipeline_processor.py+++ b/backend/pipeline/pipeline_processor.py@@ -28,6 +28,9 @@ class PipelineProcessor:@staticmethoddef fetch_pipeline(pipeline_id: str, check_active: bool = True) -> Pipeline:"""Retrieves and checks for an active pipeline.+ Args:+ pipeline_id (str): UUID of the pipeline+ check_active (bool): Whether to check if the pipeline is activeRaises:InactivePipelineError: If an active pipeline is not found