flip_api.step_functions_services.approve_project_step_function

Attributes

router

Functions

process_trust(→ dict[str, Any])

Process a single trust by starting the imaging project creation.

approve_project_step_function_endpoint(, user_id, Any])

Approves a project and starts image creation on all connected trusts

Module Contents

flip_api.step_functions_services.approve_project_step_function.router
async flip_api.step_functions_services.approve_project_step_function.process_trust(request: fastapi.Request, project_id: uuid.UUID, trust: Any, db: sqlmodel.Session, user_id: uuid.UUID) dict[str, Any]

Process a single trust by starting the imaging project creation.

Parameters:
  • request (Request) – The FastAPI request object.

  • project_id (UUID) – The ID of the project.

  • trust – The trust object to process.

  • db (Session) – The database session.

  • user_id (UUID) – The ID of the current user.

Returns:

A dictionary containing the result of the imaging creation for the trust.

Return type:

dict

async flip_api.step_functions_services.approve_project_step_function.approve_project_step_function_endpoint(project_id: uuid.UUID, body: flip_api.domain.schemas.private.ProjectApprovalBody, request: fastapi.Request, db: sqlmodel.Session = Depends(get_session), user_id: uuid.UUID = Depends(verify_token)) dict[str, Any]

Approves a project and starts image creation on all connected trusts

This mimics the AWS Step Functions workflow defined in approveProject.yml

Parameters:
  • project_id (UUID) – The ID of the project to approve.

  • body (ProjectApprovalBody) – The body containing trust IDs to process.

  • request (Request) – The FastAPI request object.

  • db (Session) – The database session.

  • user_id (UUID) – The ID of the current user.

Returns:

A dictionary containing the result of the approval and imaging creation process.

Return type:

dict[str, Any]

Raises:

HTTPException – If an error occurs during the approval or imaging creation process.