Skip to content

feat(public): add fuzzed /public/location endpoint for Constellation - #49

Merged
danielroberts20 merged 1 commit into
tailscale-migrationfrom
feat/public-location-endpoint
Sep 29, 2026
Merged

danielroberts20 merged 1 commit into
tailscale-migrationfrom
feat/public-location-endpoint

Conversation

@danielroberts20

Copy link
Copy Markdown
Owner

Summary

  • Adds unauthenticated GET /public/location returning the latest location, or with ?since= a downsampled history array
  • Coordinates are always randomly jittered (random distance up to PUBLIC_LOCATION_FUZZ_RADIUS_KM, random bearing) before leaving the module — never raw
  • History is downsampled using the existing LOCATION_CHANGE_RADIUS_M movement threshold plus a new PUBLIC_LOCATION_HISTORY_DOWNSAMPLE_MINUTES config, so genuine movement isn't smoothed away
  • Built for Constellation's "how far apart are we" stat

Test plan

  • pytest server/tests/test_public_location.py — 13/13 passing
  • Manual check against a running instance: curl /public/location and curl /public/location?since=...

🤖 Generated with Claude Code

Exposes latest and historical location as randomly-jittered coordinates
(never raw) for Constellation's "how far apart are we" stat. Jitter
distance/bearing is randomised per call so repeated requests can't be
averaged out to recover the real point. History is downsampled using
the existing LOCATION_CHANGE_RADIUS_M movement threshold so genuine
movement survives while dense stationary points collapse.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying travelnet-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3323034
Status:🚫  Build failed.

View logs

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying travelnet with  Cloudflare Pages  Cloudflare Pages

Latest commit: 3323034
Status: ✅  Deploy successful!
Preview URL: https://2b434bfe.travelnet.pages.dev
Branch Preview URL: https://feat-public-location-endpoin.travelnet.pages.dev

View logs

@danielroberts20
danielroberts20 merged commit da80d92 into tailscale-migration Sep 29, 2026
3 of 4 checks 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