Skip to content

Deploy private work-engine Lambda behind portal broker #49

Description

@alexeygrigorev

Goal

Deploy the DataTasks work-engine as a private runtime service behind the existing DataOps portal so operators get one authenticated experience at ops.dtcdev.click.

The public surface remains the current Python full app Lambda. The work engine is invoked only by the portal backend, not exposed as a second public Function URL.

Decision Inputs

Scope

  • Add a SAM-managed private WorkEngineFunction for the Node work-engine.
  • Add IAM permission for DocsFullAppFunction to invoke WorkEngineFunction.
  • Add authenticated /work/api/* broker routes in the Python full app.
  • Strip the /work prefix before forwarding requests to the work engine.
  • Pass trusted actor/context headers from the authenticated portal session.
  • Add a work-engine production auth mode that trusts only the portal broker, gated by environment variables.
  • Keep the existing frontend shell as the public UI entry point.

Acceptance Criteria

  • GET /work and /work/* serve the portal frontend without bypassing portal auth.
  • ANY /work/api/* authenticates in the Python full app, invokes the private work-engine Lambda, and returns status, headers, and JSON bodies correctly.
  • Work-engine Lambda has no public Function URL or direct unauthenticated endpoint.
  • Production does not use SKIP_AUTH=true.
  • Broker forwards method, path, query string, selected headers, and body without leaking session secrets.
  • Work-engine receives a stable trusted actor context, initially acceptable as portal-admin if per-user identity is not ready.
  • Local development remains possible without AWS Lambda invocation.
  • CI covers broker routing, unauthorized access, successful proxied API call, and work-engine health check.
  • Deployment template validates with SAM/CloudFormation checks.

Out Of Scope

Dependencies

Test Expectations

  • Python tests for /work/api/* auth and broker behavior.
  • Node tests for trusted portal auth mode.
  • Integration smoke test for /work/health after deploy.
  • CI step that builds both the Python full app and the Node work-engine package.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P0Must havebackendBackend/APIinfraDeployment and infrastructureportalShared portal shell and UXtestingTests and QAwork-engineDataTasks task execution engine

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions