Skip to content

feat(api): split upload and result privileges for deployment #54

Description

@Sam123ben

Problem

The current ocr-service process initializes both signed upload/quarantine verification and normalized-result reading. In the reviewed runtime IAM matrix those capabilities are intentionally separated: kora-doc-signer may create quarantine objects while kora-doc-result-api may read result objects. One Pod has one Workload Identity, so deploying the current all-routes process requires broadening a reviewed identity across both data classes. That would violate the approved least-privilege and product-isolation design.

Required design

  • Expose an upload capability that owns only upload intent, uploaded-object verification and completion routes, runs as the product signer identity, and has no result-bucket access.
  • Expose a job/result capability that owns job creation/status/cancellation/result routes, runs as the result-reader identity, and has no quarantine read/write authority.
  • Preserve the versioned /v1/ocr contract behind a single internal gateway/route boundary; clients must not receive bucket credentials beyond the short-lived signed upload URL.
  • Make readiness capability-specific, preserve HMAC product/tenant verification and idempotency, and fail closed when a capability is unconfigured.
  • Extend tests to prove an upload identity cannot read results, a result identity cannot issue/read uploads, and a second tenant receives no resource existence signal.

Acceptance evidence

A synthetic sandbox PDF travels upload intent → create-only upload → scanner/accepted source → durable job → result retrieval without any workload identity having both quarantine and result-object privileges. Helm/IAM validation proves the split before GKE deployment.

Dependencies

Blocks the secure runtime deployment in #32. Aligns with the bucket/identity design tracked in tesserix/tesserix-k8s#914 and #946.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions