Skip to content

Commit 56a79b9

Browse files
Merge pull request nextcloud#56056 from nextcloud/backport/55471/stable32
[stable32] fix(OCM): align parameter naming with spec and extend OCMProvider
2 parents 6d47668 + 5111f01 commit 56a79b9

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

apps/cloud_federation_api/lib/Controller/RequestHandlerController.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
236236
*
237237
* @param string $recipientProvider The address of the recipent's provider
238238
* @param string $token The token used for the invitation
239-
* @param string $userId The userId of the recipient at the recipient's provider
239+
* @param string $userID The userID of the recipient at the recipient's provider
240240
* @param string $email The email address of the recipient
241241
* @param string $name The display name of the recipient
242242
*
@@ -251,8 +251,8 @@ public function addShare($shareWith, $name, $description, $providerId, $owner, $
251251
#[PublicPage]
252252
#[NoCSRFRequired]
253253
#[BruteForceProtection(action: 'inviteAccepted')]
254-
public function inviteAccepted(string $recipientProvider, string $token, string $userId, string $email, string $name): JSONResponse {
255-
$this->logger->debug('Processing share invitation for ' . $userId . ' with token ' . $token . ' and email ' . $email . ' and name ' . $name);
254+
public function inviteAccepted(string $recipientProvider, string $token, string $userID, string $email, string $name): JSONResponse {
255+
$this->logger->debug('Processing share invitation for ' . $userID . ' with token ' . $token . ' and email ' . $email . ' and name ' . $name);
256256

257257
$updated = $this->timeFactory->getTime();
258258

@@ -309,7 +309,7 @@ public function inviteAccepted(string $recipientProvider, string $token, string
309309
$invitation->setRecipientEmail($email);
310310
$invitation->setRecipientName($name);
311311
$invitation->setRecipientProvider($recipientProvider);
312-
$invitation->setRecipientUserId($userId);
312+
$invitation->setRecipientUserId($userID);
313313
$invitation->setAcceptedAt($updated);
314314
$invitation = $this->federatedInviteMapper->update($invitation);
315315

apps/cloud_federation_api/openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@
354354
"required": [
355355
"recipientProvider",
356356
"token",
357-
"userId",
357+
"userID",
358358
"email",
359359
"name"
360360
],
@@ -367,9 +367,9 @@
367367
"type": "string",
368368
"description": "The token used for the invitation"
369369
},
370-
"userId": {
370+
"userID": {
371371
"type": "string",
372-
"description": "The userId of the recipient at the recipient's provider"
372+
"description": "The userID of the recipient at the recipient's provider"
373373
},
374374
"email": {
375375
"type": "string",

lib/private/OCM/Model/OCMProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,7 @@ public function import(array $data): static {
227227
}
228228
$this->setResourceTypes($resources);
229229
$this->setInviteAcceptDialog($data['inviteAcceptDialog'] ?? '');
230+
$this->setCapabilities($data['capabilities'] ?? []);
230231

231232
if (isset($data['publicKey'])) {
232233
// import details about the remote request signing public key, if available
@@ -268,6 +269,7 @@ public function jsonSerialize(): array {
268269
'version' => $this->getApiVersion(), // informative but real version
269270
'endPoint' => $this->getEndPoint(),
270271
'publicKey' => $this->getSignatory()?->jsonSerialize(),
272+
'provider' => $this->getProvider(),
271273
'resourceTypes' => $resourceTypes
272274
];
273275

openapi.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15723,7 +15723,7 @@
1572315723
"required": [
1572415724
"recipientProvider",
1572515725
"token",
15726-
"userId",
15726+
"userID",
1572715727
"email",
1572815728
"name"
1572915729
],
@@ -15736,9 +15736,9 @@
1573615736
"type": "string",
1573715737
"description": "The token used for the invitation"
1573815738
},
15739-
"userId": {
15739+
"userID": {
1574015740
"type": "string",
15741-
"description": "The userId of the recipient at the recipient's provider"
15741+
"description": "The userID of the recipient at the recipient's provider"
1574215742
},
1574315743
"email": {
1574415744
"type": "string",

0 commit comments

Comments
 (0)