Skip to content

feat(figma): Figma in API endpoints, screenshot hosting (Phase F — T4F.1, T4F.2) - #6

Open
canonical-muhammadbassiony wants to merge 4 commits into
feat/phase-5-auth-securityfrom
feat/figma-phase-f-api
Open

feat(figma): Figma in API endpoints, screenshot hosting (Phase F — T4F.1, T4F.2)#6
canonical-muhammadbassiony wants to merge 4 commits into
feat/phase-5-auth-securityfrom
feat/figma-phase-f-api

Conversation

@canonical-muhammadbassiony

Copy link
Copy Markdown
Owner

Summary

Wires Figma support into the API endpoints and introduces a screenshot hosting interface, completing Phase F of spec 002.

Tasks Implemented

  • T4F.1: Wired Figma into both API endpoints. POST /api/v1/workflows now accepts optional figma_url field — piped through APIRequestWorkflowInput → orchestrator config. POST /api/v1/issues already had support from the issues handler.
  • T4F.2: Introduced ScreenshotHost interface (internal/artifacts/hosting.go) with three implementations:
    • LocalFileServer — serves screenshots from the artifacts directory (local dev)
    • NopHost — no-op when no hosting is configured
    • S3Host — stub for future S3 integration
    • HostFromEnv factory selects backend from BAUER_STATIC_BASE_URL / BAUER_S3_BUCKET
  • Static file server conditionally mounted at /static/ when BAUER_STATIC_BASE_URL is set.

Review Fixes (applied on this branch)

This branch also includes fixes found during the stack review:

  • Restored fs.Usage closure in cmd/bauer/main.go
  • Added nil-agent guard in cmd/app/v1/jira.go
  • Made OIDC middleware fail-closed in internal/auth/middleware.go
  • Added path traversal guard in internal/artifacts/hosting.go
  • Formatting cleanup across several files

Files Changed

  • internal/workflow/api.goFigmaURL in APIRequest and WorkflowInput
  • internal/workflow/workflow.goFigmaURL/FigmaToken in WorkflowInput
  • internal/artifacts/hosting.goScreenshotHost interface + implementations
  • cmd/app/v1/issues.goformatIssueBodyWithHosting
  • cmd/app/main.go/static/ file server route
  • .env.exampleBAUER_STATIC_BASE_URL, BAUER_S3_BUCKET, BAUER_S3_REGION

How to Review

git diff feat/phase-5-auth-security..feat/figma-phase-f-api -- .

Part of the Bauer v2 stacked PR series (Branch 12 of 12).

Bauer Agent added 4 commits May 20, 2026 14:16
…nterface

T4F.1: IssueRequest and APIRequest/WorkflowRequest accept figma_url (optional)
T4F.1: handlers set cfg.FigmaURL and cfg.FigmaToken from BAUER_FIGMA_TOKEN env var
T4F.1: BAUER_FIGMA_TOKEN documented in .env.example
T4F.2: ScreenshotHost interface in internal/artifacts/hosting.go
T4F.2: LocalFileServer, NopHost, S3Host (stub) implementations
T4F.2: HostFromEnv selects backend from BAUER_STATIC_BASE_URL / BAUER_S3_BUCKET
T4F.2: IssuesHandler uses HostFromEnv; warns when no hosting configured with figma_url
T4F.2: /static/ route serves artifact dir when BAUER_STATIC_BASE_URL is configured
- cmd/bauer/main.go: restore fs.Usage closure (help text was printing unconditionally)
- cmd/app/v1/jira.go: add nil-agent guard (prevent panic on NewClient failure)
- internal/auth/middleware.go: fail-closed when OIDC configured but JWKS fetch fails
- internal/artifacts/hosting.go: reject path traversal in LocalFileServer.Host()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant