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:
parent
a202725cc5
commit
dfb648531b
2 changed files with 24 additions and 1 deletions
|
|
@ -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 = ""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue