tinyhumansai/openhuman · error · anyhow::Error

provider is required

Error message

provider is required

What it means

login_url requires the OAuth provider slug to know which authorization endpoint to build; an empty/absent provider leaves no route to construct, so the request is rejected before any URL is assembled.

Solutions

  1. Pass the provider identifier expected by the backend (e.g. 'google')
  2. Check that the provider field is a non-empty string in the call
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/api/rest.rs:452 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/0f1fad55681d9d6f. Report an issue: GitHub.

Appendix: source

Thrown at src/api/rest.rs:452

    /// drive a non-JSON request shape (e.g. `multipart/form-data` uploads
    /// for cloud STT) without re-implementing TLS/proxy plumbing.
    pub fn raw_client(&self) -> &Client {
        &self.client
    }

    /// Resolve a backend-relative path against the configured base URL.
    /// Mirrors what `authed_json` does internally so callers using
    /// `raw_client()` don't have to assemble URLs by hand.
    pub fn url_for(&self, path: &str) -> Result<Url> {
        self.base
            .join(path.trim_start_matches('/'))
            .with_context(|| format!("build URL for {path}"))
    }

    /// Returns the URL for initiating a login flow for a specific provider.
    pub fn login_url(&self, provider: &str) -> Result<Url> {
        let p = provider.trim().trim_matches('/');
        anyhow::ensure!(!p.is_empty(), "provider is required");
        self.base
            .join(&format!("auth/{p}/login"))
            .context("build login URL")
    }

    /// Initiates an OAuth connection flow for the current user and a specific provider.
    pub async fn connect(
        &self,
        provider: &str,
        bearer_jwt: &str,
        skill_id: Option<&str>,
        response_type: Option<&str>,
        encryption_mode: Option<&str>,
    ) -> Result<ConnectResponse> {
        let p = provider.trim().trim_matches('/');
        anyhow::ensure!(!p.is_empty(), "provider is required");
        let query = {
            let mut serializer = url::form_urlencoded::Serializer::new(String::new());

View on GitHub (pinned to 7491200858)