feat(scraper): add LoginResult model and abstract login() interface

Problem: `:CP <platform> login` blindly caches credentials without
validating them against the platform.

Solution: add `LoginResult` to `models.py`, abstract `login()` method
and `_login_error` helper to `BaseScraper`, and wire up the `"login"`
CLI dispatch in `_run_cli_async`.
This commit is contained in:
Barrett Ruth 2026-03-05 14:59:46 -05:00
parent a202725cc5
commit dfb648531b
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
2 changed files with 24 additions and 1 deletions

View file

@ -64,6 +64,12 @@ class TestsResult(ScrapingResult):
model_config = ConfigDict(extra="forbid")
class LoginResult(ScrapingResult):
credentials: dict[str, str] = Field(default_factory=dict)
model_config = ConfigDict(extra="forbid")
class SubmitResult(ScrapingResult):
submission_id: str = ""
verdict: str = ""