Skip to content

Commit

Permalink
chore: Update axum to 0.8
Browse files Browse the repository at this point in the history
Fixes #115.
  • Loading branch information
RemiBardon committed Jan 17, 2025
1 parent ba066d4 commit 36458aa
Show file tree
Hide file tree
Showing 26 changed files with 30 additions and 53 deletions.
37 changes: 19 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ repository = "https://github.com/prose-im/prose-pod-api.git"
[workspace.dependencies]
anyhow = { version = "1", default-features = false }
async-trait = { version = "0.1", default-features = false }
axum = { version = "0.7", default-features = false }
axum-extra = { version = "0.9", default-features = false }
axum-test = { version = "16", default-features = false }
axum = { version = "0.8", default-features = false }
axum-extra = { version = "0.10", default-features = false }
axum-test = { version = "17", default-features = false }
base64 = { version = "0.22", default-features = false }
chrono = { version = "0.4", default-features = false }
cucumber = { version = "0.21", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/auth_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::auth::AuthService {
type Rejection = Infallible;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/auth_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use crate::guards::prelude::*;

const PREFIX: &'static str = "Bearer ";

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::auth::auth_service::AuthToken {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/authenticated.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ use crate::guards::prelude::*;
/// [`MemberService`]: service::members::MemberService
pub struct Authenticated;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for Authenticated {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/basic_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub struct BasicAuth {
pub password: SecretString,
}

#[async_trait::async_trait]
impl FromRequestParts<AppState> for BasicAuth {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/is_admin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ use crate::guards::prelude::*;
/// but it'll do for now.
pub struct IsAdmin;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for IsAdmin {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/auth/guards/user_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use service::auth::auth_service::AuthToken;

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::auth::UserInfo {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/features/init/guards/init_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::init::InitService {
type Rejection = Infallible;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use service::members::UnauthenticatedMemberService;

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::invitations::InvitationService {
type Rejection = Infallible;

Expand Down
10 changes: 5 additions & 5 deletions crates/rest-api/src/features/invitations/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,20 @@ pub(super) fn router(app_state: AppState) -> axum::Router {
.get(get_invitations_route),
)
.route(
"/:invitation_id",
"/{invitation_id}",
MethodRouter::new()
.get(get_invitation_route)
.delete(invitation_cancel_route),
)
.route("/:invitation_id/resend", post(invitation_resend_route))
.route("/{invitation_id}/resend", post(invitation_resend_route))
.route_layer(from_extractor_with_state::<IsAdmin, _>(app_state.clone())),
)
.nest(
"/v1/invitation-tokens",
axum::Router::new()
.route("/:token/details", get(get_invitation_by_token_route))
.route("/:token/accept", put(invitation_accept_route))
.route("/:token/reject", put(invitation_reject_route)),
.route("/{token}/details", get(get_invitation_by_token_route))
.route("/{token}/accept", put(invitation_accept_route))
.route("/{token}/reject", put(invitation_reject_route)),
)
.with_state(app_state)
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use service::{auth::UserInfo, members::MemberServiceContext, xmpp::XmppService};

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::members::MemberService {
type Rejection = error::Error;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::members::UnauthenticatedMemberService {
type Rejection = Infallible;

Expand Down
6 changes: 3 additions & 3 deletions crates/rest-api/src/features/members/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ pub use self::get_members::*;
pub use self::model::*;

pub(crate) const MEMBERS_ROUTE: &'static str = "/v1/members";
pub(crate) const MEMBER_ROUTE: &'static str = "/v1/members/:jid";
pub(crate) const MEMBER_ROUTE: &'static str = "/v1/members/{jid}";

pub(super) fn router(app_state: AppState) -> axum::Router {
axum::Router::new()
Expand All @@ -43,9 +43,9 @@ pub(super) fn router(app_state: AppState) -> axum::Router {
MEMBERS_ROUTE,
axum::Router::new()
.route("/", get(get_members_route))
.route("/:jid", get(get_member_route))
.route("/{jid}", get(get_member_route))
.route(
"/:jid",
"/{jid}",
delete(delete_member_route)
.route_layer(from_extractor_with_state::<IsAdmin, _>(app_state.clone())),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use service::network_checks::NetworkChecker;

use crate::guards::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for NetworkChecker {
type Rejection = Infallible;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use service::{

use crate::{error::prelude::*, guards::prelude::*};

#[async_trait::async_trait]
impl FromRequestParts<AppState> for WorkspaceService {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/app_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::AppConfig {
type Rejection = Infallible;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/notification_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::notifications::NotificationService {
type Rejection = Infallible;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/pod_network_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::features::init::PodAddressNotInitialized;

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::network_checks::PodNetworkConfig {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/secrets_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::secrets::SecretsStore {
type Rejection = Infallible;

Expand Down
2 changes: 0 additions & 2 deletions crates/rest-api/src/guards/server_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use crate::features::init::ServerConfigNotInitialized;

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for server_config::Model {
type Rejection = error::Error;

Expand All @@ -24,7 +23,6 @@ impl FromRequestParts<AppState> for server_config::Model {
}
}

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::server_config::ServerConfig {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/server_ctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::xmpp::ServerCtl {
type Rejection = Infallible;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/server_manager.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use service::server_config::entities::server_config;

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::xmpp::ServerManager {
type Rejection = error::Error;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/guards/uuid_generator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for service::dependencies::Uuid {
type Rejection = Infallible;

Expand Down
2 changes: 0 additions & 2 deletions crates/rest-api/src/guards/xmpp_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ use service::{

use super::prelude::*;

#[async_trait::async_trait]
impl FromRequestParts<AppState> for XmppService {
type Rejection = error::Error;

Expand All @@ -29,7 +28,6 @@ impl FromRequestParts<AppState> for XmppService {
}
}

#[async_trait::async_trait]
impl FromRequestParts<AppState> for XmppServiceInner {
type Rejection = Infallible;

Expand Down
1 change: 0 additions & 1 deletion crates/rest-api/src/util/content_type_or.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ where

pub struct WithContentType<C>(PhantomData<C>);

#[async_trait::async_trait]
impl<S, C> FromRequestParts<S> for WithContentType<C>
where
C: ContentType,
Expand Down

0 comments on commit 36458aa

Please sign in to comment.