mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 10:10:49 -04:00
Merge pull request #49740 from nextcloud/bugfix/noid/compatibility-with-30
fix(federation): Restore compatibility with Nextcloud 30 servers
This commit is contained in:
commit
168f38338a
1 changed files with 10 additions and 7 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue