From 07156d7354464ffac0630d88907eeba2cb958953 Mon Sep 17 00:00:00 2001 From: jedarden Date: Mon, 25 May 2026 08:15:43 -0400 Subject: [PATCH] fix(proxy): formatting fixes in search_ui and scoped_key_rotation Minor formatting adjustments for consistency: - Fix indentation in template validation logic - Fix indentation in timing gate check These are cosmetic changes that improve code readability without affecting functionality. Co-Authored-By: Claude Opus 4.7 --- crates/miroir-proxy/src/routes/search_ui.rs | 15 ++++++++------- .../miroir-proxy/src/scoped_key_rotation.rs | 19 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/miroir-proxy/src/routes/search_ui.rs b/crates/miroir-proxy/src/routes/search_ui.rs index afc0370..734f288 100644 --- a/crates/miroir-proxy/src/routes/search_ui.rs +++ b/crates/miroir-proxy/src/routes/search_ui.rs @@ -700,12 +700,11 @@ fn validate_template(template: &str) -> Result<(), ErrorResponse> { if_stack.push("if"); } // Check for {{/if}} closing - else if tag.starts_with("/if") - && if_stack.pop() != Some("if") { - return Err(ErrorResponse::invalid_request( - "unmatched {{/if}} tag in template".to_string(), - )); - } + else if tag.starts_with("/if") && if_stack.pop() != Some("if") { + return Err(ErrorResponse::invalid_request( + "unmatched {{/if}} tag in template".to_string(), + )); + } pos += end + 2; } else { @@ -716,7 +715,9 @@ fn validate_template(template: &str) -> Result<(), ErrorResponse> { } if !if_stack.is_empty() { - return Err(ErrorResponse::invalid_request("unclosed {#if} tag in template".to_string())); + return Err(ErrorResponse::invalid_request( + "unclosed {#if} tag in template".to_string(), + )); } Ok(()) diff --git a/crates/miroir-proxy/src/scoped_key_rotation.rs b/crates/miroir-proxy/src/scoped_key_rotation.rs index bd6e616..6e5bf97 100644 --- a/crates/miroir-proxy/src/scoped_key_rotation.rs +++ b/crates/miroir-proxy/src/scoped_key_rotation.rs @@ -111,16 +111,15 @@ pub async fn check_and_rotate( .map_err(|e| format!("redis read failed: {e}"))?; // Timing gate check (skip if force) - if !force - && !should_rotate(¤t, &state.config) { - return Ok(RotateScopedKeyResponse { - status: "skipped".into(), - index_uid: index_uid.into(), - generation: current.as_ref().map(|k| k.generation).unwrap_or(0), - previous_uid_revoked: None, - error: None, - }); - } + if !force && !should_rotate(¤t, &state.config) { + return Ok(RotateScopedKeyResponse { + status: "skipped".into(), + index_uid: index_uid.into(), + generation: current.as_ref().map(|k| k.generation).unwrap_or(0), + previous_uid_revoked: None, + error: None, + }); + } // Step 1: Mint new scoped key via Meilisearch POST /keys let client = MeilisearchClient::new(state.config.node_master_key.clone());