about summary refs log tree commit diff
path: root/src/indieauth/mod.rs
diff options
context:
space:
mode:
authorVika <vika@fireburn.ru>2024-08-01 22:50:28 +0300
committerVika <vika@fireburn.ru>2024-08-02 16:13:39 +0300
commit2318a33f9b359ae27b52cd9a19db1f6782d8dae3 (patch)
tree5f4dc1ad73d5c4104679a1976781861ec23cb20e /src/indieauth/mod.rs
parent61a6bf6b80aea18d8b7af159d504004a29e50576 (diff)
Upgrade dependencies and fix deprecated functionality
I think I managed to not lose any functionality from my dependencies.

sqlparser remains unupgraded, but that's mostly because it is only
used in one example and it's not worth it to upgrade right now.
Diffstat (limited to 'src/indieauth/mod.rs')
-rw-r--r--src/indieauth/mod.rs11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/indieauth/mod.rs b/src/indieauth/mod.rs
index 2550df0..de4c367 100644
--- a/src/indieauth/mod.rs
+++ b/src/indieauth/mod.rs
@@ -1,13 +1,13 @@
 use std::marker::PhantomData;
-
 use microformats::types::Class;
 use tracing::error;
 use serde::Deserialize;
 use axum::{
-    extract::{Form, FromRef, Host, Json, Query, State}, headers::{authorization::Bearer, Authorization}, http::StatusCode, response::{Html, IntoResponse, Response}, Extension, TypedHeader
+    extract::{Form, FromRef, Host, Json, Query, State}, http::StatusCode, response::{Html, IntoResponse, Response}, Extension
 };
 #[cfg_attr(not(feature = "webauthn"), allow(unused_imports))]
 use axum_extra::extract::cookie::{CookieJar, Cookie};
+use axum_extra::{TypedHeader, headers::{authorization::Bearer, Authorization}};
 use crate::database::Storage;
 use kittybox_indieauth::{
     Metadata, IntrospectionEndpointAuthMethod, RevocationEndpointAuthMethod,
@@ -17,7 +17,6 @@ use kittybox_indieauth::{
     TokenIntrospectionRequest, TokenIntrospectionResponse, TokenRevocationRequest, TokenData
 };
 use std::str::FromStr;
-use std::ops::Deref;
 
 pub mod backend;
 #[cfg(feature = "webauthn")]
@@ -174,7 +173,7 @@ async fn authorization_endpoint_get<A: AuthBackend, D: Storage + 'static>(
 
                         mf2.items
                             .iter()
-                            .find(|&i| (**i).borrow().r#type.iter()
+                            .find(|&i| i.r#type.iter()
                                 .any(|i| {
                                     *i == Class::from_str("h-app").unwrap()
                                         || *i == Class::from_str("h-x-app").unwrap()
@@ -182,7 +181,7 @@ async fn authorization_endpoint_get<A: AuthBackend, D: Storage + 'static>(
                             )
                             .cloned()
                             .map(|i| {
-                                serde_json::to_value(i.borrow().deref()).unwrap()
+                                serde_json::to_value(&i).unwrap()
                             })
                     },
                     Err(err) => {
@@ -315,7 +314,7 @@ async fn authorization_endpoint_confirm<A: AuthBackend>(
     (StatusCode::NO_CONTENT,
      [("Location", location.as_str())],
      #[cfg(feature = "webauthn")]
-     cookies.remove(Cookie::named(webauthn::CHALLENGE_ID_COOKIE))
+     cookies.remove(Cookie::from(webauthn::CHALLENGE_ID_COOKIE))
     )
         .into_response()
 }