Skip to content

Commit 4174c58

Browse files
Merge pull request #55471 from SUNET/kano-ocm-discovery
fix(OCM): align parameter naming with spec and extend OCMProvider
2 parents 2addf7b + a171fbf commit 4174c58

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
@@ -15985,7 +15985,7 @@
1598515985
"required": [
1598615986
"recipientProvider",
1598715987
"token",
15988-
"userId",
15988+
"userID",
1598915989
"email",
1599015990
"name"
1599115991
],
@@ -15998,9 +15998,9 @@
1599815998
"type": "string",
1599915999
"description": "The token used for the invitation"
1600016000
},
16001-
"userId": {
16001+
"userID": {
1600216002
"type": "string",
16003-
"description": "The userId of the recipient at the recipient's provider"
16003+
"description": "The userID of the recipient at the recipient's provider"
1600416004
},
1600516005
"email": {
1600616006
"type": "string",

0 commit comments

Comments
 (0)