feat(scan): support self-hosted cloud-pricing-api via INFRACOST_CLI_PRICING_API_KEY - #196
Closed
liamg wants to merge 1 commit into
Closed
Conversation
…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
deleted the
fix-492-harness-cli-v2-cant-authenticate-against-a-self-hosted-cloud
branch
July 30, 2026 15:19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Superseded by #197 — the head branch was renamed, which closed this PR.