Skip to content

[3.x] Use gateway API routes#167

Merged
timkelty merged 3 commits into
3.xfrom
timkelty/gateway-api-routes
Jun 12, 2026
Merged

[3.x] Use gateway API routes#167
timkelty merged 3 commits into
3.xfrom
timkelty/gateway-api-routes

Conversation

@timkelty

Copy link
Copy Markdown
Contributor

Description

Routes Cloud cache purge requests through the dedicated gateway API endpoint introduced by the gateway worker.

@timkelty timkelty force-pushed the timkelty/gateway-api-routes branch 8 times, most recently from 00bca42 to e1d06fb Compare June 11, 2026 16:24
@timkelty timkelty force-pushed the timkelty/gateway-api-routes branch from e1d06fb to 3b1ab04 Compare June 11, 2026 16:29

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates Craft Cloud’s static cache purge mechanism to use the gateway worker’s dedicated API route (via a configured gateway base URL) instead of legacy purge-through-headers behavior, and adds unit coverage for the new gateway client construction.

Changes:

  • Switch static cache purge requests to POST cache/purge with a JSON payload (tags / prefixes) via a gateway API client.
  • Introduce gatewayBaseUrl config (defaulting to https://gateway.craft.cloud) and document it.
  • Add unit tests for the gateway API client base URI and auth header behavior, and keep the legacy helper method signature stable.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/unit/HelperTest.php Adds unit tests validating gateway client base URI construction and auth header configuration.
src/StaticCache.php Routes tag/prefix purge operations through the gateway API endpoint using JSON request bodies.
src/Helper.php Replaces legacy signing approach with a gateway API client builder and deprecates the old request helper.
src/Config.php Adds the gatewayBaseUrl configuration option with a default value.
README.md Documents the new gatewayBaseUrl configuration option.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/Helper.php
Comment thread src/Helper.php
@timkelty timkelty merged commit 7189e69 into 3.x Jun 12, 2026
9 checks passed
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.

2 participants