nextcloud/lib/private
Micke Nordin 41e9022100 fix(ocm): merge resource types by name in discovery
Current code blindy adds any resources to the ocm disocvery, this makes
it so that different cloud federation providers can not add different
protocols for the same resourceType without the resourceType being
duplicated, something that OCM does not allow:

```
REQUIRED: resourceTypes (array) - A list of all resource types this
server supports in both the Sending Server role and the Receiving
Server role, with their access protocols. Each item in this list MUST
itself be an object containing the following fields:

name (string) - A supported resource type (file, calendar, contact, ...).
Implementations MUST offer support for at least one resource type, where
file is the commonly supported one. Each resource type is identified by
its name: the list MUST NOT contain more than one resource type object
per given name.

...
```

https://datatracker.ietf.org/doc/html/draft-ietf-ocm-open-cloud-mesh-04#name-fields

This patch changes this behaviour from this example result:
```
   {
      "name": "folder",
      "shareTypes": [
        "user"
      ],
      "protocols": {
        "webapp": {}
      }
    },
    {
      "name": "folder",
      "shareTypes": [
        "user"
      ],
      "protocols": {
        "webapp-receive": {
          "targets": [
            "blank",
            "iframe"
          ]
        }
      }
```

to:

```
{
      "name": "folder",
      "shareTypes": [
        "user"
      ],
      "protocols": {
        "webapp": {},
        "webapp-receive": {
          "targets": [
            "blank",
            "iframe"
          ]
        }
      }
```

which is the correct behaviour according to OCM.

Signed-off-by: Micke Nordin <kano@sunet.se>
2026-06-16 11:30:24 +02:00
..
Accounts chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Activity refactor(server): Register alias when needed 2026-06-10 23:22:24 +02:00
App refactor(server): Register alias when needed 2026-06-10 23:22:24 +02:00
AppFramework fix: Use token expiration for ephemeral sessions 2026-06-15 15:28:38 +02:00
Archive chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Authentication fix: Use token expiration for ephemeral sessions 2026-06-15 15:28:38 +02:00
Avatar chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
BackgroundJob feat(jobs): clean old job runs 2026-06-12 13:53:10 +02:00
Blurhash/Listener chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
Broadcast/Events chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Cache chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Calendar chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Collaboration fix(MailPlugin): Stop applying the offset twice and the limit per wide/exact 2026-06-01 14:24:01 +02:00
Command chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Comments Merge pull request #60960 from nextcloud/carl/querybuilder-magic-number 2026-06-10 23:09:30 +02:00
Config chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Console chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Contacts/ContactsMenu chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
ContextChat chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
Dashboard chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
DB refactor: Use new IQueryBuilder::MAX_IN_PARAMETERS 2026-06-03 13:45:29 +02:00
Diagnostics refactor(server): Register alias when needed 2026-06-10 23:22:24 +02:00
DirectEditing chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Encryption chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
EventDispatcher chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Federation chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Files Merge pull request #53464 from nextcloud/correctParentStorageMtime-id 2026-06-11 17:17:52 +02:00
FilesMetadata refactor: Use new IQueryBuilder::MAX_IN_PARAMETERS 2026-06-03 13:45:29 +02:00
FullTextSearch chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
GlobalScale chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Group chore: Fix psalm issues following strong typing of IUser 2026-06-11 09:45:32 +02:00
Hooks chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Http feat(guzzle): allow overriding the default curl handler when creating a new client 2026-06-03 14:13:37 +02:00
IntegrityCheck chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
KnownUser chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
L10N chore(L10N): add strict types in L10N::localeExists 2026-06-11 09:45:28 +02:00
LDAP chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
legacy Merge pull request #61140 from nextcloud/fix/fix-deprecations-in-tests 2026-06-11 14:48:10 +02:00
Lock chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Lockdown chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Log chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Mail chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Memcache chore: Get cache lazily in OC\Memcache\Redis 2026-06-02 09:46:20 +02:00
Migration chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Net fix: handle NAT64 addresses in isLocalAddress 2026-05-19 17:06:46 +02:00
Notification chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
OCM fix(ocm): merge resource types by name in discovery 2026-06-16 11:30:24 +02:00
OCS chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
OpenMetrics chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
Preview fix(previews): movie preview bug fix, in some case stream reading functions may block indefinitly 2026-06-11 17:14:54 +02:00
Profile chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
Profiler chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Repair feat(utils): add getter for serverid with proper default 2026-06-12 13:53:10 +02:00
RichObjectStrings chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Route fix: Change back base.php to have the same behavior as before 2026-06-05 10:23:50 +02:00
Search chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Security Merge pull request #60735 from nextcloud/fix/noid/crypto-decrypt-fallback-valueerror 2026-06-09 15:14:44 +02:00
Session chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Settings chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Setup chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
SetupCheck style(PHP): Fix 2026-06-11 20:01:52 +02:00
Share chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Share20 fix: Fix PHP Warning foreach() argument must be of type array|object, null given 2026-06-12 14:28:42 +02:00
Snowflake feat(snowflake): allows to generate Snowflake IDs matching a timestamp 2026-06-12 13:53:10 +02:00
SpeechToText chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Support chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
SystemTag chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Tagging chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Talk chore: Remove almost all uses of deprecated IServerContainer in lib/private 2026-05-11 16:22:22 +02:00
TaskProcessing fix(TaskProcessing): Check $progress value is in (0,1) in setTaskProgress 2026-06-15 10:02:34 +02:00
Teams chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
Template chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
TextProcessing chore: Silence psalm false-positives 2026-06-02 09:46:19 +02:00
TextToImage chore: Remove types from const properties 2026-06-02 09:46:16 +02:00
Translation chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Updater chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
User fix: Use token expiration for ephemeral sessions 2026-06-15 15:28:38 +02:00
UserStatus chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
AllConfig.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
AppConfig.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
AppScriptDependency.php chore: apply new CSFixer rules 2025-07-01 16:26:50 +02:00
AppScriptSort.php refactor: Run rector on lib/private 2026-02-06 13:50:18 +01:00
BinaryFinder.php chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
CapabilitiesManager.php refactor(CapabilitiesManager): log slow capabilities in a single message 2026-06-15 18:42:47 +02:00
Color.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Config.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
ContactsManager.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
DatabaseException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
DatabaseSetupException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
DateTimeFormatter.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
DateTimeZone.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
EmojiHelper.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
EventSource.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
EventSourceFactory.php chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
ForbiddenException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
HintException.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
Image.php fix: resolve PHP deprecation of imagedestroy 2026-06-11 00:59:15 +02:00
InitialStateService.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Installer.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
LargeFileHelper.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Log.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
MemoryInfo.php chore(deps): Update nextcloud/coding-standard to v1.3.1 2024-09-19 14:21:20 +02:00
NaturalSort.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
NaturalSort_DefaultCollator.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
NavigationManager.php fix(NavigationManager): resolve entries only when needed 2026-06-07 16:54:21 +02:00
NeedsUpdateException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
NotSquareException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
PhoneNumberUtil.php chore: add missing Override attribute to OC 2026-04-28 21:29:27 +02:00
PreviewManager.php Merge pull request #59905 from nextcloud/jtr/chore-drop-registerProvider-IPreview 2026-06-09 11:51:53 +02:00
PreviewNotAvailableException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
RedisFactory.php fix: Remove static var in Memcache/Redis 2026-06-02 09:46:03 +02:00
Repair.php feat(jobs): add cleanup job for job run history 2026-06-12 13:53:10 +02:00
RepairException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Server.php feat(utils): add getter for serverid with proper default 2026-06-12 13:53:10 +02:00
ServerContainer.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
ServerInfo.php feat(utils): add getter for serverid with proper default 2026-06-12 13:53:10 +02:00
ServerNotAvailableException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
ServiceUnavailableException.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
Setup.php feat(jobs): add cleanup job for job run history 2026-06-12 13:53:10 +02:00
Streamer.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
StreamImage.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
SubAdmin.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
SystemConfig.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
TagManager.php refactor: Use new IQueryBuilder::MAX_IN_PARAMETERS 2026-06-03 13:45:29 +02:00
Tags.php fix: Turn static var into standard one in Tags class 2026-06-02 09:46:18 +02:00
TemplateLayout.php fix(psalm): Use end instead of array_last because psalm does not find the polyfill 2026-06-09 14:59:52 +02:00
TempManager.php fix: Silence PHP warnings from fopen and mkdir 2026-06-11 09:45:30 +02:00
Updater.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00
URLGenerator.php chore: Apply new coding standard to all files 2026-06-01 13:46:39 +02:00