refactor(csrf): consume dunite-core OriginGuard, drop bunyip-api copy #493

Merged
nrupard merged 1 commit from feat/DEV-526-consume-dunite-csrf into main 2026-08-06 16:49:21 +02:00
Owner

What

Consumes the dunite-core CSRF guard (dunite #36, DEV-526) and removes bunyip-api's local copy.

  • bunyip-api depends on dunite-core directly; main.rs wires dunite_core::middleware::OriginGuard::new(&cors_origins, &CSRF_EXEMPT_PREFIXES, &CSRF_AMBIENT_COOKIES).
  • The app-specific lists stay in bunyip wiring: exempt prefixes /oauth2/, /.well-known/, /v1/webhooks/stripe; ambient cookies access_token, refresh_token.
  • bunyip-api/src/csrf.rs (385 LOC) and its pub mod csrf; are deleted; the eleven guard tests now live in dunite-core.

Pins

The dunite-core graph (dunite-core, dunite-download, dunite-oci, dunite-oidc) moves to 90a828f as one rev so a single dunite-core resolves. The independent leaf crates (dunite-user-core, dunite-stripe-core, dunite-stripe, dunite-feedback, dunite-geoip, dunite-ipenrich, dunite-image-upload) stay at ae62c27. This is deliberate: it does NOT cross dunite's unrelated SubscriptionTier -> MembershipTier rename (dunite #35), which is the bunyip-side BUNYIP-488's job.

Validation

just check-container green in the pinned rust-builder image: cargo fmt --all --check, cargo clippy --workspace --all-targets -- -D warnings, cargo test --workspace --all-targets - every suite 0 failed. Net -367 lines.

#DEV-526

## What Consumes the dunite-core CSRF guard (dunite #36, DEV-526) and removes bunyip-api's local copy. - bunyip-api depends on `dunite-core` directly; `main.rs` wires `dunite_core::middleware::OriginGuard::new(&cors_origins, &CSRF_EXEMPT_PREFIXES, &CSRF_AMBIENT_COOKIES)`. - The app-specific lists stay in bunyip wiring: exempt prefixes `/oauth2/`, `/.well-known/`, `/v1/webhooks/stripe`; ambient cookies `access_token`, `refresh_token`. - `bunyip-api/src/csrf.rs` (385 LOC) and its `pub mod csrf;` are deleted; the eleven guard tests now live in dunite-core. ## Pins The dunite-core graph (`dunite-core`, `dunite-download`, `dunite-oci`, `dunite-oidc`) moves to `90a828f` as one rev so a single dunite-core resolves. The independent leaf crates (`dunite-user-core`, `dunite-stripe-core`, `dunite-stripe`, `dunite-feedback`, `dunite-geoip`, `dunite-ipenrich`, `dunite-image-upload`) stay at `ae62c27`. This is deliberate: it does NOT cross dunite's unrelated `SubscriptionTier` -> `MembershipTier` rename (dunite #35), which is the bunyip-side BUNYIP-488's job. ## Validation `just check-container` green in the pinned rust-builder image: `cargo fmt --all --check`, `cargo clippy --workspace --all-targets -- -D warnings`, `cargo test --workspace --all-targets` - every suite 0 failed. Net -367 lines. #DEV-526
refactor(csrf): consume dunite-core OriginGuard, drop bunyip-api copy
All checks were successful
E2E / PR gate (pull_request) Successful in 25s
Check / fmt + clippy + build + tests (pull_request) Successful in 15m23s
Create release / Create release from merged PR (pull_request) Has been skipped
b7460947b6
The Origin/Referer CSRF guard moved to dunite-core::middleware in dunite (DEV-526). bunyip-api now depends on dunite-core directly and wires dunite_core::middleware::OriginGuard::new(&cors_origins, ..), passing its app-specific exempt prefixes (/oauth2/, /.well-known/, /v1/webhooks/stripe) and ambient cookie names (access_token, refresh_token) as constructor args. bunyip-api/src/csrf.rs and its pub mod csrf; are removed; the eleven guard tests now live in the dunite crate.

The dunite-core graph pins (dunite-core, dunite-download, dunite-oci, dunite-oidc) move together to 90a828f so a single dunite-core resolves. The independent leaf crates (dunite-user-core, stripe-core, stripe, feedback, geoip, ipenrich, image-upload) stay at ae62c27, so this bump does not cross the unrelated dunite-user-core SubscriptionTier->MembershipTier rename.

#DEV-526
nrupard deleted branch feat/DEV-526-consume-dunite-csrf 2026-08-06 16:49:21 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
psa-systems/bunyip!493
No description provided.