codemonauts / craft-instagram-feed

Craft CMS plugin to receive Instragram feed data as variable in templates
MIT License
28 stars 8 forks source link

Allow proxyKey config setting to be environment variable aware #69

Open jamesmacwhite opened 1 year ago

jamesmacwhite commented 1 year ago

Is your feature request related to a problem? Please describe.

The proxy key config setting is currently not environment aware, while this is generally not needed as the key will be the same across all environments it does mean if you want to store the proxyKey value as an environment variable, it will be output in the project config as plain text.

For best practice all keys should not be directly committed to source control and instead use environment variables for security in the event of a code leak or breach.

Currently the proxyKey will be output in plain text.

Describe the solution you'd like

The proxyKey config value to be environment aware so the value can be stored as:

<?php

return [
    'proxyKey' => '$INSTAGRAM_FEED_PROXY_KEY'
];

Currently to use an environment variable, the value needs to be parsed first, which then outputs in clear text within project config.

<?php

use craft\helpers\App;

return [
    'proxyKey' => App::env('INSTAGRAM_FEED_PROXY_KEY'),
];