Repository navigation
feat: E2E testing, API key auth, and production deployment - #8
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Validates every field the iOS app depends on across /health, /analyze, and /interactions. Supports optional X-API-Key header for auth testing post-middleware deployment. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Protects /analyze and /interactions with X-API-Key header. Health endpoints remain public. Auth disabled when API_KEY env var is not set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
RxNorm's /approximateTerm always returns candidates for any input, including common English words that fuzzy-match brand names (e.g. "hello" → "Hello Bello" at score 3.98). This caused the /analyze endpoint to return phantom results with empty drug names for non-drug text. Two fixes: 1. Add score field to DrugInfo (parsed from approximateTerm response) 2. Reject fallback candidates with score < 6.0 (real drug names score 10+) 3. Skip results where the resolved drug name is empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
nginx: HTTP→HTTPS redirect, SSL termination with Let's Encrypt, API-only reverse proxy (no frontend). docker-compose: expose port 8000 internally only, mount Let's Encrypt certs into nginx, pass API_KEY env var to API container. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Runs pytest on push/PR to main and feature branches. Deploys to production server via SSH on push to main only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Base docker-compose.yml now uses expose instead of ports (production security). CI override must explicitly publish 8000 so smoke tests can reach the API from localhost. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove feature branch triggers — CI runs when a PR targets main and on push to main (post-merge deploy). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Remove redundant ci-cd.yml. Add deploy job to existing ci-tests.yml, running after integration tests pass, on push to main only. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use event_name == 'push' instead of just checking ref, so the intent is clear: deploy only fires on merge to main, never on PRs. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
End-to-end testing, API key authentication, and production deployment preparation.
Completed
scripts/e2e-test.sh) — validates full API contract (all DrugResult and InteractionResult fields the iOS app depends on), optionalX-API-Keyauth testingapp/middleware/api_key.py) — protects/analyzeand/interactionswithX-API-Keyheader; health endpoints remain public; auth disabled whenAPI_KEYenv var is unsetPending (server tasks — to be done manually)
Test plan
uv run pytest)bash scripts/e2e-test.sh https://pillchecker.duckdns.org $API_KEY)🤖 Generated with Claude Code