Skip to content

feat(api): Docker, env loading, secrets removal, route cleanup (Phase 3 — T3.0–T3.4) - #3

Open
canonical-muhammadbassiony wants to merge 1 commit into
feat/figma-phase-e-driftfrom
feat/phase-3-api-foundation
Open

feat(api): Docker, env loading, secrets removal, route cleanup (Phase 3 — T3.0–T3.4)#3
canonical-muhammadbassiony wants to merge 1 commit into
feat/figma-phase-e-driftfrom
feat/phase-3-api-foundation

Conversation

@canonical-muhammadbassiony

Copy link
Copy Markdown
Owner

Summary

Establishes the API foundation: Docker support, .env file loading, secrets removed from request bodies, and route consolidation.

Tasks Implemented

  • T3.0: Multi-stage Dockerfile (golang:1.22 builder + debian:bookworm-slim runtime with git, curl, GitHub CLI). .dockerignore excludes secrets and build artifacts. docker-build and docker-run Taskfile tasks added.
  • T3.1: github.com/joho/godotenv installed; cmd/app/main.go loads .env then .env.local before run(). .env committed with non-sensitive defaults.
  • T3.2: Removed GitHubToken, Credentials, OutputDir, LocalRepoPath from APIRequest. Handler resolves GitHub token via github.GetGitHubToken() and credentials from BAUER_CREDENTIALS_PATH/GOOGLE_APPLICATION_CREDENTIALS. firstNonEmpty/firstNonZero helpers for request-overrides-env semantics.
  • T3.3: Route renamed from /api/v1/workflow to POST /api/v1/workflows using Go 1.22 method+path routing.
  • T3.4: build-api task already present from prior branch.

Security

  • ✅ Credentials and tokens completely removed from request body struct
  • .env.local excluded from Docker image and git
  • ✅ Request body is now safe to log (no secrets)

Files Changed

  • Dockerfile, .dockerignore — new
  • Taskfile.ymldocker-build, docker-run tasks
  • .env — committed non-sensitive defaults
  • cmd/app/main.go — godotenv loading, route rename
  • internal/workflow/api.go — secrets removed from APIRequest
  • go.mod / go.sumgodotenv dependency

How to Review

git diff feat/figma-phase-e-drift..feat/phase-3-api-foundation -- .

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

T3.0: Dockerfile (golang:1.22 builder + debian:bookworm-slim runtime) with gh CLI
T3.0: .dockerignore excludes .env.local, secrets, build artifacts
T3.0: Taskfile docker-build and docker-run tasks
T3.1: godotenv loads .env then .env.local at API startup (optional files)
T3.1: .env committed with non-sensitive defaults
T3.2: APIRequest no longer accepts credentials or github_token fields
T3.2: handler reads creds from BAUER_CREDENTIALS_PATH env var
T3.3: /api/v1/workflow renamed to /api/v1/workflows
T3.3: Go 1.22 method+path routing, routes consolidated
T3.4: build-api Taskfile task added
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