-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of github.com:Catrobat/Catroweb-API
- Loading branch information
Showing
58 changed files
with
433 additions
and
107 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -28,6 +28,7 @@ | |
|
||
namespace OpenAPI\Server\Api; | ||
|
||
use OpenAPI\Server\Model\InlineObject; | ||
use OpenAPI\Server\Model\RegisterRequest; | ||
use OpenAPI\Server\Model\UpdateUserRequest; | ||
|
||
|
@@ -112,6 +113,17 @@ public function userPost(RegisterRequest $register_request, string $accept_langu | |
*/ | ||
public function userPut(UpdateUserRequest $update_user_request, string $accept_language = null, &$responseCode, array &$responseHeaders); | ||
|
||
/** | ||
* Operation userResetPasswordPost. | ||
* | ||
* Request email to reset password | ||
* | ||
* @param \OpenAPI\Server\Model\InlineObject $inline_object (required) | ||
* @param \int $responseCode The HTTP response code to return | ||
* @param \array $responseHeaders Additional HTTP headers to return with the response () | ||
*/ | ||
public function userResetPasswordPost(InlineObject $inline_object, &$responseCode, array &$responseHeaders); | ||
|
||
/** | ||
* Operation usersSearchGet. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,7 +15,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
@@ -488,6 +488,88 @@ public function userPutAction(Request $request) | |
} | ||
} | ||
|
||
/** | ||
* Operation userResetPasswordPost. | ||
* | ||
* Request email to reset password | ||
* | ||
* @param Request $request the Symfony request to handle | ||
* | ||
* @return Response the Symfony response | ||
*/ | ||
public function userResetPasswordPostAction(Request $request) | ||
{ | ||
// Make sure that the client is providing something that we can consume | ||
$consumes = ['application/json']; | ||
if (!static::isContentTypeAllowed($request, $consumes)) { | ||
// We can't consume the content that the client is sending us | ||
return new Response('', 415); | ||
} | ||
|
||
// Handle authentication | ||
|
||
// Read out all input parameter values into variables | ||
$inline_object = $request->getContent(); | ||
|
||
// Use the default value if no value was provided | ||
|
||
// Deserialize the input values that needs it | ||
try { | ||
$inputFormat = $request->getMimeType($request->getContentType()); | ||
$inline_object = $this->deserialize($inline_object, 'OpenAPI\Server\Model\InlineObject', $inputFormat); | ||
} catch (SerializerRuntimeException $exception) { | ||
return $this->createBadRequestResponse($exception->getMessage()); | ||
} | ||
|
||
// Validate the input values | ||
$asserts = []; | ||
$asserts[] = new Assert\NotNull(); | ||
$asserts[] = new Assert\Type('OpenAPI\\Server\\Model\\InlineObject'); | ||
$asserts[] = new Assert\Valid(); | ||
$response = $this->validate($inline_object, $asserts); | ||
if ($response instanceof Response) { | ||
return $response; | ||
} | ||
|
||
try { | ||
$handler = $this->getApiHandler(); | ||
|
||
// Make the call to the business logic | ||
$responseCode = 204; | ||
$responseHeaders = []; | ||
$result = $handler->userResetPasswordPost($inline_object, $responseCode, $responseHeaders); | ||
|
||
// Find default response message | ||
$message = ''; | ||
|
||
// Find a more specific message, if available | ||
switch ($responseCode) { | ||
case 204: | ||
$message = 'If an account with the provided email exists, an email to reset the password has been send to the user.'; | ||
break; | ||
case 400: | ||
$message = 'Bad request (Invalid, or missing parameters)'; | ||
break; | ||
case 415: | ||
$message = 'Unsupported Media Type - request must use application/json as content type'; | ||
break; | ||
} | ||
|
||
return new Response( | ||
'', | ||
$responseCode, | ||
array_merge( | ||
$responseHeaders, | ||
[ | ||
'X-OpenAPI-Message' => $message, | ||
] | ||
) | ||
); | ||
} catch (Exception $fallthrough) { | ||
return $this->createErrorResponse(new HttpException(500, 'An unsuspected error occurred.', $fallthrough)); | ||
} | ||
} | ||
|
||
/** | ||
* Operation usersSearchGet. | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,7 +16,7 @@ | |
* | ||
* API for the Catrobat Share Platform | ||
* | ||
* The version of the OpenAPI document: v1.1.0 | ||
* The version of the OpenAPI document: v1.0.65 | ||
* Contact: [email protected] | ||
* Generated by: https://github.com/openapitools/openapi-generator.git | ||
*/ | ||
|
Oops, something went wrong.