Commit graph

10 commits

Author SHA1 Message Date
Claude
2b804a8c47
fix: resolve pre-existing test failures uncovered by Pint fix
All checks were successful
CI / PHP 8.3 (push) Successful in 1m43s
CI / PHP 8.4 (push) Successful in 1m44s
- Enable Attr.EnableID in HTMLPurifier so id attributes are preserved
- Move URI config before maybeGetRawHTMLDefinition() (config finalization)
- Reorder status attribute checks: circuit broken before disabled
- Use make() for signature tests needing null secrets (bypass auto-gen)
- Register webhook route stub in test setUp for URL generation test
- Use Mockery mock for CdnPurgeService stub to satisfy type hint

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:29:00 +00:00
Claude
a332148056
fix: move config directives before definition finalization and use Mockery for CdnPurgeService stub
Some checks failed
CI / PHP 8.3 (push) Failing after 1m30s
CI / PHP 8.4 (push) Failing after 1m28s
- Move URI config calls before maybeGetRawHTMLDefinition() which
  finalizes the config and prevents further set() calls
- Use Mockery::mock()->shouldIgnoreMissing() for CdnPurgeService stub
  to satisfy type hint in ContentItemObserver

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:20:12 +00:00
Claude
381a97aa03
fix: resolve test failures for HTMLPurifier and CdnManager
Some checks failed
CI / PHP 8.3 (push) Failing after 1m33s
CI / PHP 8.4 (push) Failing after 1m31s
HTMLPurifier: set HTML.DefinitionID and HTML.DefinitionRev which
are required when using maybeGetRawHTMLDefinition().

CdnManager: bind a stub in tests when Plug\Cdn\CdnManager class
is not available (external dependency not in test environment).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 11:57:46 +00:00
Claude
e7e7e5be89
fix: add factories, fix HtmlSanitiser HTML5 elements, fix TestCase
Some checks are pending
CI / PHP 8.3 (push) Waiting to run
CI / PHP 8.4 (push) Waiting to run
- Create Database/Factories for ContentWebhookEndpoint, ContentWebhookLog,
  ContentItem, ContentTaxonomy, ContentBrief
- Register HTML5 elements (section, article, figure, figcaption, mark)
  with HTMLPurifier custom definitions
- Use RefreshDatabase trait in TestCase with SQLite in-memory DB
- Update Pest.php to use custom Tests\TestCase

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 07:01:48 +00:00
Claude
12bb5509d5
chore: fix pint code style and add test config
Some checks failed
CI / tests (push) Failing after 1m24s
Add phpunit.xml and tests/Pest.php for standalone test execution.
Apply Laravel Pint formatting fixes across all source files.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 03:50:06 +00:00
Snider
0120908669 feat(webhooks): P2-082 P2-083 signature verification and delivery logging
P2-082: Webhook Signature Verification
- Add require_signature field, verifySignatureWithDetails()
- Support grace period during secret rotation
- Log signature failures for audit

P2-083: Webhook Delivery Logging
- WebhookDeliveryLogger service for centralised logging
- Track duration, response code, signature verification
- Add getDeliveryStats() and getRecentSignatureFailures()

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 14:22:09 +00:00
Snider
fa4893d064 fix(security): require HTMLPurifier for XSS sanitisation
The previous getSanitisedContent() method fell back to strip_tags() when
HTMLPurifier was unavailable. This fallback was insecure as strip_tags()
does not sanitise attributes, allowing XSS via onclick, onerror, and
javascript: URLs.

Changes:
- Created Services/HtmlSanitiser.php using HTMLPurifier as the sole sanitiser
- Added ezyang/htmlpurifier as a required dependency in composer.json
- Added boot-time validation that throws RuntimeException if missing
- Removed insecure strip_tags() fallback from ContentItem model
- Added 30+ unit tests covering XSS attack vectors

Closes SEC-002 from TODO.md

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-29 12:34:35 +00:00
Snider
35946a895b refactor: update namespaces for L1/L2 package convention
- Core\Mod\Tenant -> Core\Tenant
- Mod\Agentic -> Core\Mod\Agentic

Part of namespace restructure to align with L1/L2 module conventions.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 17:34:49 +00:00
Snider
6ede1b1a20 refactor: rename namespace Core\Content to Core\Mod\Content
Aligns content module namespace with the standard module structure
convention (Core\Mod\{Name}) for consistency across the monorepo.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:24:53 +00:00
Snider
f990dc1bd3 monorepo sepration 2026-01-26 23:59:46 +00:00