Add authentication to more handlers

This commit is contained in:
2020-08-01 02:18:31 -04:00
parent eb7706974e
commit d1c933e1ea
13 changed files with 99 additions and 60 deletions

View File

@@ -48,6 +48,7 @@ pub fn create_shop(
warp::path::end()
.and(warp::post())
.and(json_body::<Shop>())
.and(warp::header::optional("api-key"))
.and(with_env(env))
.and_then(handlers::create_shop)
}
@@ -86,6 +87,7 @@ pub fn create_owner(
.and(warp::post())
.and(json_body::<Owner>())
.and(warp::addr::remote())
.and(warp::header::optional("api-key"))
.and(with_env(env))
.and_then(handlers::create_owner)
}
@@ -125,6 +127,7 @@ pub fn create_interior_ref_list(
warp::path::end()
.and(warp::post())
.and(json_body::<InteriorRefList>())
.and(warp::header::optional("api-key"))
.and(with_env(env))
.and_then(handlers::create_interior_ref_list)
}