6060 * @psalm-import-type CloudFederationAPIError from ResponseDefinitions
6161 */
6262#[OpenAPI(scope: OpenAPI::SCOPE_FEDERATION )]
63- class RequestHandlerController extends Controller
64- {
63+ class RequestHandlerController extends Controller {
6564 public function __construct (
6665 string $ appName ,
6766 IRequest $ request ,
@@ -108,8 +107,7 @@ public function __construct(
108107 #[PublicPage]
109108 #[NoCSRFRequired]
110109 #[BruteForceProtection(action: 'receiveFederatedShare ' )]
111- public function addShare ($ shareWith , $ name , $ description , $ providerId , $ owner , $ ownerDisplayName , $ sharedBy , $ sharedByDisplayName , $ protocol , $ shareType , $ resourceType )
112- {
110+ public function addShare ($ shareWith , $ name , $ description , $ providerId , $ owner , $ ownerDisplayName , $ sharedBy , $ sharedByDisplayName , $ protocol , $ shareType , $ resourceType ) {
113111 try {
114112 // if request is signed and well signed, no exception are thrown
115113 // if request is not signed and host is known for not supporting signed request, no exception are thrown
@@ -121,8 +119,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
121119 }
122120
123121 // check if all required parameters are set
124- if (
125- $ shareWith === null ||
122+ if ($ shareWith === null ||
126123 $ name === null ||
127124 $ providerId === null ||
128125 $ resourceType === null ||
@@ -198,7 +195,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
198195 $ share = $ this ->factory ->getCloudFederationShare ($ shareWith , $ name , $ description , $ providerId , $ owner , $ ownerDisplayName , $ sharedBy , $ sharedByDisplayName , '' , $ shareType , $ resourceType );
199196 $ share ->setProtocol ($ protocol );
200197 $ provider ->shareReceived ($ share );
201- } catch (ProviderDoesNotExistsException | ProviderCouldNotAddShareException $ e ) {
198+ } catch (ProviderDoesNotExistsException | ProviderCouldNotAddShareException $ e ) {
202199 return new JSONResponse (
203200 ['message ' => $ e ->getMessage ()],
204201 Http::STATUS_NOT_IMPLEMENTED
@@ -252,8 +249,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
252249 #[PublicPage]
253250 #[NoCSRFRequired]
254251 #[BruteForceProtection(action: 'inviteAccepted ' )]
255- public function inviteAccepted (string $ recipientProvider , string $ token , string $ userId , string $ email , string $ name ): JSONResponse
256- {
252+ public function inviteAccepted (string $ recipientProvider , string $ token , string $ userId , string $ email , string $ name ): JSONResponse {
257253 $ this ->logger ->debug ('Invite accepted for ' . $ userId . ' with token ' . $ token . ' and email ' . $ email . ' and name ' . $ name );
258254
259255 /** @var IQueryBuilder $qb */
@@ -345,8 +341,7 @@ public function inviteAccepted(string $recipientProvider, string $token, string
345341 #[NoCSRFRequired]
346342 #[PublicPage]
347343 #[BruteForceProtection(action: 'receiveFederatedShareNotification ' )]
348- public function receiveNotification ($ notificationType , $ resourceType , $ providerId , ?array $ notification )
349- {
344+ public function receiveNotification ($ notificationType , $ resourceType , $ providerId , ?array $ notification ) {
350345 // check if all required parameters are set
351346 if (
352347 $ notificationType === null ||
@@ -449,8 +444,7 @@ private function mapUid($uid)
449444 * @return IIncomingSignedRequest|null null if remote does not (and never did) support signed request
450445 * @throws IncomingRequestException
451446 */
452- private function getSignedRequest (): ?IIncomingSignedRequest
453- {
447+ private function getSignedRequest (): ?IIncomingSignedRequest {
454448 try {
455449 $ signedRequest = $ this ->signatureManager ->getIncomingSignedRequest ($ this ->signatoryManager );
456450 $ this ->logger ->debug ('signed request available ' , ['signedRequest ' => $ signedRequest ]);
@@ -485,8 +479,7 @@ private function getSignedRequest(): ?IIncomingSignedRequest
485479 *
486480 * @throws IncomingRequestException
487481 */
488- private function confirmSignedOrigin (?IIncomingSignedRequest $ signedRequest , string $ key , string $ value ): void
489- {
482+ private function confirmSignedOrigin (?IIncomingSignedRequest $ signedRequest , string $ key , string $ value ): void {
490483 if ($ signedRequest === null ) {
491484 $ instance = $ this ->getHostFromFederationId ($ value );
492485 try {
@@ -550,8 +543,7 @@ private function confirmNotificationIdentity(
550543 * @return void
551544 * @throws IncomingRequestException
552545 */
553- private function confirmNotificationEntry (?IIncomingSignedRequest $ signedRequest , string $ entry ): void
554- {
546+ private function confirmNotificationEntry (?IIncomingSignedRequest $ signedRequest , string $ entry ): void {
555547 $ instance = $ this ->getHostFromFederationId ($ entry );
556548 if ($ signedRequest === null ) {
557549 try {
@@ -570,8 +562,7 @@ private function confirmNotificationEntry(?IIncomingSignedRequest $signedRequest
570562 * @return string
571563 * @throws IncomingRequestException
572564 */
573- private function getHostFromFederationId (string $ entry ): string
574- {
565+ private function getHostFromFederationId (string $ entry ): string {
575566 if (!str_contains ($ entry , '@ ' )) {
576567 throw new IncomingRequestException ('entry ' . $ entry . ' does not contains @ ' );
577568 }
0 commit comments