Skip to content
This repository was archived by the owner on Jan 16, 2026. It is now read-only.

Migrate to Askama 0.14 + Dependency Updates & Auth Refactor#1

Open
uggla wants to merge 10 commits intoNeo-Ciber94:mainfrom
uggla:main
Open

Migrate to Askama 0.14 + Dependency Updates & Auth Refactor#1
uggla wants to merge 10 commits intoNeo-Ciber94:mainfrom
uggla:main

Conversation

@uggla
Copy link

@uggla uggla commented Aug 4, 2025

Migrate to Askama 0.14 + Dependency Updates & Auth Refactor

This PR performs a full upgrade of the template rendering stack by migrating from askama 0.12 to askama 0.14, along with a set of other important dependency updates. Key changes include:


🔧 Major Changes

  • Askama 0.14 migration:

    • Removed askama_axum, which is no longer necessary.
    • All IntoResponse implementations were updated to use axum directly.
    • Template rendering now uses .render().unwrap().into_response() in places where askama_axum was previously used.
  • OAuth logic refactor:

    • Updated oauth2 to v5.0.0, which brings a new API.
    • Rewrote the OAuth setup for Discord, GitHub, and Google to use the new BasicClient builder style.
    • Replaced the deprecated async_http_client with a custom reqwest client (with redirects disabled for safety).
  • Middleware fixes:

    • Option<CurrentUser> is no longer usable in middleware due to trait constraints in the updated axum version.
    • Refactored auth_middleware logic accordingly.
  • Add image proxy route:

    • A new route allows serving Google-hosted images via proxy to avoid mixed content or CORS issues.

📦 Dependency Updates

  • askama → 0.14
  • axum → 0.8.4
  • axum-extra → 0.10.1
  • oauth2 → 5.0.0
  • reqwest → 0.12.22
  • sqlx → 0.8.6
  • tower, tower-http, uuid, tracing, tracing-subscriber, serde, serde_json, anyhow – all bumped to latest versions

🧹 Cleanup

  • Removed deprecated or unused crates: askama_axum, askama_escape, humansize, etc.
  • Bumped Rust edition to 2024.

Let me know if you'd like to split this PR further or squash the commits before merge.

uggla added 10 commits August 2, 2025 18:36
- Bumped askama to 0.14.0 and removed askama_axum, as it's no longer needed.
- Updated axum and axum-extra to latest compatible versions.
- Refactored all IntoResponse impls to use axum's version directly.
- Rewrote OAuth client setup for discord, github, and google auth routes to match new oauth2 5.0 API.
- Replaced async_http_client with reqwest client for token exchange, avoiding deprecated pattern.
- Cleaned up imports and removed now-unused deps like askama_escape and humansize.
- Bumped edition to 2024.
- Fixed the logic for `auth_middleware`: `Option<CurrentUser>` can no longer be used as middleware input.
- Add a proxy route to load images from Google.
- Remove serde_json and tower, not needed.
- Bump:
- anyhow "1.0.98" to "1.0.99"
- chrono "0.4.31" to "0.4.41"
- cookie "0.18.0" to "0.18.1"
- reqwest "0.12.22" to "0.12.23"
- tokio "1.34.0" to "1.47.1"
- uuid "1.17.0" to "1.18.0"
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant