2017-10-25 04:35:25 +00:00
|
|
|
<?php
|
|
|
|
|
2018-01-20 02:01:56 +00:00
|
|
|
namespace Pterodactyl\Http\Requests\Api\Remote;
|
2017-10-25 04:35:25 +00:00
|
|
|
|
2018-01-12 04:49:46 +00:00
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
2017-10-25 04:35:25 +00:00
|
|
|
|
2018-01-12 04:49:46 +00:00
|
|
|
class SftpAuthenticationFormRequest extends FormRequest
|
2017-10-25 04:35:25 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Authenticate the request.
|
|
|
|
*
|
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function authorize()
|
|
|
|
{
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Rules to apply to the request.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function rules()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'username' => 'required|string',
|
|
|
|
'password' => 'required|string',
|
2021-08-07 23:10:24 +00:00
|
|
|
'type' => 'required|in:password,publicKey',
|
2017-10-25 04:35:25 +00:00
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return only the fields that we are interested in from the request.
|
|
|
|
* This will include empty fields as a null value.
|
|
|
|
*
|
|
|
|
* @return array
|
|
|
|
*/
|
|
|
|
public function normalize()
|
|
|
|
{
|
|
|
|
return $this->only(
|
|
|
|
array_keys($this->rules())
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|