Merge pull request #55471 from SUNET/kano-ocm-discovery

fix(OCM): align parameter naming with spec and extend OCMProvider
pull/55829/head
Andy Scherzinger 2025-10-28 14:52:04 +07:00 committed by GitHub
commit 4174c580b3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 12 additions and 10 deletions

@ -236,7 +236,7 @@ class RequestHandlerController extends Controller {
* *
* @param string $recipientProvider The address of the recipent's provider * @param string $recipientProvider The address of the recipent's provider
* @param string $token The token used for the invitation * @param string $token The token used for the invitation
* @param string $userId The userId of the recipient at the recipient's provider * @param string $userID The userID of the recipient at the recipient's provider
* @param string $email The email address of the recipient * @param string $email The email address of the recipient
* @param string $name The display name of the recipient * @param string $name The display name of the recipient
* *
@ -251,8 +251,8 @@ class RequestHandlerController extends Controller {
#[PublicPage] #[PublicPage]
#[NoCSRFRequired] #[NoCSRFRequired]
#[BruteForceProtection(action: 'inviteAccepted')] #[BruteForceProtection(action: 'inviteAccepted')]
public function inviteAccepted(string $recipientProvider, string $token, string $userId, string $email, string $name): JSONResponse { public function inviteAccepted(string $recipientProvider, string $token, string $userID, string $email, string $name): JSONResponse {
$this->logger->debug('Processing share invitation for ' . $userId . ' with token ' . $token . ' and email ' . $email . ' and name ' . $name); $this->logger->debug('Processing share invitation for ' . $userID . ' with token ' . $token . ' and email ' . $email . ' and name ' . $name);
$updated = $this->timeFactory->getTime(); $updated = $this->timeFactory->getTime();
@ -309,7 +309,7 @@ class RequestHandlerController extends Controller {
$invitation->setRecipientEmail($email); $invitation->setRecipientEmail($email);
$invitation->setRecipientName($name); $invitation->setRecipientName($name);
$invitation->setRecipientProvider($recipientProvider); $invitation->setRecipientProvider($recipientProvider);
$invitation->setRecipientUserId($userId); $invitation->setRecipientUserId($userID);
$invitation->setAcceptedAt($updated); $invitation->setAcceptedAt($updated);
$invitation = $this->federatedInviteMapper->update($invitation); $invitation = $this->federatedInviteMapper->update($invitation);

@ -354,7 +354,7 @@
"required": [ "required": [
"recipientProvider", "recipientProvider",
"token", "token",
"userId", "userID",
"email", "email",
"name" "name"
], ],
@ -367,9 +367,9 @@
"type": "string", "type": "string",
"description": "The token used for the invitation" "description": "The token used for the invitation"
}, },
"userId": { "userID": {
"type": "string", "type": "string",
"description": "The userId of the recipient at the recipient's provider" "description": "The userID of the recipient at the recipient's provider"
}, },
"email": { "email": {
"type": "string", "type": "string",

@ -227,6 +227,7 @@ class OCMProvider implements ICapabilityAwareOCMProvider {
} }
$this->setResourceTypes($resources); $this->setResourceTypes($resources);
$this->setInviteAcceptDialog($data['inviteAcceptDialog'] ?? ''); $this->setInviteAcceptDialog($data['inviteAcceptDialog'] ?? '');
$this->setCapabilities($data['capabilities'] ?? []);
if (isset($data['publicKey'])) { if (isset($data['publicKey'])) {
// import details about the remote request signing public key, if available // import details about the remote request signing public key, if available
@ -268,6 +269,7 @@ class OCMProvider implements ICapabilityAwareOCMProvider {
'version' => $this->getApiVersion(), // informative but real version 'version' => $this->getApiVersion(), // informative but real version
'endPoint' => $this->getEndPoint(), 'endPoint' => $this->getEndPoint(),
'publicKey' => $this->getSignatory()?->jsonSerialize(), 'publicKey' => $this->getSignatory()?->jsonSerialize(),
'provider' => $this->getProvider(),
'resourceTypes' => $resourceTypes 'resourceTypes' => $resourceTypes
]; ];

@ -15985,7 +15985,7 @@
"required": [ "required": [
"recipientProvider", "recipientProvider",
"token", "token",
"userId", "userID",
"email", "email",
"name" "name"
], ],
@ -15998,9 +15998,9 @@
"type": "string", "type": "string",
"description": "The token used for the invitation" "description": "The token used for the invitation"
}, },
"userId": { "userID": {
"type": "string", "type": "string",
"description": "The userId of the recipient at the recipient's provider" "description": "The userID of the recipient at the recipient's provider"
}, },
"email": { "email": {
"type": "string", "type": "string",