Skip to content

Add Lists, Privacy and Webhook verification APIs#52

Closed
bartes wants to merge 5 commits into
developfrom
feat/lists-privacy-webhooks
Closed

Add Lists, Privacy and Webhook verification APIs#52
bartes wants to merge 5 commits into
developfrom
feat/lists-privacy-webhooks

Conversation

@bartes

@bartes bartes commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

This PR brings the PHP SDK in line with the broader Castle API surface by adding the Lists, List Items and Privacy APIs, along with webhook signature verification, and modernizes the project tooling.

It adds the Lists API (createList, getAllLists, getList, updateList, deleteList, queryList) and the List Items API (createListItem, createListItems, getListItem, updateListItem, queryListItems, countListItems, archiveListItem, unarchiveListItem), each returning the decoded API response.

It adds the Privacy API (requestUserData, deleteUserData) for requesting and deleting the data Castle stores for a user.

It adds webhook signature verification through Castle_Webhook::verify, which validates the raw request body against the X-Castle-Signature header (reading both from the request by default) and raises the new Castle_WebhookVerificationError on a mismatch.

The request context is now attached automatically to risk, filter and log requests, matching the existing behaviour of track. API error handling is hardened against empty error response bodies, and the Castle_ApiError properties are declared for PHP 8/9 compatibility.

Tooling is modernized: CI moves from CircleCI to GitHub Actions with a Specs workflow that runs the suite across PHP 7.2 through 8.4 and a Lint workflow (composer validate + php -l). PHPUnit is pinned to ^8.5 || ^9.6, the unused php-coveralls dev dependency is dropped, the curl/json extensions are declared, and phpunit.xml is simplified to the modern schema.

The README now installs via Composer and documents supported versions; the README and CHANGELOG document the new methods.

bartes added 3 commits June 8, 2026 16:46
- Lists API: createList, getAllLists, getList, updateList, deleteList, queryList
- List Items API: createListItem, createListItems, getListItem, updateListItem,
  queryListItems, countListItems, archiveListItem, unarchiveListItem
- Privacy API: requestUserData, deleteUserData
- Webhook signature verification via Castle_Webhook::verify and the
  Castle_WebhookVerificationError exception
- Attach the request context automatically to risk, filter and log requests
- Harden API error handling against empty error response bodies
Avoids the dynamic-property deprecation (which becomes a fatal error in PHP 9).
- Replace CircleCI with GitHub Actions: a Specs workflow with a PHP version
  matrix (7.2-8.4) and a Lint workflow (composer validate + php -l)
- Pin phpunit to ^8.5 || ^9.6 and drop the unused php-coveralls dependency
- Declare the curl/json extension requirements in composer.json
- Simplify phpunit.xml to the modern schema
- Update the README to install via Composer and document supported versions
@bartes bartes force-pushed the feat/lists-privacy-webhooks branch from 1242e74 to 457129a Compare June 8, 2026 14:48
bartes added 2 commits June 8, 2026 16:49
Add an ISO8601 millisecond-precision sent_at timestamp automatically to
risk, filter and log requests, matching the behaviour of the other Castle
SDKs (closes #23). Default Castle_ApiError's message to an empty string and
coalesce null to avoid the PHP 8.1+ deprecation when an error body is empty.
@bartes

bartes commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Consolidated into #53, which now targets develop and contains the full 4.0.0 release (Lists/Privacy/Webhooks + namespace + modernization).

@bartes bartes closed this Jun 8, 2026
@bartes bartes deleted the feat/lists-privacy-webhooks branch June 10, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant