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 <noreply@anthropic.com>
This commit is contained in:
jedarden 2026-05-25 08:15:43 -04:00
parent a036aa2bca
commit 07156d7354
2 changed files with 17 additions and 17 deletions

View file

@ -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(())

View file

@ -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(&current, &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(&current, &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());