Update SFTP authentication endpoint to support returning user public keys
This commit is contained in:
parent
cca0010a00
commit
12927a3202
2 changed files with 90 additions and 54 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace Pterodactyl\Http\Requests\Api\Remote;
|
||||
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class SftpAuthenticationFormRequest extends FormRequest
|
||||
|
@ -24,8 +25,11 @@ class SftpAuthenticationFormRequest extends FormRequest
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'username' => 'required|string',
|
||||
'password' => 'required|string',
|
||||
'type' => ['nullable', 'in:password,public_key'],
|
||||
'username' => ['required', 'string'],
|
||||
'password' => [
|
||||
Rule::when(fn () => $this->input('type') !== 'public_key', ['required', 'string'], ['nullable']),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue