Skip to content

Commit f02e811

Browse files
committed
fix(security): load registry without password query
1 parent 085017c commit f02e811

File tree

1 file changed

+2
-7
lines changed
  • app/Livewire/Security/DockerRegistry

1 file changed

+2
-7
lines changed

app/Livewire/Security/DockerRegistry/Show.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,14 +41,9 @@ protected function rules(): array
4141
public function mount()
4242
{
4343
try {
44-
$this->registry = DockerRegistry::ownedByCurrentTeam(['name', 'description', 'registry_url', 'username', 'team_id'])
44+
$this->registry = DockerRegistry::ownedByCurrentTeam()
4545
->whereUuid(request()->registry_uuid)
4646
->firstOrFail();
47-
$this->hasPassword = DockerRegistry::ownedByCurrentTeam()
48-
->whereKey($this->registry->id)
49-
->whereNotNull('password')
50-
->where('password', '!=', '')
51-
->exists();
5247

5348
$this->authorize('view', $this->registry);
5449

@@ -115,7 +110,7 @@ public function save()
115110
}
116111

117112
$this->registry->save();
118-
$this->hasPassword = ! empty($this->registry->password);
113+
$this->hasPassword = filled($this->registry->password);
119114
$this->originalUsername = $this->registry->username;
120115
$this->password = null;
121116

0 commit comments

Comments
 (0)