Security.txt generator component for Nette framework.
MIT License
🔧 Security generator component
This component automaticaly generates security.txt from parameters in configuration.
\Nepttune\Component\ISecurityFactory
as service in cofiguration file, inject it into presenter, write createComponent
method and use macro {control}
in template file.
text/plain
.services:
securityFactory:
implement: Nepttune\Component\ISecurityFactory
arguments:
- '%security%'
parameters:
security:
contact: '[email protected]'
hiring: 'https://hiring.test.com'
acknowledgements: 'https://hall-of-fame.test.com'
permission: 'none'
class ExamplePresenter implements IPresenter
{
/** @var \Nepttune\Component\ISecurityFactory */
protected $iSecurityFactory;
public function __construct(\Nepttune\Component\ISecurityFactory $ISecurityFactory)
{
$this->iSecurityFactory = $ISecurityFactory;
}
protected function createComponentSecurity() : \Nepttune\Component\Security
{
return $this->iSecurityFactory->create();
}
}