Skip to content

fix: movement export is now a POST guarded by a CSRF token#89

Open
Mincka wants to merge 1 commit into
azerpas:mainfrom
Mincka:fix/movement-export-post-token
Open

fix: movement export is now a POST guarded by a CSRF token#89
Mincka wants to merge 1 commit into
azerpas:mainfrom
Mincka:fix/movement-export-post-token

Conversation

@Mincka

@Mincka Mincka commented Jul 23, 2026

Copy link
Copy Markdown

BoursoBank changed the CSV movement export flow: the old
GET /budget/exporter-mouvements?movementSearch[...] now 302-redirects to the
HTML form page /mon-budget/generate, so get_transactions hits the
"HTML => no transactions" branch and silently returns an empty list for every
account.

Reproducible on v0.5.4: bourso-cli export transactions returns
Found 0 transactions for an account that actually has 77.

Fix

  • GET the export form, scrape movementSearch[_token], then POST
    /budget/exporter-mouvements with the token and the renamed fields
    (filtredBy=filtredByCategory, category).
  • A genuinely empty period still bounces to the export form (return empty); an
    HTML page without the form (expired session / changed flow) now errors
    instead of silently reporting zero, so callers don't overwrite good data with
    nothing.
  • Adds unit tests for the token extraction.

Verified against a live account: 0 → 77 transactions; cargo test green.

BoursoBank changed the CSV movement export flow: the old
`GET /budget/exporter-mouvements?movementSearch[...]` now 302-redirects to the
HTML form page `/mon-budget/generate`, so `get_transactions` hit the
"HTML => no transactions" branch and silently returned an empty list for EVERY
account (reproducible on v0.5.4: `export transactions` returns 0 for an account
that has 77).

Fix: GET the export form, scrape `movementSearch[_token]`, then POST
`/budget/exporter-mouvements` with the token and the renamed fields
(`filtredBy=filtredByCategory`, `category`). A genuinely empty period still
bounces to the export form (return empty); an HTML page WITHOUT the form
(expired session / changed flow) now errors instead of silently reporting zero,
so callers don't overwrite good data with nothing.

Adds unit tests for the token extraction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@Mincka
Mincka force-pushed the fix/movement-export-post-token branch from 6cb8a1b to 72cc2d4 Compare July 23, 2026 08:52
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