Path: blob/1.0-develop/app/Http/Requests/Api/Remote/SftpAuthenticationFormRequest.php
10266 views
<?php12namespace Pterodactyl\Http\Requests\Api\Remote;34use Illuminate\Foundation\Http\FormRequest;56class SftpAuthenticationFormRequest extends FormRequest7{8/**9* Authenticate the request.10*/11public function authorize(): bool12{13return true;14}1516/**17* Rules to apply to the request.18*/19public function rules(): array20{21return [22'type' => ['nullable', 'in:password,public_key'],23'username' => ['required', 'string'],24'password' => ['required', 'string'],25];26}2728/**29* Return only the fields that we are interested in from the request.30* This will include empty fields as a null value.31*/32public function normalize(): array33{34return $this->only(35array_keys($this->rules())36);37}38}394041