Skip to content

Commit 519ceee

Browse files
Merge pull request #51622 from nextcloud/fix/ocm-public-key-is-optional
fix(ocm): `publicKey` can be disabled so capabilities do not match
2 parents 9ffcdd8 + b9f9190 commit 519ceee

File tree

4 files changed

+4
-5
lines changed

4 files changed

+4
-5
lines changed

apps/cloud_federation_api/lib/Capabilities.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function __construct(
3838
* apiVersion: '1.0-proposal1',
3939
* enabled: bool,
4040
* endPoint: string,
41-
* publicKey: array{
41+
* publicKey?: array{
4242
* keyId: string,
4343
* publicKeyPem: string,
4444
* },

apps/cloud_federation_api/openapi.json

-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,6 @@
4646
"apiVersion",
4747
"enabled",
4848
"endPoint",
49-
"publicKey",
5049
"resourceTypes",
5150
"version"
5251
],

lib/private/OCM/Model/OCMProvider.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ private function looksValid(): bool {
213213
* enabled: bool,
214214
* apiVersion: '1.0-proposal1',
215215
* endPoint: string,
216-
* publicKey: array{
216+
* publicKey?: array{
217217
* keyId: string,
218218
* publicKeyPem: string
219219
* },
@@ -236,7 +236,7 @@ public function jsonSerialize(): array {
236236
'apiVersion' => '1.0-proposal1', // deprecated, but keep it to stay compatible with old version
237237
'version' => $this->getApiVersion(), // informative but real version
238238
'endPoint' => $this->getEndPoint(),
239-
'publicKey' => $this->getSignatory()->jsonSerialize(),
239+
'publicKey' => $this->getSignatory()?->jsonSerialize(),
240240
'resourceTypes' => $resourceTypes
241241
];
242242
}

lib/public/OCM/IOCMProvider.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ public function import(array $data): static;
151151
* enabled: bool,
152152
* apiVersion: '1.0-proposal1',
153153
* endPoint: string,
154-
* publicKey: array{
154+
* publicKey?: array{
155155
* keyId: string,
156156
* publicKeyPem: string
157157
* },

0 commit comments

Comments
 (0)