coka/doctrine-secret-type-bundle
This bundle help the user input high quality data into your web services REST.
The OkaDoctrineSecretTypeBundle has the following requirements:
Installation is a quick (I promise!) 3 step process:
Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:
$ composer require coka/doctrine-secret-type-bundle
This command requires you to have Composer installed globally, as explained in the installation chapter of the Composer documentation.
Then, register the bundle by adding it to the list of registered bundles
in the config/bundles.php file of your project (Flex did it automatically):
return [
//...
Oka\Doctrine\SecretTypeBundle\OkaDoctrineSecretTypeBundle::class => ['all' => true],
]
Add the following configuration in the file config/packages/oka_doctrine_secret_type.yaml.
# config/packages/oka_doctrine_secret_type.yaml
doctrine:
dbal:
types:
string_secret: 'Oka\Doctrine\SecretTypeBundle\Types\DBAL\StringSecretType'
json_secret: 'Oka\Doctrine\SecretTypeBundle\Types\DBAL\JsonSecretType'
mapping_types:
string_secret: text
json_secret: text
doctrine_mongodb:
types:
string_secret: 'Oka\Doctrine\SecretTypeBundle\Types\ODM\MongoDB\StringSecretType'
hash_secret: 'Oka\Doctrine\SecretTypeBundle\Types\ODM\MongoDB\HashSecretType'
oka_doctrine_secret_type:
private_key_file: '%env(resolve:COKA_SECRET_TYPE_PRIVATE_KEY_FILE)%'
public_key_file: '%env(resolve:COKA_SECRET_TYPE_PUBLIC_KEY_FILE)%'
passphrase: '%env(COKA_SECRET_TYPE_PASSPHRASE)%'
Now that the bundle is installed.
<?php
// App\Entity\Foo.php
namespace App\Entity;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
*
*/
#[ORM\Entity]
class Foo
{
// ...
/**
* #[ORM\Column(type: 'string_secret')]
*
* [@var](https://github.com/var) string
*/
protected $secret;
}
How can I help you explore Laravel packages today?