diegosouzapw/OmniRoute · error · ManagementPasswordAsCredentialError

MANAGEMENT_PASSWORD_AS_CREDENTIAL

MANAGEMENT_PASSWORD_AS_CREDENTIAL

Error message

That value is the dashboard login password, not a provider API key. Storing it would send it upstream on every request routed through this connection.

What it means

Safety check in provider connection creation: the supplied 'API key' matches the bcrypt hash of the dashboard login password (compared both trimmed and untrimmed), meaning the user pasted their dashboard password into the API key field. Storing it would send the management password upstream on every proxied request, so creation is refused.

Solutions

  1. Enter the actual provider API key (from the provider's console), not the OmniRoute dashboard password
  2. If unsure, rotate the dashboard password and store the provider key separately
  3. Improve the connection form to hint at where to find the provider API key
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/lib/db/providers.ts:139 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/9be4078de2a3ed4d. Report an issue: GitHub.

Appendix: source

Thrown at src/lib/db/providers.ts:139

    // bootstrapped a password has nothing to collide with.
    if (!isBcryptHash(stored)) return;
    // Both forms of the value, because neither the login route nor the
    // set-password route trims: a paste carries whitespace the password does
    // not have, and a password is allowed to carry whitespace of its own. The
    // second comparison only runs when the first fails on a different string.
    const matches =
      (await verifyManagementPassword(trimmed, stored)) ||
      (trimmed !== apiKey && (await verifyManagementPassword(apiKey, stored)));
    if (!matches) return;
  } catch (err) {
    console.warn(
      "[Providers] could not check the credential against the dashboard password:",
      err instanceof Error ? err.message : String(err)
    );
    return;
  }

  throw new ManagementPasswordAsCredentialError();
}

interface StatementLike<TRow = unknown> {
  all: (...params: unknown[]) => TRow[];
  get: (...params: unknown[]) => TRow | undefined;
  run: (...params: unknown[]) => { changes?: number };
}

interface DbLike {
  prepare: <TRow = unknown>(sql: string) => StatementLike<TRow>;
  transaction: <T>(fn: () => T) => () => T;
}

// Real column set for provider_connections (must match the CREATE TABLE in
// core.ts's SCHEMA_SQL). getProviderConnections()'s optional `columns`
// projection is interpolated directly into the SELECT clause, so every
// requested name must be validated against this allowlist before use —
// there is no current caller that passes untrusted input, but the

View on GitHub (pinned to a179ffed5b)