Skip to content

Commit a4fd41e

Browse files
authored
Merge branch 'master' into fix/s3-primary-storage-encryption
2 parents 489d328 + 8d168bd commit a4fd41e

File tree

2,937 files changed

+62742
-45995
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,937 files changed

+62742
-45995
lines changed

.github/workflows/files-external-smb-kerberos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
echo "$FILEPATH:"
108108
docker exec --user 33 apache cat $FILEPATH
109109
110-
sftp-summary:
110+
smb-kerberos-sso-summary:
111111
runs-on: ubuntu-latest-low
112112
needs: [changes, files-external-smb-kerberos]
113113

.github/workflows/files-external-smb.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,13 @@ jobs:
5353

5454
services:
5555
samba:
56-
image: ghcr.io/nextcloud/continuous-integration-samba:latest # zizmor: ignore[unpinned-images]
56+
image: ghcr.io/servercontainers/samba:smbd-only-a3.18.0-s4.18.2-r0
57+
env:
58+
ACCOUNT_test: test
59+
UID_test: 1000
60+
SAMBA_VOLUME_CONFIG_test: "[public]; path=/tmp; valid users = test; guest ok = no; read only = no; browseable = yes"
61+
options: >-
62+
--health-cmd=true
5763
ports:
5864
- 445:445
5965

.github/workflows/static-code-analysis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ on:
1515

1616
permissions:
1717
contents: read
18+
security-events: write
1819

1920
concurrency:
2021
group: static-code-analysis-${{ github.head_ref || github.run_id }}

.nextcloudignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
2+
# SPDX-License-Identifier: AGPL-3.0-only
3+
# Files removed at build time
4+
5+
# Global exclude
6+
.editorconfig
7+
.git
8+
.git-blame-ignore-revs
9+
.gitattributes
10+
.github
11+
.gitignore
12+
.gitmodules
13+
.idea
14+
.l10nignore
15+
.nextcloudignore
16+
.noopenapi
17+
.tx
18+
cypress
19+
tests
20+
21+
# Server specific
22+
/.devcontainer
23+
/__mocks__
24+
/__tests__
25+
/autotest*.sh
26+
/build
27+
/config/config.php
28+
/contribute
29+
/data

3rdparty

Submodule 3rdparty updated 220 files

apps/admin_audit/lib/Actions/TagManagement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function createTag(ISystemTag $tag): void {
1818
$this->log('System tag "%s" (%s, %s) created',
1919
[
2020
'name' => $tag->getName(),
21-
'visbility' => $tag->isUserVisible() ? 'visible' : 'invisible',
21+
'visibility' => $tag->isUserVisible() ? 'visible' : 'invisible',
2222
'assignable' => $tag->isUserAssignable() ? 'user assignable' : 'system only',
2323
],
2424
['name', 'visibility', 'assignable']

apps/cloud_federation_api/appinfo/routes.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,15 @@
2525
'url' => '/invite-accepted',
2626
'verb' => 'POST',
2727
'root' => '/ocm',
28-
]
28+
],
29+
30+
// needs to be kept at the bottom of the list
31+
[
32+
'name' => 'OCMRequest#manageOCMRequests',
33+
'url' => '/{ocmPath}',
34+
'requirements' => ['ocmPath' => '.*'],
35+
'verb' => ['GET', 'POST', 'PUT', 'DELETE'],
36+
'root' => '/ocm',
37+
],
2938
],
3039
];

apps/cloud_federation_api/composer/composer/autoload_classmap.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
'OCA\\CloudFederationAPI\\AppInfo\\Application' => $baseDir . '/../lib/AppInfo/Application.php',
1111
'OCA\\CloudFederationAPI\\Capabilities' => $baseDir . '/../lib/Capabilities.php',
1212
'OCA\\CloudFederationAPI\\Config' => $baseDir . '/../lib/Config.php',
13+
'OCA\\CloudFederationAPI\\Controller\\OCMRequestController' => $baseDir . '/../lib/Controller/OCMRequestController.php',
1314
'OCA\\CloudFederationAPI\\Controller\\RequestHandlerController' => $baseDir . '/../lib/Controller/RequestHandlerController.php',
1415
'OCA\\CloudFederationAPI\\Db\\FederatedInvite' => $baseDir . '/../lib/Db/FederatedInvite.php',
1516
'OCA\\CloudFederationAPI\\Db\\FederatedInviteMapper' => $baseDir . '/../lib/Db/FederatedInviteMapper.php',

apps/cloud_federation_api/composer/composer/autoload_static.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class ComposerStaticInitCloudFederationAPI
2525
'OCA\\CloudFederationAPI\\AppInfo\\Application' => __DIR__ . '/..' . '/../lib/AppInfo/Application.php',
2626
'OCA\\CloudFederationAPI\\Capabilities' => __DIR__ . '/..' . '/../lib/Capabilities.php',
2727
'OCA\\CloudFederationAPI\\Config' => __DIR__ . '/..' . '/../lib/Config.php',
28+
'OCA\\CloudFederationAPI\\Controller\\OCMRequestController' => __DIR__ . '/..' . '/../lib/Controller/OCMRequestController.php',
2829
'OCA\\CloudFederationAPI\\Controller\\RequestHandlerController' => __DIR__ . '/..' . '/../lib/Controller/RequestHandlerController.php',
2930
'OCA\\CloudFederationAPI\\Db\\FederatedInvite' => __DIR__ . '/..' . '/../lib/Db/FederatedInvite.php',
3031
'OCA\\CloudFederationAPI\\Db\\FederatedInviteMapper' => __DIR__ . '/..' . '/../lib/Db/FederatedInviteMapper.php',
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
/**
6+
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
7+
* SPDX-License-Identifier: AGPL-3.0-or-later
8+
*/
9+
10+
namespace OCA\CloudFederationAPI\Controller;
11+
12+
use JsonException;
13+
use OCP\AppFramework\Controller;
14+
use OCP\AppFramework\Http;
15+
use OCP\AppFramework\Http\Attribute\BruteForceProtection;
16+
use OCP\AppFramework\Http\Attribute\NoCSRFRequired;
17+
use OCP\AppFramework\Http\Attribute\PublicPage;
18+
use OCP\AppFramework\Http\JSONResponse;
19+
use OCP\AppFramework\Http\Response;
20+
use OCP\EventDispatcher\IEventDispatcher;
21+
use OCP\IRequest;
22+
use OCP\OCM\Events\OCMEndpointRequestEvent;
23+
use OCP\OCM\Exceptions\OCMArgumentException;
24+
use OCP\OCM\IOCMDiscoveryService;
25+
use OCP\Security\Signature\Exceptions\IncomingRequestException;
26+
use Psr\Log\LoggerInterface;
27+
28+
class OCMRequestController extends Controller {
29+
public function __construct(
30+
string $appName,
31+
IRequest $request,
32+
private readonly IEventDispatcher $eventDispatcher,
33+
private readonly IOCMDiscoveryService $ocmDiscoveryService,
34+
private readonly LoggerInterface $logger,
35+
) {
36+
parent::__construct($appName, $request);
37+
}
38+
39+
/**
40+
* Method will catch any request done to /ocm/[...] and will broadcast an event.
41+
* The first parameter of the remaining subpath (post-/ocm/) is defined as
42+
* capability and should be used by listeners to filter incoming requests.
43+
*
44+
* @see OCMEndpointRequestEvent
45+
* @see OCMEndpointRequestEvent::getArgs
46+
*
47+
* @param string $ocmPath
48+
* @return Response
49+
* @throws OCMArgumentException
50+
*/
51+
#[NoCSRFRequired]
52+
#[PublicPage]
53+
#[BruteForceProtection(action: 'receiveOcmRequest')]
54+
public function manageOCMRequests(string $ocmPath): Response {
55+
if (!mb_check_encoding($ocmPath, 'UTF-8')) {
56+
throw new OCMArgumentException('path is not UTF-8');
57+
}
58+
59+
try {
60+
// if request is signed and well signed, no exceptions are thrown
61+
// if request is not signed and host is known for not supporting signed request, no exceptions are thrown
62+
$signedRequest = $this->ocmDiscoveryService->getIncomingSignedRequest();
63+
} catch (IncomingRequestException $e) {
64+
$this->logger->warning('incoming ocm request exception', ['exception' => $e]);
65+
return new JSONResponse(['message' => $e->getMessage(), 'validationErrors' => []], Http::STATUS_BAD_REQUEST);
66+
}
67+
68+
// assuming that ocm request contains a json array
69+
$payload = $signedRequest?->getBody() ?? file_get_contents('php://input');
70+
try {
71+
$payload = ($payload) ? json_decode($payload, true, 512, JSON_THROW_ON_ERROR) : null;
72+
} catch (JsonException $e) {
73+
$this->logger->debug('json decode error', ['exception' => $e]);
74+
$payload = null;
75+
}
76+
77+
$event = new OCMEndpointRequestEvent(
78+
$this->request->getMethod(),
79+
preg_replace('@/+@', '/', $ocmPath),
80+
$payload,
81+
$signedRequest?->getOrigin()
82+
);
83+
$this->eventDispatcher->dispatchTyped($event);
84+
85+
return $event->getResponse() ?? new Response(Http::STATUS_NOT_FOUND);
86+
}
87+
}

0 commit comments

Comments
 (0)