OpenAPI Docs and additional password protection on self update route: (#3320)

This commit is contained in:
David Bomba 2020-02-12 21:06:59 +11:00 committed by GitHub
parent 3a76d8bc34
commit f04f2b15fd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 76 additions and 44 deletions

View File

@ -23,6 +23,38 @@ class SelfUpdateController extends BaseController
}
/**
*
*
* @OA\Post(
* path="/api/v1/self-update",
* operationId="selfUpdate",
* tags={"update"},
* summary="Performs a system update",
* description="Performs a system update",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Token"),
* @OA\Parameter(ref="#/components/parameters/X-Api-Password"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\Response(
* response=200,
* description="Success/failure response"
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
*
*/
public function update(UpdaterManager $updater)
{

View File

@ -112,7 +112,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::post('templates', 'TemplateController@show')->name('templates.show');
Route::post('self-update', 'SelfUpdateController@update');
Route::post('self-update', 'SelfUpdateController@update')->middleware('password_protected');
/*
Route::resource('tasks', 'TaskController'); // name = (tasks. index / create / show / update / destroy / edit