Problem/Motivation

It would be useful to have the ability to purge by URL.
All tiers can purge by URL, so this functionality isn't restricted to Enterprise.

Proposed resolution

I have created a new form CloudflarePurgeByURL.
I have also created a service, Purge, to be used by new form and existing controller.
Extra permission created so users can perform purge without access to config form.

I have also added email to config form as API connection is unsuccessful without this credential (X-AUTH-Email)

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

karengrey created an issue. See original summary.

karengrey’s picture

karengrey’s picture

Status: Active » Needs review
karengrey’s picture

Patch #1 was missing new files.

karengrey’s picture

Fixed typo.

flashwebcenter’s picture

Assigned: karengrey » Unassigned

Hello,
Thank you for contributing the patch to the module! I’ve reviewed it and applied it to the codebase, and everything looks fine from my side. However, I’m unable to test it fully as I don’t currently have an account to verify the functionality.

If anyone in the community can test it and confirm that it’s working as expected, I’d be more than happy to approve the patch. Your feedback is greatly appreciated!

    "extra": {
        "patches": {
            "drupal/cloudflare_purge": {
                "Add form to purge by URL": "https://www.drupal.org/files/issues/2024-12-04/cloudflare_purge-purge-by-url-3490224-3.patch"
            }
        },
    },

Best wishes,
Alaa

scott_euser’s picture

Status: Needs review » Needs work

One minor nitpick/query but otherwise this is being used in production already for a bit and working well, so RTBC +1 from me once nitpick resolved :) Thank you!

scott_euser’s picture

I did also see the permission change and thought whether an update hook is needed to maintain the status quo for existing sites but it seems highly unlikely a site builder would delegate permissions to manage the Cloudflare credentials and status quo is maintained for the actual purging ability.

karengrey’s picture

Status: Needs work » Needs review
scott_euser’s picture

Status: Needs review » Reviewed & tested by the community

Thanks, looks great! Very useful

flashwebcenter’s picture

Status: Reviewed & tested by the community » Fixed

Thank you @karengrey and @scott_euser

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.