Search by

yorvolabs / canary

dpoposki

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

v1.1.0 2026-10-19 15:25 UTC

This package is auto-updated.

Last update: 2026-10-19 15:27:21 UTC


README

CI Packagist License: MIT

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

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 per-IP limiter (file-based or bring your own Redis implementation)
  • Audit log — every request (pass and fail) recorded with IP, scope, endpoint, status, duration
  • 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. 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.