mirror of
https://github.com/tiennm99/coolify.git
synced 2026-09-10 06:20:26 +00:00
fix(security): enforce GitLab App authorization parity with GitHub
GitlabAppPolicy previously allowed any authenticated user to update, delete, and create GitLab sources. Align it with GithubAppPolicy, require Application create authorization on the private-repo wizard, and reject OAuth callbacks from non-admins so members cannot escalate privileges.
This commit is contained in:
@@ -7,11 +7,14 @@ use App\Models\GitlabApp;
|
||||
use App\Models\Project;
|
||||
use App\Rules\ValidGitBranch;
|
||||
use App\Support\ValidationPatterns;
|
||||
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Livewire\Component;
|
||||
|
||||
class GitlabPrivateRepository extends Component
|
||||
{
|
||||
use AuthorizesRequests;
|
||||
|
||||
public $current_step = 'gitlab_apps';
|
||||
|
||||
public $gitlab_apps;
|
||||
@@ -158,6 +161,8 @@ class GitlabPrivateRepository extends Component
|
||||
public function submit()
|
||||
{
|
||||
try {
|
||||
$this->authorize('create', Application::class);
|
||||
|
||||
$validator = validator([
|
||||
'selected_repository_path' => $this->selected_repository_path,
|
||||
'selected_branch_name' => $this->selected_branch_name,
|
||||
|
||||
Reference in New Issue
Block a user