Compare commits

...

3 Commits

Author SHA1 Message Date
Micke Nordin a8948b18b9 fix(cloud-federation-api): align inviteAccepted parameter naming with spec
- Rename method parameter from `userId` to `userID`.
- Update log message and `setRecipientUserId` call to use new variable.
- Without this change, we can not accept invites.

Signed-off-by: Micke Nordin <kano@sunet.se>
2025-10-17 12:37:08 +02:00
Micke Nordin 6d515e1bf4 fix(ocm): include provider field in OCMProvider serialization
- Add `provider` to `jsonSerialize()` output of OCMProvider.
- Ensures discovery consumers receive provider identifier along with
  endpoint, version, and resources.

Signed-off-by: Micke Nordin <kano@sunet.se>
2025-10-17 12:37:07 +02:00
Micke Nordin 4128eff628 fix(ocm): ensure capabilities are set on OCMProvider from discovery data
- Call `setCapabilities()` with `capabilities` field when available.
- Prevents loss of provider capability information during discovery.

Signed-off-by: Micke Nordin <kano@sunet.se>
2025-10-17 12:37:06 +02:00
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 $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 $name The display name of the recipient
*
@@ -251,8 +251,8 @@ class RequestHandlerController extends Controller {
#[PublicPage]
#[NoCSRFRequired]
#[BruteForceProtection(action: 'inviteAccepted')]
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);
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);
$updated = $this->timeFactory->getTime();
@@ -309,7 +309,7 @@ class RequestHandlerController extends Controller {
$invitation->setRecipientEmail($email);
$invitation->setRecipientName($name);
$invitation->setRecipientProvider($recipientProvider);
$invitation->setRecipientUserId($userId);
$invitation->setRecipientUserId($userID);
$invitation->setAcceptedAt($updated);
$invitation = $this->federatedInviteMapper->update($invitation);
+3 -3
View File
@@ -354,7 +354,7 @@
"required": [
"recipientProvider",
"token",
"userId",
"userID",
"email",
"name"
],
@@ -367,9 +367,9 @@
"type": "string",
"description": "The token used for the invitation"
},
"userId": {
"userID": {
"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": {
"type": "string",
+2
View File
@@ -227,6 +227,7 @@ class OCMProvider implements ICapabilityAwareOCMProvider {
}
$this->setResourceTypes($resources);
$this->setInviteAcceptDialog($data['inviteAcceptDialog'] ?? '');
$this->setCapabilities($data['capabilities'] ?? []);
if (isset($data['publicKey'])) {
// 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
'endPoint' => $this->getEndPoint(),
'publicKey' => $this->getSignatory()?->jsonSerialize(),
'provider' => $this->getProvider(),
'resourceTypes' => $resourceTypes
];
+3 -3
View File
@@ -15985,7 +15985,7 @@
"required": [
"recipientProvider",
"token",
"userId",
"userID",
"email",
"name"
],
@@ -15998,9 +15998,9 @@
"type": "string",
"description": "The token used for the invitation"
},
"userId": {
"userID": {
"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": {
"type": "string",