Skip to content

Add Cloudflare provider #8

@c99e

Description

@c99e

Summary

Add Cloudflare as a supported GraphQL provider. Cloudflare exposes a GraphQL Analytics API at a fixed endpoint, authenticated via API Token (Bearer). This is the simplest auth model so far — no token exchange, no per-account URL — making it a clean addition once multi-provider support (#5) is in place.

Acceptance criteria

  • A CloudflareProvider implements the GqlProvider interface
  • The provider is detected when CLOUDFLARE_API_TOKEN is set
  • The endpoint is https://api.cloudflare.com/client/v4/graphql
  • Auth header is Authorization: Bearer <token>
  • When CLOUDFLARE_API_TOKEN is missing, the provider is not detected — it does not block other providers
  • The error message when no providers are configured lists Cloudflare and its required env var alongside existing providers
  • reset() is a no-op (no cached state beyond the static token)
  • README documents the Cloudflare configuration section and env var

Testing guidance

  • Unit tests for config validation (missing env var throws, present env var constructs provider)
  • Unit tests for endpoint and headers output
  • Unit tests for detectProvider recognizing Cloudflare alongside existing providers
  • Follow the existing LinearProvider tests as a model — the auth model is similarly simple

Dependencies

Out of scope

  • API Key + Email (legacy auth) — only API Token is supported
  • Cloudflare-specific query helpers or analytics shortcuts
  • Multiple Cloudflare accounts in one session

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions