This Symfony bundle can be used to integrate Gaze easily in an Symfony application.
Install using composer:
composer require isaac/gazesymfonybundle
You only need to do these step if you are not using Symfony Flex.
Create the file config/routes/isaac_gaze_symfony.yaml
with the following content: (This will register the TokenController
of the bundle with the Symfony application)
isaac_gaze_symfony:
resource: '@ISAACGazeSymfonyBundle/config/routing.xml'
prefix: /gaze
Create the file config/packages/isaac_gaze_symfony.yaml
with the following content: (This will specify the configuration for this bundle)
isaac_gaze_symfony:
publisher:
gazehub_url: '%env(GAZEHUB_URL)%'
private_key_content: '%env(GAZE_PRIVATE_KEY_CONTENTS)%'
Now follow the steps in 'Configure with Symfony Flex'.
In .env
add the following variable:
GAZEHUB_URL="http://localhost:3333"
(Replace http://localhost:3333
with the url to GazeHub)
To store the private key in a safe way inside Symfony use the Symfony Vault. Run the following command to set the private key in a development environment:
bin/console secrets:set GAZE_PRIVATE_KEY_CONTENTS <PATH TO KEY OR KEY CONTENT>
To use another key on production run the following command in the production environment to override the private key:
bin/console secrets:set GAZE_PRIVATE_KEY_CONTENTS <PATH TO KEY OR KEY CONTENT> -e prod
bin/console secrets:decrypt-to-local --force --env=prod