You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-11-20 12:02:22 +03:00
Remove unnecessary boxing of warp filters
This was needed because of a compiler regression. Now that we're using Rust 1.58 there is no benefit to boxing them
This commit is contained in:
@@ -55,14 +55,7 @@ pub fn root(
|
|||||||
);
|
);
|
||||||
let static_files = static_files(config.http.web_root.clone());
|
let static_files = static_files(config.http.web_root.clone());
|
||||||
|
|
||||||
let filter = health
|
let filter = health.or(views).unify().or(static_files).unify().or(oauth2);
|
||||||
.or(views)
|
|
||||||
.unify()
|
|
||||||
.or(static_files)
|
|
||||||
.unify()
|
|
||||||
.boxed()
|
|
||||||
.or(oauth2)
|
|
||||||
.boxed();
|
|
||||||
|
|
||||||
filter.with(warp::log(module_path!())).boxed()
|
filter.with(warp::log(module_path!())).boxed()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,18 +53,13 @@ pub fn filter(
|
|||||||
let filter = discovery
|
let filter = discovery
|
||||||
.or(keys)
|
.or(keys)
|
||||||
.unify()
|
.unify()
|
||||||
.boxed()
|
|
||||||
.or(userinfo)
|
.or(userinfo)
|
||||||
.unify()
|
.unify()
|
||||||
.boxed()
|
|
||||||
.or(token)
|
.or(token)
|
||||||
.unify()
|
.unify()
|
||||||
.boxed()
|
|
||||||
.or(introspection)
|
.or(introspection)
|
||||||
.unify()
|
.unify()
|
||||||
.boxed()
|
.with(cors().allow_methods([Method::POST, Method::GET]));
|
||||||
.with(cors().allow_methods([Method::POST, Method::GET]))
|
|
||||||
.boxed();
|
|
||||||
|
|
||||||
filter.or(authorization).boxed()
|
filter.or(authorization).boxed()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,8 +47,16 @@ pub(super) fn filter(
|
|||||||
let logout = logout(pool, cookies_config);
|
let logout = logout(pool, cookies_config);
|
||||||
let reauth = reauth(pool, templates, csrf_config, cookies_config);
|
let reauth = reauth(pool, templates, csrf_config, cookies_config);
|
||||||
|
|
||||||
let f1 = index.or(account).unify().boxed();
|
index
|
||||||
let f2 = login.or(register).unify().boxed();
|
.or(account)
|
||||||
let f3 = logout.or(reauth).unify().boxed();
|
.unify()
|
||||||
f1.or(f2).unify().or(f3).unify().boxed()
|
.or(login)
|
||||||
|
.unify()
|
||||||
|
.or(register)
|
||||||
|
.unify()
|
||||||
|
.or(logout)
|
||||||
|
.unify()
|
||||||
|
.or(reauth)
|
||||||
|
.unify()
|
||||||
|
.boxed()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user