Add test coverage and fix permissions mistake

This commit is contained in:
DaneEveritt 2022-05-15 17:30:57 -04:00
parent 8483db755d
commit d4bf6bd46a
No known key found for this signature in database
GPG key ID: EEA66103B3D71F53
4 changed files with 282 additions and 32 deletions

View file

@ -62,7 +62,7 @@ class SftpAuthenticationController extends Controller
}
if (!$key || !$user->sshKeys()->where('fingerprint', $key->getFingerprint('sha256'))->exists()) {
$this->reject($request, false);
$this->reject($request, is_null($key));
}
}
@ -70,7 +70,7 @@ class SftpAuthenticationController extends Controller
return new JsonResponse([
'server' => $server->uuid,
'permissions' => $permissions ?? ['*'],
'permissions' => $this->permissions->handle($server, $user),
]);
}