Skip to content

feat(errors): replace eprintln with tracing logs #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ reqwest = { version = "0.12", default-features = false, features = [
serde = { version = "1", features = ["derive"] }
thiserror = "2"
tokio = { version = "1", default-features = false, features = ["time"] }
tracing = { version = "0.1", features = ["log"] }

[dev-dependencies]
chrono = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# axum-jwt-auth

[![Rust](https://github.com/cmackenzie1/axum-jwt-auth/actions/workflows/rust.yml/badge.svg)](https://github.com/cmackenzie1/axum-jwt-auth/actions/workflows/rust.yml)
![Crates.io Version](https://img.shields.io/crates/v/axum-jwt-auth)
![docs.rs](https://img.shields.io/docsrs/axum-jwt-auth)
[![Crates.io Version](https://img.shields.io/crates/v/axum-jwt-auth)](https://crates.io/crates/axum-jwt-auth)
[![docs.rs](https://img.shields.io/docsrs/axum-jwt-auth)](https://docs.rs/axum-jwt-auth)

A simple middleware for extracting JWT tokens from requests and making them available to your handlers.
A Rust library providing JWT authentication middleware for Axum web applications. It supports both local and remote JWKS validation, handles token extraction and validation, and provides strongly-typed claims access in your request handlers. Built on top of jsonwebtoken, it offers a simple yet flexible API for securing your Axum routes with JWT authentication.

See [examples](./examples/) for how to use.

Expand Down
5 changes: 3 additions & 2 deletions src/remote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,10 @@ impl RemoteJwksDecoder {
Ok(_) => {}
Err(err) => {
// log the error and continue with stale keys
eprintln!(
tracing::error!(
"Failed to refresh JWKS after {} attempts: {:?}",
self.retry_count, err
self.retry_count,
err
);
}
}
Expand Down
Loading