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
|
class RootCaApiController extends Controller
|
||||||
{
|
{
|
||||||
protected $sslService;
|
protected $sslService;
|
||||||
|
protected $installerService;
|
||||||
|
|
||||||
public function __construct(OpenSslService $sslService)
|
public function __construct(OpenSslService $sslService, \App\Services\CaInstallerService $installerService)
|
||||||
{
|
{
|
||||||
$this->sslService = $sslService;
|
$this->sslService = $sslService;
|
||||||
|
$this->installerService = $installerService;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
@@ -96,7 +98,7 @@ class RootCaApiController extends Controller
|
|||||||
$certificates = CaCertificate::all();
|
$certificates = CaCertificate::all();
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($certificates as $cert) {
|
foreach ($certificates as $cert) {
|
||||||
if ($this->sslService->uploadIndividualInstallersOnly($cert, $mode)) {
|
if ($this->installerService->uploadIndividualInstallersOnly($cert, $mode)) {
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -110,7 +112,7 @@ class RootCaApiController extends Controller
|
|||||||
{
|
{
|
||||||
$this->authorizeAdminOrOwner();
|
$this->authorizeAdminOrOwner();
|
||||||
try {
|
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' => 'success', 'message' => "Successfully synced All-in-One bundles."]);
|
||||||
}
|
}
|
||||||
return response()->json(['status' => 'error', 'message' => 'No certificates found to bundle.'], 404);
|
return response()->json(['status' => 'error', 'message' => 'No certificates found to bundle.'], 404);
|
||||||
@@ -130,13 +132,13 @@ class RootCaApiController extends Controller
|
|||||||
|
|
||||||
foreach ($certificates as $cert) {
|
foreach ($certificates as $cert) {
|
||||||
if ($this->sslService->uploadPublicCertsOnly($cert, $mode)) {
|
if ($this->sslService->uploadPublicCertsOnly($cert, $mode)) {
|
||||||
$this->sslService->uploadIndividualInstallersOnly($cert, $mode);
|
$this->installerService->uploadIndividualInstallersOnly($cert, $mode);
|
||||||
$count++;
|
$count++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Also sync bundles (Always 'latest' as bundles are aggregate)
|
// Also sync bundles (Always 'latest' as bundles are aggregate)
|
||||||
$this->sslService->syncAllBundles();
|
$this->installerService->syncAllBundles();
|
||||||
|
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'status' => 'success',
|
'status' => 'success',
|
||||||
|
|||||||
@@ -468,7 +468,9 @@ class OpenSslService
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 4. Final Mass Sync
|
// 4. Final Mass Sync
|
||||||
$this->syncAllBundles();
|
// 4. Final Mass Sync
|
||||||
|
$installerService = app(\App\Services\CaInstallerService::class);
|
||||||
|
$installerService->syncAllBundles();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -503,7 +505,8 @@ class OpenSslService
|
|||||||
|
|
||||||
// Sync to CDN
|
// Sync to CDN
|
||||||
$this->uploadPublicCertsOnly($newCert, 'both');
|
$this->uploadPublicCertsOnly($newCert, 'both');
|
||||||
$this->uploadIndividualInstallersOnly($newCert, 'both');
|
$installerService = app(\App\Services\CaInstallerService::class);
|
||||||
|
$installerService->uploadIndividualInstallersOnly($newCert, 'both');
|
||||||
|
|
||||||
return $newCert;
|
return $newCert;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user