feat: enforce master token authentication and reasoning support

- Added strict token validation against LLM_PROXY__SERVER__AUTH_TOKENS.
- Integrated 'reasoning_content' support into providers and server responses.
- Updated AppState to carry valid auth tokens for request-time validation.
This commit is contained in:
2026-02-26 14:12:51 -05:00
parent 1755075657
commit 3aaa309d38
5 changed files with 27 additions and 9 deletions

View File

@@ -32,6 +32,11 @@ async fn chat_completions(
auth: AuthenticatedClient,
Json(request): Json<ChatCompletionRequest>,
) -> Result<axum::response::Response, AppError> {
// Validate token against configured auth tokens
if !state.auth_tokens.is_empty() && !state.auth_tokens.contains(&auth.token) {
return Err(AppError::AuthError("Invalid authentication token".to_string()));
}
let start_time = std::time::Instant::now();
let client_id = auth.client_id.clone();
let model = request.model.clone();