mirror of
https://github.com/LukeMathWalker/zero-to-production.git
synced 2024-12-18 14:06:37 +00:00
Update to actix-web v4
This commit is contained in:
parent
9a858dade4
commit
4c86217f2b
3 changed files with 369 additions and 291 deletions
652
Cargo.lock
generated
652
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -13,7 +13,7 @@ path = "src/main.rs"
|
|||
name = "zero2prod"
|
||||
|
||||
[dependencies]
|
||||
actix-web = "=4.0.0-beta.19"
|
||||
actix-web = "4"
|
||||
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
|
||||
serde = "1.0.115"
|
||||
config = { version = "0.11", default-features = false, features = ["yaml"] }
|
||||
|
@ -34,7 +34,7 @@ rand = { version = "0.8", features=["std_rng"] }
|
|||
anyhow = "1.0.40"
|
||||
base64 = "0.13.0"
|
||||
argon2 = { version = "0.3", features = ["std"] }
|
||||
tracing-actix-web = "=0.5.0-beta.9"
|
||||
tracing-actix-web = "0.5"
|
||||
secrecy = { version = "0.8", features = ["serde"] }
|
||||
|
||||
[dev-dependencies]
|
||||
|
|
|
@ -6,7 +6,7 @@ use actix_web::http::{
|
|||
header::{HeaderMap, HeaderValue},
|
||||
StatusCode,
|
||||
};
|
||||
use actix_web::{web, HttpResponse, ResponseError};
|
||||
use actix_web::{web, HttpResponse, HttpRequest, ResponseError};
|
||||
use anyhow::Context;
|
||||
use argon2::{Argon2, PasswordHash, PasswordVerifier};
|
||||
use secrecy::{ExposeSecret, Secret};
|
||||
|
@ -174,7 +174,7 @@ pub async fn publish_newsletter(
|
|||
body: web::Json<BodyData>,
|
||||
pool: web::Data<PgPool>,
|
||||
email_client: web::Data<EmailClient>,
|
||||
request: web::HttpRequest,
|
||||
request: HttpRequest,
|
||||
) -> Result<HttpResponse, PublishError> {
|
||||
let credentials = basic_authentication(request.headers()).map_err(PublishError::AuthError)?;
|
||||
tracing::Span::current().record("username", &tracing::field::display(&credentials.username));
|
||||
|
|
Loading…
Reference in a new issue