Skip to content

feat(scan): support self-hosted cloud-pricing-api via INFRACOST_CLI_PRICING_API_KEY - #196

Closed
liamg wants to merge 1 commit into
mainfrom
fix-492-harness-cli-v2-cant-authenticate-against-a-self-hosted-cloud
Closed

feat(scan): support self-hosted cloud-pricing-api via INFRACOST_CLI_PRICING_API_KEY#196
liamg wants to merge 1 commit into
mainfrom
fix-492-harness-cli-v2-cant-authenticate-against-a-self-hosted-cloud

Conversation

@liamg

@liamg liamg commented Jul 30, 2026

Copy link
Copy Markdown
Member

Superseded by #197 — the head branch was renamed, which closed this PR.

…RICING_API_KEY

Setting INFRACOST_CLI_PRICING_API_KEY switches the CLI into self-hosted
pricing mode, restoring the legacy endpoint+key setup for users who run
their own cloud-pricing-api and have no route to Infracost Cloud:

- The static key is sent to provider plugins as the pricing API key and
  always wins over the OAuth access token (which a self-hosted pricing
  API cannot validate — it does an exact string match on x-api-key).
- Login, org resolution, and the RunParameters fetch are skipped; the
  scan runs against zero-value run parameters.
- Providers receive empty (non-nil) policy slices so no FinOps or tag
  policies are evaluated (nil would mean "evaluate all built-ins"),
  overriding INFRACOST_CLI_USE_ALL_LOCAL_POLICIES.
- Telemetry becomes a no-op and cached-token validation (a JWKS fetch)
  is disabled so nothing else leaves the machine; the update check
  against releases.infracost.io is skipped too.
- The MCP session gate passes tools through without auth/org in this
  mode; Cloud-only tools fail downstream with an actionable error.
- The events client also gets a 10s request timeout regardless of mode
  so fire-and-forget telemetry can't hang a command on a blocked
  network.
- The legacy INFRACOST_PRICING_API_ENDPOINT env var is honored (with a
  rename warning) when nothing else sets a pricing endpoint, so
  self-hosted users migrating from the legacy CLI don't silently price
  against pricing.api.infracost.io.

Fixes FIX-492
@liamg liamg self-assigned this Jul 30, 2026
@liamg liamg closed this Jul 30, 2026
@liamg
liamg deleted the fix-492-harness-cli-v2-cant-authenticate-against-a-self-hosted-cloud branch July 30, 2026 15:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant