@@ -34,7 +34,7 @@ pub struct CreateForwarderRequest {
3434}
3535
3636pub async fn create_forwarder (
37- _auth_user : AuthUser ,
37+ auth_user : AuthUser ,
3838 State ( state) : State < AppState > ,
3939 Json ( req) : Json < CreateForwarderRequest > ,
4040) -> Result < Json < LogForwarder > , AppError > {
@@ -65,7 +65,7 @@ pub async fn create_forwarder(
6565
6666 state. audit . log (
6767 agent_bastion_common:: audit:: AuditEntry :: new ( "log_forwarder.created" )
68- . user_id ( _auth_user . claims . sub )
68+ . user_id ( auth_user . claims . sub )
6969 . resource ( format ! ( "log_forwarder:{}" , forwarder. id) ) ,
7070 ) ;
7171
@@ -120,7 +120,7 @@ pub async fn update_forwarder(
120120// --- Delete forwarder ---
121121
122122pub async fn delete_forwarder (
123- _auth_user : AuthUser ,
123+ auth_user : AuthUser ,
124124 State ( state) : State < AppState > ,
125125 Path ( id) : Path < Uuid > ,
126126) -> Result < Json < serde_json:: Value > , AppError > {
@@ -137,7 +137,7 @@ pub async fn delete_forwarder(
137137
138138 state. audit . log (
139139 agent_bastion_common:: audit:: AuditEntry :: new ( "log_forwarder.deleted" )
140- . user_id ( _auth_user . claims . sub )
140+ . user_id ( auth_user . claims . sub )
141141 . resource ( format ! ( "log_forwarder:{id}" ) ) ,
142142 ) ;
143143
@@ -147,7 +147,7 @@ pub async fn delete_forwarder(
147147// --- Toggle (pause / resume) ---
148148
149149pub async fn toggle_forwarder (
150- _auth_user : AuthUser ,
150+ auth_user : AuthUser ,
151151 State ( state) : State < AppState > ,
152152 Path ( id) : Path < Uuid > ,
153153) -> Result < Json < LogForwarder > , AppError > {
@@ -169,7 +169,7 @@ pub async fn toggle_forwarder(
169169 } ;
170170 state. audit . log (
171171 agent_bastion_common:: audit:: AuditEntry :: new ( action)
172- . user_id ( _auth_user . claims . sub )
172+ . user_id ( auth_user . claims . sub )
173173 . resource ( format ! ( "log_forwarder:{id}" ) ) ,
174174 ) ;
175175
@@ -204,7 +204,7 @@ pub struct TestResult {
204204}
205205
206206pub async fn test_forwarder (
207- _auth_user : AuthUser ,
207+ auth_user : AuthUser ,
208208 State ( state) : State < AppState > ,
209209 Path ( id) : Path < Uuid > ,
210210) -> Result < Json < TestResult > , AppError > {
@@ -215,7 +215,7 @@ pub async fn test_forwarder(
215215 . ok_or_else ( || AppError :: NotFound ( "Forwarder not found" . into ( ) ) ) ?;
216216
217217 let test_entry = agent_bastion_common:: audit:: AuditEntry :: new ( "log_forwarder.test" )
218- . user_id ( _auth_user . claims . sub )
218+ . user_id ( auth_user . claims . sub )
219219 . resource ( format ! ( "log_forwarder:{id}" ) ) ;
220220
221221 // Send test message and report result
@@ -235,7 +235,8 @@ pub async fn test_forwarder(
235235 . config
236236 . get ( "facility" )
237237 . and_then ( |v| v. as_u64 ( ) )
238- . unwrap_or ( 16 ) as u8 ;
238+ . and_then ( |v| u8:: try_from ( v) . ok ( ) )
239+ . unwrap_or ( 16 ) ;
239240 let priority = facility * 8 + 6u8 ;
240241 let msg = format ! (
241242 "<{}>1 {} agent-bastion audit - {} [audit@0 test=\" true\" ] test message\n " ,
0 commit comments