Add support for Bearer token authentication with Cloudflare API

Created on 14 May 2025, 24 days ago

Problem/Motivation

The Cloudflare API now supports token-based (Bearer) authentication, which is recommended over using the Global API Key for security reasons. Currently, the Cloudflare Purge module only supports authentication via Global API Key (using X-Auth-Key and X-Auth-Email headers), which poses security and maintainability concerns.

Proposed resolution

Add support for authenticating to the Cloudflare API using a Bearer token. This would involve:

  • Allowing site administrators to choose between API Key and Bearer Token authentication methods in the module configuration.
  • Sending the Authorization: Bearer header when Bearer Token authentication is selected.

User interface changes

Add a field to allow site admins to input a Bearer Token and a checkbox to select the authentication method.

✨ Feature request
Status

Active

Version

2.0

Component

Code

Created by

πŸ‡―πŸ‡΄Jordan yasmeensalah

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024