Read Testrig backend credentials from managed files #1

Merged
mag merged 2 commits from managed-runtime-credentials into main 2026-12-01 09:15:23 +00:00
2 changed files with 12 additions and 3 deletions
Showing only changes of commit 297089a5cf - Show all commits
+2 -2
View File
@@ -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);
}); });
}); });
+10 -1
View File
@@ -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.');
} }