jsq/doctrine-cache-encrypter-bundle

A bundle to manage encryption for your doctrine caches

0.3.0 2016-01-27 17:04 UTC

This package is auto-updated.

Last update: 2024-10-29 05:10:27 UTC


README

Build Status Scrutinizer Code Quality Code Coverage Apache 2 License Total Downloads Author

The purpose of this bundle is to provide a thin wrapper around the Doctrine Cache Encrypter to make it work more seamlessly with the Symfony framework. This bundle will allow you to create an encrypted cache service from a regular Doctrine Cache service by tagging it.

Usage

Any service that is an instance of Doctrine\Common\Cache\Cache can be tagged with the cache.encrypted tag to create an additional service that will encrypt values either with a password or against an array of public keys.

Sample configuration can be found in the tests/fixtures folder for YAML, PHP, and XML.

To use a service for any configuration value, use @ followed by the service name, such as @a_service. This syntax will be converted to a service during container compilation. If you want to use a string literal that begins with @, you will need to escape it by adding another @ sign.

Please note that you will need to pass in an array of public keys, not just a single one, as that encrypter is designed to work across multiple servers, each with its own key pair. As Symfony DI tags can only be string values, you will need to use a service (with @service notation) that returns an array.