Skip to content

Commit

Permalink
Merge pull request #14062 from nextcloud/bugfix/noid/federation-signing
Browse files Browse the repository at this point in the history
fix(federation): Fix compatibility with Nextcloud 30 when using https
  • Loading branch information
nickvergessen authored Jan 9, 2025
2 parents 3398422 + 683cb88 commit 74fdd1b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions lib/Federation/CloudFederationProviderTalk.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,15 +642,20 @@ public function getFederationIdFromSharedSecret(
string $sharedSecret,
array $payload,
): string {
$remoteServerUrl = $payload['remoteServerUrl'];
if (str_starts_with($remoteServerUrl, 'https://')) {
$remoteServerUrl = substr($remoteServerUrl, strlen('https://'));
}

try {
$invite = $this->invitationMapper->getByRemoteServerAndAccessToken($payload['remoteServerUrl'], $sharedSecret);
$invite = $this->invitationMapper->getByRemoteServerAndAccessToken($remoteServerUrl, $sharedSecret);
return $invite->getInviterCloudId();
} catch (DoesNotExistException) {
}

$attendees = $this->attendeeMapper->getByAccessToken($sharedSecret);
foreach ($attendees as $attendee) {
if (str_ends_with($attendee->getActorId(), $payload['remoteServerUrl'])) {
if (str_ends_with($attendee->getActorId(), '@' . $remoteServerUrl)) {
return $attendee->getActorId();
}
}
Expand Down

0 comments on commit 74fdd1b

Please sign in to comment.