Email addresses kept out of logs, and safer news and maintenance work
Security
Why it matters: Players' email addresses are better protected, and the site's news and data are less exposed to mistakes or misuse.
We made three behind-the-scenes changes that make the site safer:
- When we send tournament emails, our records now identify each recipient by an internal account number, not their email address.
- The news shown on the site is now fetched only from the source we expect, and only over a secure connection.
- The manual maintenance tasks that change data now need an extra, explicit confirmation before they can run on the live site, so they can’t be run there by accident.
Under the hood: Each fix was written test-first. New automated tests also cover the work that runs in the background, including live score updates, player stats, tournament emails and the regular clean-up of old data. We then broke each covered rule on purpose to check that a test would catch it.
Commits (1)
-
3fcd4b7Jobs tests (phase 3): background work pinned; three security fixes
Files Changed (30)
CLAUDE.md | 1 + app/jobs/send_event_emails_job.rb | 3 +- app/services/news_snippet_ingestion_service.rb | 24 +++- docs/background_jobs.md | 90 +++++++++++++ lib/tasks/db.rake | 5 + lib/tasks/list_suspicious_users.rake | 3 + lib/tasks/production_guard.rb | 12 ++ lib/tasks/test_scraper.rake | 3 + lib/tasks/tournament_archive_verify.rake | 3 + lib/tasks/tournament_cuts.rake | 3 + lib/tasks/user_handles.rake | 3 + lib/tasks/user_tournament_stats.rake | 4 + test/controllers/admin/events_coverage_test.rb | 37 +----- test/fixtures/files/espn/leaderboard.html | 27 ++++ test/fixtures/files/espn/leaderboard_pre.html | 39 ++++++ test/jobs/purge_archived_groups_job_test.rb | 31 +++++ test/jobs/purge_stale_unverified_users_job_test.rb | 59 +++++++++ test/jobs/score_scrape_job_test.rb | 59 +++++++++ test/jobs/send_event_emails_job_test.rb | 84 ++++++++++++ test/lib/tasks/rake_tasks_test.rb | 73 +++++++++++ test/models/event_scoring_window_test.rb | 64 +++++++++ test/models/golfer_name_matcher_test.rb | 88 +++++++++++++ test/models/tournament_team_score_test.rb | 42 ++++++ test/services/event_scraping_service_test.rb | 55 ++++++++ .../news_snippet_ingestion_service_test.rb | 39 ++++++ test/services/score_update_service_test.rb | 118 +++++++++++++++++ test/services/tournament_scraper_service_test.rb | 216 ++++++++++++++++++++++++++++++ .../tournament_state_service_coverage_test.rb | 121 +++++++++++++++++ .../user_tournament_stats_service_test.rb | 60 +++++++++ test/support/scoring_helpers.rb | 41 ++++++ 30 files changed, 1367 insertions(+), 40 deletions(-)