cp.nvim/scrapers
Barrett Ruth 2c119774df
feat: validate credentials on :CP <platform> login (#310)
## Problem

`:CP <platform> login` blindly caches username/password without
server-side
validation. Bad credentials are only discovered at submit time, which is
confusing and wastes a browser session.

## Solution

Wire `:CP <platform> login` through the scraper pipeline so each
platform
actually authenticates before persisting credentials. On failure, the
user
sees an error and nothing is cached.

- CSES: reuses `_check_token` (fast path) and `_web_login`; returns API
token
  in `LoginResult.credentials` so subsequent submits skip re-auth.
- AtCoder/Codeforces: new `_login_headless` functions open a
StealthySession,
solve Turnstile/Cloudflare, fill the login form, and validate success by
  checking for the logout link. Cookies only persist on confirmed login.
- CodeChef/Kattis/USACO: return "not yet implemented" errors.
- `scraper.lua`: generalizes submit-only guards (`needs_browser` flag)
to
  cover both `submit` and `login` subcommands.
- `credentials.lua`: prompts for username/password, passes cached token
for
CSES fast path, shows ndjson status notifications, only caches on
success.
2026-03-05 15:12:09 -05:00
..
__init__.py lol 2025-09-24 21:23:06 -04:00
atcoder.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
base.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
codechef.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
codeforces.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
cses.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
kattis.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
language_ids.py feat(atcoder): extract submit helpers; add live status notifications (#294) 2026-03-04 19:27:29 -05:00
models.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
timeouts.py fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
usaco.py feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00