Skip to content

Commit ed681de

Browse files
committed
feat(OCM-invites): Bumpversion and rename migration
This needs to be done for migration to take affect Signed-off-by: Micke Nordin <kano@sunet.se>
1 parent 6593fd8 commit ed681de

File tree

3 files changed

+12
-21
lines changed

3 files changed

+12
-21
lines changed

apps/cloud_federation_api/appinfo/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<name>Cloud Federation API</name>
1010
<summary>Enable clouds to communicate with each other and exchange data</summary>
1111
<description>The Cloud Federation API enables various Nextcloud instances to communicate with each other and to exchange data.</description>
12-
<version>1.15.0</version>
12+
<version>1.16.0</version>
1313
<licence>agpl</licence>
1414
<author>Bjoern Schiessle</author>
1515
<namespace>CloudFederationAPI</namespace>

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,7 @@
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
}

apps/cloud_federation_api/lib/Migration/Version1015Date202502262004.php renamed to apps/cloud_federation_api/lib/Migration/Version1016Date202502262004.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use OCP\Migration\IOutput;
1616
use OCP\Migration\SimpleMigrationStep;
1717

18-
class Version1015Date202502262004 extends SimpleMigrationStep
18+
class Version1016Date202502262004 extends SimpleMigrationStep
1919
{
2020

2121
/**

0 commit comments

Comments
 (0)