aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJoas Schilling <213943+nickvergessen@users.noreply.github.com>2024-12-09 21:15:20 +0100
committerGitHub <noreply@github.com>2024-12-09 21:15:20 +0100
commit168f38338a9fd7596d53b95a40caecc97ca99218 (patch)
tree76253e4d76b764fcff3a184e761a9c0eba8548f6 /lib
parent0c4794b56b060b516a2661a6f614fcc2649dcec7 (diff)
parent75c16a722b58d2abc772f6e6b18292020fc183e6 (diff)
downloadnextcloud-server-168f38338a9fd7596d53b95a40caecc97ca99218.tar.gz
nextcloud-server-168f38338a9fd7596d53b95a40caecc97ca99218.zip
Merge pull request #49740 from nextcloud/bugfix/noid/compatibility-with-30
fix(federation): Restore compatibility with Nextcloud 30 servers
Diffstat (limited to 'lib')
-rw-r--r--lib/private/OCM/Model/OCMProvider.php17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/private/OCM/Model/OCMProvider.php b/lib/private/OCM/Model/OCMProvider.php
index 61005d3089d..99a3770faef 100644
--- a/lib/private/OCM/Model/OCMProvider.php
+++ b/lib/private/OCM/Model/OCMProvider.php
@@ -172,7 +172,8 @@ class OCMProvider implements IOCMProvider {
*/
public function import(array $data): static {
$this->setEnabled(is_bool($data['enabled'] ?? '') ? $data['enabled'] : false)
- ->setApiVersion((string)($data['version'] ?? ''))
+ // Fall back to old apiVersion for Nextcloud 30 compatibility
+ ->setApiVersion((string)($data['version'] ?? $data['apiVersion'] ?? ''))
->setEndPoint($data['endPoint'] ?? '');
$resources = [];
@@ -182,12 +183,14 @@ class OCMProvider implements IOCMProvider {
}
$this->setResourceTypes($resources);
- // import details about the remote request signing public key, if available
- $signatory = new Signatory();
- $signatory->setKeyId($data['publicKey']['keyId'] ?? '');
- $signatory->setPublicKey($data['publicKey']['publicKeyPem'] ?? '');
- if ($signatory->getKeyId() !== '' && $signatory->getPublicKey() !== '') {
- $this->setSignatory($signatory);
+ if (isset($data['publicKey'])) {
+ // import details about the remote request signing public key, if available
+ $signatory = new Signatory();
+ $signatory->setKeyId($data['publicKey']['keyId'] ?? '');
+ $signatory->setPublicKey($data['publicKey']['publicKeyPem'] ?? '');
+ if ($signatory->getKeyId() !== '' && $signatory->getPublicKey() !== '') {
+ $this->setSignatory($signatory);
+ }
}
if (!$this->looksValid()) {