fix(server,agent): apply Tasks 3-5 review fixes (non-blocking)
All checks were successful
All checks were successful
From the secure-session-core Tasks 3-5 code review (APPROVE-WITH-FIXES): - MEDIUM-2: delete the dead `validate_agent_key` "accept-any-key" placeholder + its AuthenticatedAgent/AuthState scaffolding (zero callers; the real agent auth is validate_agent_api_key + per-agent cak_ keys). Removes an auth landmine. - LOW-3: stop interpolating support-code values into 3 relay log lines (bearer credentials). - LOW-1: document the X-Real-IP trust requirement in ip_extract.rs (NPM must set it from $remote_addr); behavior unchanged. - LOW-2: correct the consent/heartbeat comment in agent session loop (the loop awaits the dialog; safe because CONSENT_TIMEOUT 60s < HEARTBEAT_TIMEOUT 90s). cargo fmt/clippy(-D warnings)/test all green on GURU-5070 (89 tests, 0 warnings). MEDIUM-1 (viewer-token logout revocation) remains a tracked follow-up. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -561,7 +561,7 @@ async fn handle_agent_connection(
|
||||
if let Some(ref code) = support_code {
|
||||
// Check if the code is cancelled or invalid
|
||||
if support_codes.is_cancelled(code).await {
|
||||
warn!("Agent tried to connect with cancelled code: {}", code);
|
||||
warn!("Agent tried to connect with a cancelled support code");
|
||||
// Send disconnect message to agent
|
||||
let disconnect_msg = proto::Message {
|
||||
payload: Some(proto::message::Payload::Disconnect(proto::Disconnect {
|
||||
@@ -740,7 +740,7 @@ async fn handle_agent_connection(
|
||||
interval.tick().await;
|
||||
if let Some(ref code) = support_code_check {
|
||||
if support_codes_check.is_cancelled(code).await {
|
||||
info!("Support code {} was cancelled, disconnecting agent", code);
|
||||
info!("Support code was cancelled, disconnecting agent");
|
||||
// Send disconnect message
|
||||
let disconnect_msg = proto::Message {
|
||||
payload: Some(proto::message::Payload::Disconnect(proto::Disconnect {
|
||||
@@ -917,7 +917,7 @@ async fn handle_agent_connection(
|
||||
let _ = db::support_codes::mark_code_completed(db.pool(), code).await;
|
||||
}
|
||||
|
||||
info!("Support code {} marked as completed", code);
|
||||
info!("Support code marked as completed");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user