mirror of
https://github.com/dyzulk/trustlab-api.git
synced 2026-01-26 05:15:35 +07:00
Fix: Resolve broken references in RootCaApiController & OpenSslService
This commit is contained in:
@@ -10,10 +10,12 @@ use Illuminate\Http\Request;
|
||||
class RootCaApiController extends Controller
|
||||
{
|
||||
protected $sslService;
|
||||
protected $installerService;
|
||||
|
||||
public function __construct(OpenSslService $sslService)
|
||||
public function __construct(OpenSslService $sslService, \App\Services\CaInstallerService $installerService)
|
||||
{
|
||||
$this->sslService = $sslService;
|
||||
$this->installerService = $installerService;
|
||||
}
|
||||
|
||||
public function index()
|
||||
@@ -96,7 +98,7 @@ class RootCaApiController extends Controller
|
||||
$certificates = CaCertificate::all();
|
||||
$count = 0;
|
||||
foreach ($certificates as $cert) {
|
||||
if ($this->sslService->uploadIndividualInstallersOnly($cert, $mode)) {
|
||||
if ($this->installerService->uploadIndividualInstallersOnly($cert, $mode)) {
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
@@ -110,7 +112,7 @@ class RootCaApiController extends Controller
|
||||
{
|
||||
$this->authorizeAdminOrOwner();
|
||||
try {
|
||||
if ($this->sslService->syncAllBundles()) {
|
||||
if ($this->installerService->syncAllBundles()) {
|
||||
return response()->json(['status' => 'success', 'message' => "Successfully synced All-in-One bundles."]);
|
||||
}
|
||||
return response()->json(['status' => 'error', 'message' => 'No certificates found to bundle.'], 404);
|
||||
@@ -130,13 +132,13 @@ class RootCaApiController extends Controller
|
||||
|
||||
foreach ($certificates as $cert) {
|
||||
if ($this->sslService->uploadPublicCertsOnly($cert, $mode)) {
|
||||
$this->sslService->uploadIndividualInstallersOnly($cert, $mode);
|
||||
$this->installerService->uploadIndividualInstallersOnly($cert, $mode);
|
||||
$count++;
|
||||
}
|
||||
}
|
||||
|
||||
// Also sync bundles (Always 'latest' as bundles are aggregate)
|
||||
$this->sslService->syncAllBundles();
|
||||
$this->installerService->syncAllBundles();
|
||||
|
||||
return response()->json([
|
||||
'status' => 'success',
|
||||
|
||||
@@ -468,7 +468,9 @@ class OpenSslService
|
||||
}
|
||||
|
||||
// 4. Final Mass Sync
|
||||
$this->syncAllBundles();
|
||||
// 4. Final Mass Sync
|
||||
$installerService = app(\App\Services\CaInstallerService::class);
|
||||
$installerService->syncAllBundles();
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -503,7 +505,8 @@ class OpenSslService
|
||||
|
||||
// Sync to CDN
|
||||
$this->uploadPublicCertsOnly($newCert, 'both');
|
||||
$this->uploadIndividualInstallersOnly($newCert, 'both');
|
||||
$installerService = app(\App\Services\CaInstallerService::class);
|
||||
$installerService->uploadIndividualInstallersOnly($newCert, 'both');
|
||||
|
||||
return $newCert;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user