Skip to content

feat: add API safety gates#28

Merged
maotora merged 11 commits intomainfrom
codex/api-safety-gates
Mar 25, 2026
Merged

feat: add API safety gates#28
maotora merged 11 commits intomainfrom
codex/api-safety-gates

Conversation

@maotora
Copy link
Copy Markdown
Contributor

@maotora maotora commented Mar 25, 2026

Summary

  • add API-side safety gates with request body limits and route-specific rate limiting
  • keep /v1 as canonical while preserving /api compatibility behavior and headers
  • harden Prisma connection handling for direct Postgres vs Prisma Accelerate
  • add local git hooks and isolated pre-push database verification
  • add rate limit coverage and CI/build flow fixes

Verification

  • pnpm build:ci
  • DIRECT_DATABASE_URL='postgresql://maotora@localhost:5432/locations_api' pnpm hooks:pre-push

Production Smoke Checks

Ran read-only app-level smoke checks against the database configured in .env:

  • /health
  • /v1/countries
  • /api/countries
  • /v1/countries/210/regions
  • /v1/regions/21
  • /v1/districts?countryId=210&regionCode=21
  • /v1/wards?countryId=210&districtCode=217
  • /v1/places?countryId=210&wardCode=21713
  • /v1/regions/21/districts
  • /v1/districts/217/wards
  • /v1/wards/21713/places
  • /v1/places/52725
  • /v1/search?q=dodoma
  • /v1/search?q=nzuguni's

All returned 200 as expected for the current read/search API surface.

@maotora maotora temporarily deployed to codex/api-safety-gates - locations-API PR #28 March 25, 2026 07:38 — with Render Destroyed
@maotora maotora merged commit 10c7476 into main Mar 25, 2026
1 check passed
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