Skip to content

Commit

Permalink
Require OAuth for search engine checks
Browse files Browse the repository at this point in the history
Begin requiring OAuth for search engine checks.
This adds an extra validation step in checker.py.
It occurs after a cached result is checked for, which
allows unauthenticated viewers to still preview cached
results.
  • Loading branch information
ChlodAlejandro committed Oct 4, 2024
1 parent 280d804 commit 3c367f0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions copyvios/checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,10 @@ def _perform_check(query, page, use_engine, use_links):
_LOGGER.exception("Failed to retrieve cached results")

if not query.result:
if use_engine and not query.requester_username:
query.error = "not logged in"
return

try:
query.result = page.copyvio_check(
min_confidence=T_SUSPECT, max_queries=8, max_time=30,
Expand Down

0 comments on commit 3c367f0

Please sign in to comment.