Skip to content

Add ooniprobe private api - #1194

Open
aagbsn wants to merge 139 commits into
masterfrom
add_ooniprobe_private_api
Open

Add ooniprobe private api#1194
aagbsn wants to merge 139 commits into
masterfrom
add_ooniprobe_private_api

Conversation

@aagbsn

@aagbsn aagbsn commented Apr 28, 2026

Copy link
Copy Markdown
Contributor

Adds the private api endpoints to ooniprobe #807

test checklist for API endpoints:

  • /api/_/asn_by_month
  • /api/_/countries_by_month
  • /api/_/test_names
  • /api/_/countries
  • /api/_/check_report_id
  • /api/_/test_coverage
  • /api/_/website_networks
  • /api/_/vanilla_tor_stats
  • /api/_/network_stats
  • /api/_/global_overview
  • /api/_/global_overview_by_month
  • /api/_/circumvention_stats_by_country
  • /api/_/circumvention_runtime_stats
  • /api/_/domain_metadata
  • /api/_/asnmeta
  • /api/_/networks
  • /api/_/domains

endpoints that need implementation:

  • /api/_/quotas_summary

endpoints that do not work on api.ooni.org:

  • /api/_/website_stats
  • /api/_/website_urls
  • /api/_/im_networks
  • /api/_/im_stats
  • /api/_/country_overview

aagbsn added 28 commits July 15, 2026 13:31
this service does not terminate TLS so request.base_url's scheme is
http. This rewrites the URL using https.
.venv/lib/python3.13/site-packages/dateutil/tz/tz.py:37
  /project/ooniapi/services/ooniprobe/.venv/lib/python3.13/site-packages/dateutil/tz/tz.py:37: DeprecationWarning: datetime.datetime.utcfromtimestamp() is deprecated and scheduled for removal in a future version. Use timezone-aware objects to represent datetimes in UTC: datetime.datetime.fromtimestamp(timestamp, datetime.UTC).
unskip skipped tests, and adjust to the sample dataset
Unfortunately using AnyUrl as-is breaks the db query as the input field does not
include a trailing /, which we need to strip
inject fixed time for api tests

change isomid() to accept datetime or date objects and return normalized
datetime
adjust tests to sample data; rewrite query to use date range from input
this type is initialized with this field as None and used to compare
subsequent records; making it Optional quietens validation.

make test used fixed_time, adjust test values to sampled data
in api/ooniapi/private.py this is not set in the response, removing for
compatibility
asn_by_month, countries_by_month, global_overview_by_month
no_data must be three-tuple for model validator
model_date field referenced by alias name `date`
test_name is not a field of IMNetworkStats
fix query, pass parameters
validate each item in response contains at least one value
@aagbsn

aagbsn commented Jul 22, 2026

Copy link
Copy Markdown
Contributor Author

I noticed that the quotas summary endpoint isn't compatible with the new rate limiter middleware because it doesn't provide a way to summarize the quotas by address.

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