mirror of
https://github.com/coollabsio/coolify.git
synced 2026-11-06 21:18:11 -04:00
fix(gitlab): check the private key before using it for git commands
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
739d9e9d23
commit
7c21c330c9
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
use App\Models\GitlabApp;
|
||||
use App\Models\PrivateKey;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Http;
|
||||
|
||||
@@ -83,6 +84,13 @@ function gitlabApi(GitlabApp $source, string $endpoint, string $method = 'get',
|
||||
];
|
||||
}
|
||||
|
||||
function gitlabAppPrivateKey(GitlabApp $source): ?PrivateKey
|
||||
{
|
||||
$privateKey = $source->privateKey;
|
||||
|
||||
return $privateKey?->team_id === $source->team_id ? $privateKey : null;
|
||||
}
|
||||
|
||||
function generateGitlabCloneToken(GitlabApp $source): string
|
||||
{
|
||||
refreshGitlabToken($source);
|
||||
|
||||
Reference in New Issue
Block a user