about summary refs log tree commit diff stats
path: root/crates/rocie-server/src/api/set/recipe.rs
diff options
context:
space:
mode:
authorBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 13:07:14 +0100
committerBenedikt Peetz <benedikt.peetz@b-peetz.de>2025-12-09 13:07:14 +0100
commitc91dce4f77ae12453203f0a28b91efb6533cc095 (patch)
tree4f50e755dff7f717d45309b08f9fe2c8c87f88bd /crates/rocie-server/src/api/set/recipe.rs
parentchore(rocie-client): Regenerate (diff)
downloadserver-c91dce4f77ae12453203f0a28b91efb6533cc095.zip
feat(rocie-server): Implement basic user handling and authentication
Diffstat (limited to '')
-rw-r--r--crates/rocie-server/src/api/set/auth/recipe.rs (renamed from crates/rocie-server/src/api/set/recipe.rs)8
1 files changed, 7 insertions, 1 deletions
diff --git a/crates/rocie-server/src/api/set/recipe.rs b/crates/rocie-server/src/api/set/auth/recipe.rs
index bb5be37..43a034e 100644
--- a/crates/rocie-server/src/api/set/recipe.rs
+++ b/crates/rocie-server/src/api/set/auth/recipe.rs
@@ -1,5 +1,6 @@
 use std::path::PathBuf;
 
+use actix_identity::Identity;
 use actix_web::{HttpResponse, Responder, error::Result, post, web};
 use serde::Deserialize;
 use utoipa::ToSchema;
@@ -26,11 +27,15 @@ struct RecipeStub {
 #[utoipa::path(
     responses(
         (
-            status = 200,
+            status = OK,
             description = "Product parent successfully registered in database",
             body = RecipeId,
         ),
         (
+            status = UNAUTHORIZED,
+            description = "You did not login before calling this endpoint",
+        ),
+        (
             status = INTERNAL_SERVER_ERROR,
             description = "Server encountered error",
             body = String,
@@ -42,6 +47,7 @@ struct RecipeStub {
 pub(crate) async fn add_recipe(
     app: web::Data<App>,
     stub: web::Json<RecipeStub>,
+    _user: Identity,
 ) -> Result<impl Responder> {
     let stub = stub.into_inner();
     let mut ops = Operations::new("add recipe parent");