Search by

yorvolabs / canary

dpoposki

Secure, auditable HTTP endpoints for health monitoring, cache management, and deployment automation in Symfony-based applications.

v1.4.0 2026-12-03 23:23 UTC

This package is auto-updated.

Last update: 2026-12-03 23:23:33 UTC


README

CI Packagist License: MIT

Secure, auditable HTTP endpoints for health monitoring, cache management, and deployment automation in Symfony-based applications.

This package is the framework-agnostic core: the request guard (token scopes, IP allowlist, rate limit, audit), the health/deploy/diagnostics runners and the response factory. It ships no controllers or routes. For Shopware 6.6+, the bridge package below provides the endpoints; in another Symfony application you write thin controllers yourself (see Extending: New Bridge).

Features

  • Health probes — liveness and readiness endpoints suitable for Kubernetes / load balancer checks
  • Prometheus metrics — business KPIs and infrastructure metrics via Accept: text/plain content negotiation
  • Cache management — OPcache reset and application cache clear via authenticated API calls
  • Deploy lifecycle — pre-deploy readiness checks, post-deploy verification, maintenance mode toggle
  • Diagnostics — environment snapshot, config validation, log tail (PII-masked), queue depth, plugin list
  • Token-scoped auth — isolated Bearer tokens per endpoint group; constant-time comparison; IP allowlist
  • Rate limiting — sliding-window limiter per IP (IPv6 per /64), file-based with bounded state, or bring your own Redis implementation
  • Audit log — passed and rejected requests recorded with IP, scope, endpoint, status, duration (404s for unknown or disabled paths and sub-requests are not; see the authentication docs)
  • Extensible — tagged-service interfaces for health checks, deploy hooks, diagnostic checks, config providers, audit loggers

Requirements

  • PHP 8.2+
  • Symfony 7.4+ (http-foundation, http-kernel, event-dispatcher)

Installation

composer require yorvolabs/canary

For Shopware 6.6+, use the bridge package instead:

composer require yorvolabs/canary-bridge-shopware

Quick start

  1. Generate a token
php -r "echo bin2hex(random_bytes(32)) . PHP_EOL;"
  1. Set the environment variable
CANARY_TOKEN_MONITORING=<your-64-char-token>
  1. Wire the event subscriber (in your Symfony DI config)
YorvoLabs\Canary\Auth\RequestGuardSubscriber:
    tags: [kernel.event_subscriber]
  1. Route a controller under the prefix, for example /canary/health/live returning ResponseFactory::ok(['status' => 'alive']) (the Shopware bridge ships these controllers; for your own, see Extending: New Bridge)

  2. Make a request

curl -H "Authorization: Bearer $CANARY_TOKEN_MONITORING" \
     https://your-app.com/canary/health/live
{"ok": true, "data": {"status": "alive"}, "meta": {"request_id": "canary-...", "duration_ms": 1}}

Documentation

Full documentation including all endpoints, configuration options, and extension guides: github.com/yorvolabs/canary-platform/tree/main/docs

Page Description
Getting Started Install, configure, first request
API Reference All endpoints, request/response shapes
Authentication Token scopes, IP allowlist, security model
Configuration All environment variables
Extending: Health Checks Custom health checks
Extending: Deploy Hooks Custom pre/post-deploy hooks
Extending: Diagnostic Checks Custom diagnostic checks
Extending: New Bridge Wire into a non-Shopware framework
Deployment Checklist Pre-production checklist
CI/CD Integration GitHub Actions, GitLab CI examples

License

MIT — see LICENSE.