@@ -10,7 +10,7 @@ use axum::{
1010use std:: sync:: Arc ;
1111
1212use crate :: common:: di:: AppState ;
13- use crate :: interfaces:: middleware:: auth:: CurrentUser ;
13+ use crate :: interfaces:: middleware:: auth:: { AuthUser , CurrentUser } ;
1414use crate :: interfaces:: middleware:: rate_limit:: { RateLimiter , rate_limit_login} ;
1515use crate :: interfaces:: nextcloud:: avatar_handler;
1616use crate :: interfaces:: nextcloud:: basic_auth_middleware:: basic_auth_middleware;
@@ -176,7 +176,7 @@ fn verify_url_user(url_user: &str, auth_user: &CurrentUser) -> Result<(), Respon
176176async fn handle_dav_files (
177177 State ( state) : State < Arc < AppState > > ,
178178 Path ( ( url_user, subpath) ) : Path < ( String , String ) > ,
179- user_ext : CurrentUser ,
179+ user_ext : AuthUser ,
180180 req : Request < Body > ,
181181) -> Result < Response , Response > {
182182 verify_url_user ( & url_user, & user_ext) ?;
@@ -188,7 +188,7 @@ async fn handle_dav_files(
188188async fn handle_dav_files_root (
189189 State ( state) : State < Arc < AppState > > ,
190190 Path ( url_user) : Path < String > ,
191- user_ext : CurrentUser ,
191+ user_ext : AuthUser ,
192192 req : Request < Body > ,
193193) -> Result < Response , Response > {
194194 verify_url_user ( & url_user, & user_ext) ?;
@@ -200,7 +200,7 @@ async fn handle_dav_files_root(
200200async fn handle_dav_uploads (
201201 State ( state) : State < Arc < AppState > > ,
202202 Path ( ( url_user, upload_id, rest) ) : Path < ( String , String , String ) > ,
203- user_ext : CurrentUser ,
203+ user_ext : AuthUser ,
204204 req : Request < Body > ,
205205) -> Result < Response , Response > {
206206 verify_url_user ( & url_user, & user_ext) ?;
@@ -212,7 +212,7 @@ async fn handle_dav_uploads(
212212async fn handle_dav_uploads_root (
213213 State ( state) : State < Arc < AppState > > ,
214214 Path ( ( url_user, upload_id) ) : Path < ( String , String ) > ,
215- user_ext : CurrentUser ,
215+ user_ext : AuthUser ,
216216 req : Request < Body > ,
217217) -> Result < Response , Response > {
218218 verify_url_user ( & url_user, & user_ext) ?;
@@ -222,7 +222,7 @@ async fn handle_dav_uploads_root(
222222}
223223
224224/// Legacy /remote.php/webdav/* — redirect to /remote.php/dav/files/{user}/*
225- async fn handle_legacy_webdav ( Path ( subpath) : Path < String > , user_ext : CurrentUser ) -> Response {
225+ async fn handle_legacy_webdav ( Path ( subpath) : Path < String > , user_ext : AuthUser ) -> Response {
226226 let location = format ! ( "/remote.php/dav/files/{}/{}" , user_ext. username, subpath) ;
227227 Response :: builder ( )
228228 . status ( StatusCode :: MOVED_PERMANENTLY )
@@ -231,7 +231,7 @@ async fn handle_legacy_webdav(Path(subpath): Path<String>, user_ext: CurrentUser
231231 . unwrap ( )
232232}
233233
234- async fn handle_legacy_webdav_root ( user_ext : CurrentUser ) -> Response {
234+ async fn handle_legacy_webdav_root ( user_ext : AuthUser ) -> Response {
235235 let location = format ! ( "/remote.php/dav/files/{}/" , user_ext. username) ;
236236 Response :: builder ( )
237237 . status ( StatusCode :: MOVED_PERMANENTLY )
@@ -243,7 +243,7 @@ async fn handle_legacy_webdav_root(user_ext: CurrentUser) -> Response {
243243async fn handle_dav_trashbin (
244244 State ( state) : State < Arc < AppState > > ,
245245 Path ( ( url_user, subpath) ) : Path < ( String , String ) > ,
246- user_ext : CurrentUser ,
246+ user_ext : AuthUser ,
247247 req : Request < Body > ,
248248) -> Result < Response , Response > {
249249 verify_url_user ( & url_user, & user_ext) ?;
@@ -255,7 +255,7 @@ async fn handle_dav_trashbin(
255255async fn handle_dav_trashbin_root (
256256 State ( state) : State < Arc < AppState > > ,
257257 Path ( url_user) : Path < String > ,
258- user_ext : CurrentUser ,
258+ user_ext : AuthUser ,
259259 req : Request < Body > ,
260260) -> Result < Response , Response > {
261261 verify_url_user ( & url_user, & user_ext) ?;
0 commit comments