tinyhumansai/openhuman · error · anyhow::Error

http_cred '{}': header value is empty

Error message

http_cred '{}': header value is empty

What it means

Materializing the HTTP credential to a header pair yielded an empty header value. For the Header scheme this means the computed value from the stored secret is empty (trimmed to nothing); the guard in `to_header()` blocks injecting an empty header onto the outbound request.

Source

Thrown at src/openhuman/security/credentials/http_creds.rs:153

            HttpCredentialScheme::Basic => {
                let username = self.username.as_deref().unwrap_or_default();
                let encoded = base64::engine::general_purpose::STANDARD
                    .encode(format!("{username}:{}", self.secret));
                Ok(("Authorization".to_string(), format!("Basic {encoded}")))
            }
            HttpCredentialScheme::Header => {
                let header_name = self
                    .header_name
                    .as_deref()
                    .map(str::trim)
                    .filter(|h| !h.is_empty())
                    .with_context(|| {
                        format!(
                            "http_cred '{}': header scheme requires a non-empty header_name",
                            self.name
                        )
                    })?;
                anyhow::ensure!(
                    !self.secret.trim().is_empty(),
                    "http_cred '{}': header value is empty",
                    self.name
                );
                Ok((header_name.to_string(), self.secret.clone()))
            }
        }
    }
}

/// Secret-free description of a stored credential — safe to return to the UI /
/// list surfaces (e.g. a future `flows_list_connections`).
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct HttpCredentialSummary {
    pub name: String,
    pub scheme: String,
    pub header_name: Option<String>,

View on GitHub (pinned to 7491200858)

Solutions

  1. Update the credential so its secret is non-empty after trimming
  2. For Header scheme, verify both header_name and secret are set
  3. Re-save the credential from its original source
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/openhuman/security/credentials/http_creds.rs:153 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of tinyhumansai/openhuman@7491200858 (2026-08-17). Data as JSON: /api/errors/2200f5bb80ecd89c. Report an issue: GitHub.