Read Testrig backend credentials from managed files #1
@@ -20,7 +20,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
*/
|
*/
|
||||||
public function register(): void
|
public function register(): void
|
||||||
{
|
{
|
||||||
$config = $this->app['config'];
|
$config = $this->app->make('config');
|
||||||
if ($config->get('database.managed_credentials') !== true) {
|
if ($config->get('database.managed_credentials') !== true) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -37,7 +37,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
$manager->extend('mysql', function (array $connection, string $name) {
|
$manager->extend('mysql', function (array $connection, string $name) {
|
||||||
$connection['password'] = ManagedCredentialFiles::databasePassword();
|
$connection['password'] = ManagedCredentialFiles::databasePassword();
|
||||||
|
|
||||||
return $this->app['db.factory']->make($connection, $name);
|
return $this->app->make('db.factory')->make($connection, $name);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,10 @@ use RuntimeException;
|
|||||||
|
|
||||||
final class ManagedPhpRedisConnector extends PhpRedisConnector
|
final class ManagedPhpRedisConnector extends PhpRedisConnector
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @param array<array-key, mixed> $config
|
||||||
|
* @param array<array-key, mixed> $options
|
||||||
|
*/
|
||||||
public function connect(array $config, array $options)
|
public function connect(array $config, array $options)
|
||||||
{
|
{
|
||||||
$config['password'] = ManagedCredentialFiles::redisPassword();
|
$config['password'] = ManagedCredentialFiles::redisPassword();
|
||||||
@@ -15,7 +19,12 @@ final class ManagedPhpRedisConnector extends PhpRedisConnector
|
|||||||
return parent::connect($config, $options);
|
return parent::connect($config, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function connectToCluster(array $config, array $clusterOptions, array $options)
|
/**
|
||||||
|
* @param array<array-key, mixed> $config
|
||||||
|
* @param array<array-key, mixed> $clusterOptions
|
||||||
|
* @param array<array-key, mixed> $options
|
||||||
|
*/
|
||||||
|
public function connectToCluster(array $config, array $clusterOptions, array $options): never
|
||||||
{
|
{
|
||||||
throw new RuntimeException('Managed credential delivery requires standalone Redis.');
|
throw new RuntimeException('Managed credential delivery requires standalone Redis.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user