Skip to content

🎨 Require parent info headers when running function #7900

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from typing import Annotated, Final

import jsonschema
from fastapi import APIRouter, Depends, Request, status
from fastapi import APIRouter, Depends, Header, Request, status
from fastapi_pagination.api import create_page
from jsonschema import ValidationError
from models_library.api_schemas_api_server.functions import (
Expand All @@ -29,6 +29,8 @@
UnsupportedFunctionClassError,
)
from models_library.products import ProductName
from models_library.projects import ProjectID
from models_library.projects_nodes_io import NodeID
from models_library.projects_state import RunningState
from models_library.users import UserID
from servicelib.fastapi.dependencies import get_reverse_url_mapper
Expand Down Expand Up @@ -372,6 +374,8 @@ async def run_function( # noqa: PLR0913
product_name: Annotated[str, Depends(get_product_name)],
solver_service: Annotated[SolverService, Depends(get_solver_service)],
job_service: Annotated[JobService, Depends(get_job_service)],
x_simcore_parent_project_uuid: Annotated[ProjectID | None, Header()],
x_simcore_parent_node_id: Annotated[NodeID | None, Header()],
) -> RegisteredFunctionJob:

user_permissions: FunctionUserAccessRights = (
Expand Down Expand Up @@ -436,8 +440,8 @@ async def run_function( # noqa: PLR0913
webserver_api=webserver_api,
wb_api_rpc=wb_api_rpc,
url_for=url_for,
x_simcore_parent_project_uuid=None,
x_simcore_parent_node_id=None,
x_simcore_parent_project_uuid=x_simcore_parent_project_uuid,
x_simcore_parent_node_id=x_simcore_parent_node_id,
user_id=user_id,
product_name=product_name,
)
Expand Down Expand Up @@ -471,8 +475,8 @@ async def run_function( # noqa: PLR0913
solver_service=solver_service,
job_service=job_service,
url_for=url_for,
x_simcore_parent_project_uuid=None,
x_simcore_parent_node_id=None,
x_simcore_parent_project_uuid=x_simcore_parent_project_uuid,
x_simcore_parent_node_id=x_simcore_parent_node_id,
)
await solvers_jobs.start_job(
request=request,
Expand Down
Loading
Loading