├── .gitignore ├── Auth ├── AuthInterface.php └── TokenAuth.php ├── Client ├── BaseUriConfiguratorInterface.php ├── VaultReaderClientInterface.php ├── VaultWriterClientInterface.php ├── BaseUriConfigurator.php └── VaultClient.php ├── ParameterGetter ├── ParameterGetterInterface.php └── ParameterGetter.php ├── ParameterProvider ├── ParameterProviderInterface.php ├── SimpleParameterProvider.php ├── VaultParameterProviderFactory.php └── VaultParameterProvider.php ├── ParameterMapper ├── SimpleParameterMapper.php ├── ParameterMapperInterface.php └── YamlParameterMapper.php ├── Tests ├── Functional │ ├── Resources │ │ └── config │ │ │ ├── config_vault_parameter_test.yml │ │ │ └── config.yml │ ├── VaultWebTestCase.php │ ├── VaultParameterProviderTest.php │ └── Kernel.php └── Unit │ └── ParameterMapper │ └── YamlParameterMapperTest.php ├── .travis.yml ├── composer.json ├── DependencyInjection ├── Compiler │ ├── CachedParameterCompilerPass.php │ └── DynamicParameterCompilerPass.php ├── Configuration.php └── FourxxiVaultExtension.php ├── FourxxiVaultBundle.php ├── Resources └── config │ └── services.yml ├── ExpressionLanguage └── VaultParameterExpressionLanguageProvider.php ├── phpunit.xml.dist └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | vendor/ 3 | composer.lock 4 | phpunit.xml 5 | Tests/Functional/var 6 | Resources/docs 7 | .php_cs.dist 8 | -------------------------------------------------------------------------------- /Auth/AuthInterface.php: -------------------------------------------------------------------------------- 1 | token = $token; 20 | } 21 | 22 | /** 23 | * @return string 24 | */ 25 | public function getToken(): string 26 | { 27 | return $this->token; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /Tests/Functional/Resources/config/config.yml: -------------------------------------------------------------------------------- 1 | framework: 2 | secret: 'test' 3 | 4 | fourxxi_vault: 5 | enabled: true 6 | auth: 7 | token: "%env(vault_token)%" 8 | connection: 9 | schema: "%env(vault_schema)%" 10 | host: "%env(vault_host)%" 11 | port: "%env(vault_port)%" 12 | api_version: '%env(vault_api_version)%' 13 | 14 | services: 15 | fourxxi_vault.test.writer_client: 16 | class: Fourxxi\Bundle\VaultBundle\Client\VaultClient 17 | arguments: ["@fourxxi_vault.auth", "@fourxxi_vault.client.base_uri_configurator"] 18 | public: true -------------------------------------------------------------------------------- /composer.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "fourxxi/vault-bundle", 3 | "description": "Symfony bundle for vault integration", 4 | "keywords": ["vault"], 5 | "type": "symfony-bundle", 6 | "license": "MIT", 7 | "require": { 8 | "php" : "^7.0", 9 | "symfony/framework-bundle": ">=2.8", 10 | "symfony/options-resolver": ">=2.8", 11 | "symfony/yaml": ">=2.8", 12 | "symfony/expression-language": ">=2.8", 13 | "guzzlehttp/guzzle": ">=6.0" 14 | }, 15 | "autoload": { 16 | "psr-4": { "Fourxxi\\Bundle\\VaultBundle\\": "" } 17 | }, 18 | "require-dev": { 19 | "phpunit/phpunit": "^6", 20 | "symfony/phpunit-bridge": "^4", 21 | "symfony/finder": ">=2.8" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Tests/Functional/VaultWebTestCase.php: -------------------------------------------------------------------------------- 1 | bootKernel(['environment' => $this->getEnvironment()]); 12 | } 13 | 14 | protected static function getKernelClass() 15 | { 16 | // compatibility with symfony 2.8 17 | if (isset($_ENV['KERNEL_CLASS'])) { 18 | return $_ENV['KERNEL_CLASS']; 19 | } 20 | 21 | return parent::getKernelClass(); 22 | } 23 | 24 | /** 25 | * @return string 26 | */ 27 | protected function getEnvironment(): string 28 | { 29 | return 'test'; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /DependencyInjection/Compiler/CachedParameterCompilerPass.php: -------------------------------------------------------------------------------- 1 | getParameter('fourxxi_vault.enabled') === false) { 16 | return; 17 | } 18 | 19 | $taggedServices = $container->findTaggedServiceIds('fourxxi_vault.cached_parameters'); 20 | foreach ($taggedServices as $id => $info) { 21 | $container->getParameterBag()->add($container->get($id)->all()); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /FourxxiVaultBundle.php: -------------------------------------------------------------------------------- 1 | addExpressionLanguageProvider( 16 | new VaultParameterExpressionLanguageProvider() 17 | ); 18 | 19 | $container->addCompilerPass(new CachedParameterCompilerPass()); 20 | $container->addCompilerPass(new DynamicParameterCompilerPass()); 21 | 22 | parent::build($container); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Resources/config/services.yml: -------------------------------------------------------------------------------- 1 | parameters: 2 | fourxxi_vault.enabled: false 3 | fourxxi_vault.client.base_uri_configurator.class: Fourxxi\Bundle\VaultBundle\Client\BaseUriConfigurator 4 | 5 | services: 6 | fourxxi_vault.auth: 7 | class: Fourxxi\Bundle\VaultBundle\Auth\AuthInterface 8 | 9 | fourxxi_vault.client.base_uri_configurator: 10 | class: "%fourxxi_vault.client.base_uri_configurator.class%" 11 | 12 | fourxxi_vault.client.client: 13 | class: Fourxxi\Bundle\VaultBundle\Client\VaultClient 14 | arguments: ["@fourxxi_vault.auth","@fourxxi_vault.client.base_uri_configurator"] 15 | 16 | fourxxi_vault.parameter_provider.vault_factory: 17 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\VaultParameterProviderFactory 18 | arguments: ["@fourxxi_vault.client.client"] 19 | public: true 20 | 21 | fourxxi_vault.parameter_getter: 22 | class: Fourxxi\Bundle\VaultBundle\ParameterGetter\ParameterGetter 23 | -------------------------------------------------------------------------------- /ParameterProvider/SimpleParameterProvider.php: -------------------------------------------------------------------------------- 1 | parameterBag = $parameterBag; 22 | $this->parameterBag->resolve(); 23 | } 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function get($name) 29 | { 30 | return $this->parameterBag->get($name); 31 | } 32 | 33 | /** 34 | * {@inheritdoc} 35 | */ 36 | public function all() 37 | { 38 | return $this->parameterBag->all(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Tests/Unit/ParameterMapper/YamlParameterMapperTest.php: -------------------------------------------------------------------------------- 1 | [self::EXPECTED_VALUE => 'field: value']]; 18 | $mapper = new YamlParameterMapper(self::EXPECTED_VALUE); 19 | 20 | $this->assertEquals(['field' => 'value'], $mapper->map($response)->all()); 21 | } 22 | 23 | /** 24 | * @test 25 | */ 26 | public function throwsErrorIfFieldIsMissing() 27 | { 28 | $this->expectException(\LogicException::class); 29 | 30 | $mapper = new YamlParameterMapper('missing_value'); 31 | $mapper->map([]); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /ParameterGetter/ParameterGetter.php: -------------------------------------------------------------------------------- 1 | providers = $providers; 22 | } 23 | 24 | /** 25 | * {@inheritdoc} 26 | */ 27 | public function get(string $providerName, string $fieldName) 28 | { 29 | if (!isset($this->providers[$providerName])) { 30 | throw new \LogicException("Provider with name $providerName doesn't exist"); 31 | } 32 | 33 | return $this->providers[$providerName]->get($fieldName); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /ParameterMapper/YamlParameterMapper.php: -------------------------------------------------------------------------------- 1 | valueField = $valueField; 23 | } 24 | 25 | /** 26 | * {@inheritdoc} 27 | */ 28 | public function map(array $response): ParameterBag 29 | { 30 | if (!isset($response['data'][$this->valueField])) { 31 | throw new \LogicException(sprintf( 32 | 'Parameter %s does not exist in the data array', 33 | $this->valueField 34 | )); 35 | } 36 | 37 | return new ParameterBag(Yaml::parse($response['data'][$this->valueField])); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /Client/BaseUriConfigurator.php: -------------------------------------------------------------------------------- 1 | schema = $config['connection']['schema']; 35 | $this->host = $config['connection']['host']; 36 | $this->port = $config['connection']['port']; 37 | $this->apiVersion = $config['connection']['api_version']; 38 | } 39 | 40 | /** 41 | * @return string 42 | */ 43 | public function getUri(): string 44 | { 45 | return sprintf('%s://%s:%s/%s/', $this->schema, $this->host, $this->port, $this->apiVersion); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /DependencyInjection/Compiler/DynamicParameterCompilerPass.php: -------------------------------------------------------------------------------- 1 | getParameter('fourxxi_vault.enabled'); 16 | $tag = sprintf('fourxxi_vault.%s_parameter_provider', true === $enabled ? 'enabled' : 'disabled'); 17 | 18 | $taggedServices = $container->findTaggedServiceIds($tag); 19 | 20 | $providers = []; 21 | foreach ($taggedServices as $id => $tags) { 22 | if (!isset($tags[0]['provider_name'])) { 23 | throw new \LogicException("Tag parameter 'provider_name' isn't set"); 24 | } 25 | 26 | $providers[$tags[0]['provider_name']] = $container->getDefinition($id); 27 | } 28 | 29 | $container->getDefinition('fourxxi_vault.parameter_getter')->addArgument($providers); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /ExpressionLanguage/VaultParameterExpressionLanguageProvider.php: -------------------------------------------------------------------------------- 1 | get(\'fourxxi_vault.parameter_getter\')->get(%1$s, %2$s)', $providerName, $fieldName); 17 | }; 18 | 19 | $evaluator = function ($variables, $providerName, $fieldName) { 20 | return $variables['container']->get('fourxxi_vault.parameter_getter')->get($providerName, $fieldName); 21 | }; 22 | 23 | return [ 24 | new ExpressionFunction('v', $compiler, $evaluator), 25 | new ExpressionFunction('vault', $compiler, $evaluator), 26 | new ExpressionFunction('fourxxi_vault', $compiler, $evaluator), 27 | ]; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /ParameterProvider/VaultParameterProviderFactory.php: -------------------------------------------------------------------------------- 1 | vaultClient = $vaultClient; 24 | } 25 | 26 | /** 27 | * @param string $path 28 | * @param ParameterMapperInterface|null $parameterMapper 29 | * 30 | * @return VaultParameterProvider 31 | */ 32 | public function create(string $path, ParameterMapperInterface $parameterMapper = null) 33 | { 34 | $parameterMapper = $parameterMapper ?? new SimpleParameterMapper(); 35 | 36 | return new VaultParameterProvider($path, $parameterMapper, $this->vaultClient); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Client/VaultClient.php: -------------------------------------------------------------------------------- 1 | client = new HttpClient( 24 | [ 25 | 'headers' => [ 26 | 'X-Vault-Token' => $auth->getToken(), 27 | 'Accept' => 'application/json', 28 | 'Content-Type' => 'application/json', 29 | ], 30 | 'base_uri' => $baseUriConfigurator->getUri(), 31 | ] 32 | ); 33 | } 34 | 35 | /** 36 | * {@inheritdoc} 37 | */ 38 | public function read(string $path) 39 | { 40 | $response = $this->client->send(new Request('GET', $path)); 41 | 42 | return json_decode($response->getBody()->getContents(), true); 43 | } 44 | 45 | /** 46 | * {@inheritdoc} 47 | */ 48 | public function write(string $path, array $value) 49 | { 50 | $this->client->send(new Request('POST', $path, [], json_encode($value))); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /DependencyInjection/Configuration.php: -------------------------------------------------------------------------------- 1 | root('fourxxi_vault'); 17 | 18 | $rootNode 19 | ->children() 20 | ->booleanNode('enabled') 21 | ->beforeNormalization() 22 | ->ifString() 23 | ->then(function ($v) { 24 | return in_array($v, ['1', 'true', 'on']); 25 | }) 26 | ->end() 27 | ->isRequired() 28 | ->end() 29 | ->arrayNode('auth') 30 | ->children() 31 | ->scalarNode('token')->defaultNull()->end() 32 | ->end() 33 | ->end() 34 | ->arrayNode('connection') 35 | ->addDefaultsIfNotSet() 36 | ->children() 37 | ->scalarNode('schema')->defaultValue('https')->end() 38 | ->scalarNode('host')->defaultNull()->end() 39 | ->scalarNode('port')->defaultValue(8200)->end() 40 | ->scalarNode('api_version')->defaultValue('v1')->end() 41 | ->end() 42 | ->end() 43 | ->end() 44 | ; 45 | 46 | return $treeBuilder; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /phpunit.xml.dist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | ./Tests/Unit 33 | 34 | 35 | ./Tests/Functional 36 | 37 | 38 | 39 | 40 | 41 | ./ 42 | 43 | ./Resources 44 | ./Tests 45 | ./vendor 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /DependencyInjection/FourxxiVaultExtension.php: -------------------------------------------------------------------------------- 1 | load('services.yml'); 25 | 26 | $configuration = new Configuration(); 27 | $config = $this->processConfiguration($configuration, $configs); 28 | 29 | $container->setDefinition('fourxxi_vault.auth', $this->getAuthDefinition($config)); 30 | $container->getDefinition('fourxxi_vault.client.base_uri_configurator')->addArgument($config); 31 | 32 | $container->setParameter('fourxxi_vault.enabled', $config['enabled']); 33 | } 34 | 35 | /** 36 | * @param array $config 37 | * 38 | * @return Definition 39 | */ 40 | protected function getAuthDefinition(array $config) 41 | { 42 | if ($config['enabled'] === false) { 43 | return new Definition(TokenAuth::class, ['']); 44 | } 45 | 46 | if (empty($config['auth'])) { 47 | throw new \LogicException('You should set authentication method'); 48 | } 49 | 50 | if (count($config['auth']) > 1) { 51 | throw new \LogicException('Only one authentication method can be set'); 52 | } 53 | 54 | if (isset($config['auth']['token'])) { 55 | return new Definition(TokenAuth::class, [$config['auth']['token']]); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Tests/Functional/VaultParameterProviderTest.php: -------------------------------------------------------------------------------- 1 | getContainer(); 15 | $writerClient = $container->get('fourxxi_vault.test.writer_client'); 16 | $writerClient->write($path, $input); 17 | 18 | $vaultParameterProviderFactory = $container->get('fourxxi_vault.parameter_provider.vault_factory'); 19 | 20 | $parameterProvider = $vaultParameterProviderFactory->create( 21 | $path, 22 | $container->get(sprintf('fourxxi_vault.test.mapper.%s', $mapper)) 23 | ); 24 | 25 | $this->assertEquals($parameterProvider->all(), $output); 26 | } 27 | 28 | /** 29 | * @return string 30 | */ 31 | protected function getEnvironment(): string 32 | { 33 | return 'vault_parameter_test'; 34 | } 35 | 36 | /** 37 | * @return array 38 | */ 39 | public function dataProvider() 40 | { 41 | $mysqlOutput = [ 42 | 'mysql_host' => '192.168.0.1', 43 | 'mysql_port' => 3306, 44 | ]; 45 | 46 | $elasticsearchOutput = [ 47 | 'elasticsearch_host' => '127.0.0.1', 48 | 'elasticsearch_port' => 9200, 49 | ]; 50 | 51 | return [ 52 | 'simple_mapper' => [ 53 | 'path' => 'secret/mysql', 54 | 'mapper' => 'simple', 55 | 'input' => $mysqlOutput, 56 | 'output' => $mysqlOutput, 57 | ], 58 | 'yaml_mapper' => [ 59 | 'path' => 'secret/elasticsearch', 60 | 'mapper' => 'yaml', 61 | 'input' => [ 62 | 'value' => Yaml::dump($elasticsearchOutput), 63 | ], 64 | 'output' => $elasticsearchOutput, 65 | ], 66 | ]; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /ParameterProvider/VaultParameterProvider.php: -------------------------------------------------------------------------------- 1 | path = $path; 43 | $this->vaultClient = $vaultClient; 44 | $this->parameterMapper = $parameterMapper; 45 | $this->parameterBag = null; 46 | } 47 | 48 | /** 49 | * {@inheritdoc} 50 | */ 51 | public function get($name) 52 | { 53 | return $this->getParameterBag()->get($name); 54 | } 55 | 56 | /** 57 | * {@inheritdoc} 58 | */ 59 | public function all() 60 | { 61 | return $this->getParameterBag()->all(); 62 | } 63 | 64 | /** 65 | * For lazy load parameters. 66 | * 67 | * @return ParameterBag 68 | */ 69 | protected function getParameterBag() 70 | { 71 | if ($this->parameterBag === null) { 72 | $response = $this->vaultClient->read($this->path); 73 | $this->parameterBag = $this->parameterMapper->map($response); 74 | $this->parameterBag->resolve(); 75 | } 76 | 77 | return $this->parameterBag; 78 | } 79 | } 80 | -------------------------------------------------------------------------------- /Tests/Functional/Kernel.php: -------------------------------------------------------------------------------- 1 | import('config/routing.yml'); 35 | * $routes->add('/admin', 'AppBundle:Admin:dashboard', 'admin_dashboard'); 36 | * 37 | * @param RouteCollectionBuilder $routes 38 | */ 39 | protected function configureRoutes(RouteCollectionBuilder $routes) 40 | { 41 | // TODO: Implement configureRoutes() method. 42 | } 43 | 44 | /** 45 | * Configures the container. 46 | * 47 | * You can register extensions: 48 | * 49 | * $c->loadFromExtension('framework', array( 50 | * 'secret' => '%secret%' 51 | * )); 52 | * 53 | * Or services: 54 | * 55 | * $c->register('halloween', 'FooBundle\HalloweenProvider'); 56 | * 57 | * Or parameters: 58 | * 59 | * $c->setParameter('halloween', 'lot of fun'); 60 | * 61 | * @param ContainerBuilder $c 62 | * @param LoaderInterface $loader 63 | */ 64 | protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader) 65 | { 66 | $loader->load(sprintf('%s/Resources/config/config_%s.yml', __DIR__, $this->getEnvironment())); 67 | } 68 | 69 | public function getCacheDir() 70 | { 71 | return __DIR__.'/var/cache'; 72 | } 73 | 74 | public function getLogDir() 75 | { 76 | return __DIR__.'/var/logs'; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Symfony bundle for integration with Vault by HashiCorp 2 | ### Badges 3 | [![Build Develop Status](https://travis-ci.org/4xxi/vault-bundle.svg?branch=develop)](https://travis-ci.org/4xxi/vault-bundle) 4 | 5 | [![SensioLabsInsight](https://insight.sensiolabs.com/projects/d004e03d-ee45-448f-a897-a55fc1522fde/big.png)](https://insight.sensiolabs.com/projects/d004e03d-ee45-448f-a897-a55fc1522fde) 6 | 7 | ### Full configuration 8 | ```yaml 9 | fourxxi_vault: 10 | enabled: true 11 | auth: 12 | token: "571f9ef0-583b-cf7a-81af-191c43515c8e" 13 | connection: 14 | schema: http 15 | host: 127.0.0.1 16 | port: 8200 17 | api_version: 'v1' 18 | ``` 19 | 20 | ### Examples 21 | ```yaml 22 | app.vault.mapper.yaml: 23 | class: Fourxxi\Bundle\VaultBundle\ParameterMapper\YamlParameterMapper 24 | arguments: ["value"] 25 | 26 | app.vault.mapper.simple: 27 | class: Fourxxi\Bundle\VaultBundle\ParameterMapper\SimpleParameterMapper 28 | 29 | # for cached parameters 30 | app.vault.parameter_provider.elasticsearch: 31 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\VaultParameterProvider 32 | factory: "fourxxi_vault.parameter_provider.vault_factory:create" 33 | arguments: ["secret/elasticsearch", "@app.vault.mapper.yaml"] 34 | tags: 35 | - { name: fourxxi_vault.cached_parameters } 36 | 37 | app.vault.parameter_provider.mysql: 38 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\VaultParameterProvider 39 | factory: "fourxxi_vault.parameter_provider.vault_factory:create" 40 | arguments: ["secret/mysql", "@app.vault.mapper.simple"] 41 | tags: 42 | - { name: fourxxi_vault.cached_parameters } 43 | 44 | # For dynamic parameters 45 | app.vault.enabled_parameter_provider.elasticsearch: 46 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\VaultParameterProvider 47 | factory: "fourxxi_vault.parameter_provider.vault_factory:create" 48 | arguments: ["secret/elasticsearch", "@app.vault.mapper.yaml"] 49 | tags: 50 | - { name: fourxxi_vault.enabled_parameter_provider, provider_name: 'el' } 51 | 52 | app.vault.disabled_parameters_provider.elasticsearch: 53 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\SimpleParameterProvider 54 | arguments: ["@=service('service_container').getParameterBag()"] 55 | tags: 56 | - { name: fourxxi_vault.disabled_parameter_provider, provider_name: 'el' } 57 | 58 | app.vault.enabled_parameter_provider.mysql: 59 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\VaultParameterProvider 60 | factory: "fourxxi_vault.parameter_provider.vault_factory:create" 61 | arguments: ["secret/mysql", "@app.vault.mapper.simple"] 62 | tags: 63 | - { name: fourxxi_vault.enabled_parameter_provider, provider_name: 'mysql' } 64 | 65 | app.vault.disabled_parameters_provider.mysql: 66 | class: Fourxxi\Bundle\VaultBundle\ParameterProvider\SimpleParameterProvider 67 | arguments: ["@=service('service_container').getParameterBag()"] 68 | tags: 69 | - { name: fourxxi_vault.disabled_parameter_provider, provider_name: 'mysql' } 70 | 71 | app.test.elasticsearch: 72 | class: App\Test 73 | public: true 74 | arguments: 75 | - "@=v('el','elasticsearch_host')" 76 | - "@=vault('el','elasticsearch_password')" 77 | 78 | app.test.mysql: 79 | class: App\Test 80 | public: true 81 | arguments: 82 | - "@=fourxxi_vault('mysql', 'database_pass')" 83 | - "@=service('fourxxi_vault.parameter_getter').get('mysql','database_host')" 84 | ``` 85 | 86 | ### Running unit tests: 87 | ```bash 88 | ./vendor/bin/phpunit --testsuite unit 89 | ``` 90 | 91 | ### Running functional tests: 92 | 93 | Run vault: 94 | ```bash 95 | docker run -d -p 8200:8200 --cap-add=IPC_LOCK -e 'VAULT_DEV_ROOT_TOKEN_ID=f29e2a2f-26ac-a182-b7a9-05be2381e200' vault 96 | ``` 97 | 98 | Run tests for Symfony 2.8 99 | ```bash 100 | ./vendor/bin/simple-phpunit --testsuite functional 101 | ``` 102 | 103 | Run tests for Symfony >= 3 104 | ```bash 105 | ./vendor/bin/phpunit --testsuite functional 106 | ``` 107 | 108 | ### @todo 109 | 110 | 1. Adding more tests 111 | 2. Writing documentation 112 | --------------------------------------------------------------------------------