Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
36 changes: 25 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,27 +1,41 @@
; Nextcloud core ships one of these; without it an editor falls back to
; whatever the developer last configured, and the repo's own indentation
; becomes a property of who opened it rather than of the project.
;
; Values follow what this repo already contains: tabs in PHP/JS/Vue, and the
; two-space YAML/JSON that every tool here emits.
# https://editorconfig.org

# SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: AGPL-3.0-or-later

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab
indent_size = 4

[*.{yml,yaml,json,jsonc}]
indent_style = space
indent_size = 2
indent_style = space

# Trailing whitespace is a hard line break in Markdown, so trimming it changes
# rendered output rather than tidying it.
[*.md]
; Trailing whitespace is a hard line break in Markdown, so trimming it changes
; rendered output rather than tidying it.
trim_trailing_whitespace = false

[*.svg]
insert_final_newline = false

[package*.json]
indent_size = 2
indent_style = space

[build/psalm-baseline.xml]
indent_size = 2
indent_style = space

[config/*config.php]
indent_size = 2
indent_style = space

[Makefile]
indent_style = tab
33 changes: 15 additions & 18 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
# Retrofit annotation commit (opsx-annotate, 2026-05-24)
78b6624686d0c027295843e24b5c8e1a2ed3458b
884adc749c8b76de06dd5d520f099164d979f917
# Revisions to skip in `git blame`.
#
# Enable locally, once:
# git config blame.ignoreRevsFile .git-blame-ignore-revs
#
# GitHub reads this file automatically. Your terminal does not, until you run
# the line above.
#
# Only ever add commits that change formatting and NOTHING else. A commit listed
# here becomes invisible to blame, so a behaviour change hidden inside one would
# be very hard to find later.

# Retrofit annotation commit (reverse-spec rule-pipeline, 2026-05-25)
d27c6ef22f885f835143f95296ef94a424ab1aba

# Retrofit reverse-spec configuration-export-import annotations (opsx-reverse-spec, 2026-05-25)
d448e03e646bdac6b1f4c144773585ed51c9634c

# Retrofit annotation commit (reverse-spec user-management-and-login, 2026-05-25)
263e579134d9d5c2c9f1b1c7a4b3392a3a59ea7b

# Retrofit annotation commit (reverse-spec endpoint-runtime, 2026-05-25)
8564b07120d45a195ba4ad9aa602ab0d700a9ac2

# Retrofit reverse-spec annotation commits (synchronization-engine, 2026-05-25)
a2ae936a2e58ac16c5a4076a0b3ab32954b55aee
9f90f9873c423883455fd6918aefef1e380fdc57
# style: reformat with nextcloud/coding-standard — whitespace only
# The fleet-wide move from a PEAR-derived PHPCS ruleset (4 spaces, next-line
# braces) to Nextcloud's own standard (tabs, same-line braces).
0a5295caac97e5067be75f4ac2d39a244775af2f
19 changes: 18 additions & 1 deletion .github/workflows/code-quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,24 @@ jobs:
# dependency and fails ~70s later on missing tables — which reads like a
# migration fault rather than a missing app. Testing a version the app
# cannot support produces red that says nothing. See issue #1172.
nextcloud-test-refs: '["stable32", "stable33"]'
#
# WHY THIS IS NOW stable34 AND NOT `["stable32", "stable33"]`. This PR
# moves the dev requirement to `nextcloud/ocp ^34`, so the stubs every
# static-analysis leg resolves against are NC34's. Running the suite
# against an older server would check the app under one set of API
# signatures and analyse it under another, and the two disagreeing is
# exactly the class of defect the analysers exist to find.
#
# ✅ THE NARROWING IS CLOSED, THE FIRST WAY. The previous revision of this
# comment recorded a deliberate trade: info.xml declared three server
# versions while the suite exercised one, leaving NC32 and NC33 unmeasured
# rather than known-broken. It named its own closure condition — "restoring
# the older refs alongside stable34 once ocp ^34 stubs are proven compatible
# with them" — and that condition is now met: portaliq runs stable32,
# stable33 and stable34 against `nextcloud/ocp ^34` and all six PHPUnit
# legs pass (run 31599055849). So the refs come back rather than info.xml's
# floor going up, and the two numbers agree again.
nextcloud-test-refs: '["stable34", "stable32", "stable33"]'
# `hydra-gates-require-full-coverage: false` is REMOVED here, exactly as
# the comment it replaced instructed: "Remove this line in the change
# that wires those producers up, so the coverage requirement arrives with
Expand Down
20 changes: 20 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

// SPDX-FileCopyrightText: 2026 Conduction
// SPDX-License-Identifier: EUPL-1.2

// The require_once is NOT optional. php-cs-fixer includes this file before the
// app's autoloader runs, so without it the run dies with "Class not found" —
// and in --format=json that fatal is reported as ZERO FILES NEEDING CHANGES,
// which reads exactly like a clean tree.
require_once __DIR__ . '/vendor/autoload.php';

$config = new Conduction\CodingStandard\Config();
$config->getFinder()
->notPath('vendor')
->notPath('node_modules')
->notPath('build')
->in(__DIR__ . '/lib')
->in(__DIR__ . '/tests');

return $config;
142 changes: 79 additions & 63 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,35 @@
]]></description>
<version>0.3.4</version>
<licence>EUPL-1.2</licence>
<category>integration</category>
<author mail="info@conduction.nl" homepage="https://www.conduction.nl/">Conduction</author>
<namespace>OpenConnector</namespace>
<category>integration</category>
<website>https://codeberg.org/Conduction/openconnector</website>
<bugs>https://codeberg.org/Conduction/openconnector/issues</bugs>
<repository>https://codeberg.org/Conduction/openconnector</repository>
<screenshot>https://codeberg.org/Conduction/openconnector/raw/branch/main/img/screenshot-dashboard.png</screenshot>
<screenshot>https://codeberg.org/Conduction/openconnector/raw/branch/main/img/screenshot-sources.png</screenshot>
<screenshot>https://codeberg.org/Conduction/openconnector/raw/branch/main/img/screenshot-mappings.png</screenshot>
<dependencies>
<app>openregister</app>
<!--
min-version is 32, NOT 28, because <app>openregister</app> above is a HARD
dependency and openregister declares min-version="32". On NC 28-31 openregister
App dependency: openregister. Recorded as prose, not as an element. The
App Store schema (info.xsd) has no app child under dependencies, so
shipping one fails App Store validation; Nextcloud's DependencyAnalyzer
does not read it either (it handles only php, database, command, lib,
os, architecture and the server version), so the element never enforced
anything at install time.
-->
<php min-version="8.3" min-int-size="64"/>
<database min-version="10">pgsql</database>
<database>sqlite</database>
<database min-version="8.0">mysql</database>

<lib>curl</lib>

<owncloud max-version="0" min-version="0"/>
<!--
min-version is 32, NOT 28, because the openregister app dependency noted
above is a HARD dependency and openregister declares min-version="32". On NC 28-31 openregister
refuses to install ("cannot be installed because it is not compatible with this
version of the server"), and every openconnector entity is an OpenRegister
object — so the app cannot function there. Declaring 28 advertised a range
Expand All @@ -51,14 +66,6 @@
repo claiming 35, so the claim was untested everywhere it mattered.
-->
<nextcloud min-version="32" max-version="34"/>
<php min-version="8.3" min-int-size="64"/>
<database min-version="10">pgsql</database>
<database>sqlite</database>
<database min-version="8.0">mysql</database>

<lib>curl</lib>

<owncloud max-version="0" min-version="0"/>
</dependencies>

<background-jobs>
Expand All @@ -80,33 +87,39 @@
<job>OCA\OpenConnector\Cron\StufZknRetryJob</job>
</background-jobs>

<commands>
<!-- Chain B storage migration: operator entrypoint for the legacy → OpenRegister
row migration (dry-run, per-entity retry, verify). -->
<command>OCA\OpenConnector\Command\MigrateToOpenRegister</command>
<!-- ocon#151 phase C / ADR-064: reports which sources still hold an inline
secret and what each would become in the credential broker. The dry-run
mode writes nothing and emits the "clean" gate phase D must check before
it may remove the schema properties. A real run migrates inline secrets.
(XML comments must not contain a double hyphen, so the dry-run flag is
not written with its leading dashes here.) -->
<command>OCA\OpenConnector\Command\MigrateInlineSecrets</command>
<!-- ocon#232 (ocon#151 follow-up): audits the VESTIGIAL source
authenticationConfig field. No code authenticates from it, so removal
(not a credentialRef migration) is the correct treatment. The default
action is a READ ONLY audit reporting key NAMES only, never values.
Removal DELETES credential data and therefore happens only when a human
passes the explicit opt in flag; it is registered here as a command and
never as a repair step, so an upgrade or maintenance:repair can never
reach the deleting path.
(XML comments must not contain a double hyphen, so the flags are not
written with their leading dashes here.) -->
<command>OCA\OpenConnector\Command\AuthenticationConfig</command>
</commands>

<!-- ⚠️ CHILD ORDER IS FIXED BY THE APP STORE SCHEMA, and it is NOT the order
these hooks run in. info.xsd declares repair-steps as an xs:sequence of
pre-migration, post-migration, live-migration, install, uninstall — so
`<install>` goes LAST of the two used here even though it is the hook a
fresh instance reaches FIRST. Written the intuitive way round, xmllint
rejects the manifest with
Element 'post-migration': This element is not expected.
Expected is ( uninstall ).
and the App Store refuses the release AFTER it has been tagged. -->
<repair-steps>
<post-migration>
<step>OCA\OpenConnector\Repair\InitializeRegister</step>
<step>OCA\OpenConnector\Repair\InitializeActions</step>
<step>OCA\OpenConnector\Repair\MigrateLegacyStorage</step>
<step>OCA\OpenConnector\Repair\FlagSourceSecretsWriteOnly</step>
<!-- ocon#151 phase C / ADR-064: RUNS the inline-secret migration (mint,
verify, write credentialRef, null the inline value) now that
organisation-scope resolution is unblocked (openregister#450/#440),
then records whether any source still holds an inline secret into
appconfig (the Phase D gate). Fail-closed and non-fatal; see the
repair step's docblock. -->
<step>OCA\OpenConnector\Repair\RecordInlineSecretMigrationStatus</step>
<!-- ocon#151 phase D: IRREVERSIBLE. Removes the four auto-migratable
secret fields (apikey, secret, password, jwt) from the LIVE source
schema ONLY once every source is verifiably clean of inline values in
them. Runs AFTER the migration above so the gate can be clean.
authenticationConfig is excluded (manual review). The register JSON
keeps all five fields on purpose (see the step's docblock). -->
<step>OCA\OpenConnector\Repair\RemoveMigratedSourceSecretFields</step>
<step>OCA\OpenConnector\Repair\MaterializeCatalogItems</step>
</post-migration>
<!-- ocon#1180. A FIRST install runs neither `postSchemaChange` nor the
`post-migration` steps below: `Installer::installAppLastSteps()` passes
`post-migration` steps above: `Installer::installAppLastSteps()` passes
`$schemaOnly = true` when there is no previous version, which routes
`MigrationService::migrate()` to `migrateSchemaOnly()` (changeSchema
only, then every version marked executed), and it guards the
Expand All @@ -129,29 +142,37 @@
fields is a product decision, tracked separately, not one this
fix should take by side effect. -->
</install>
<post-migration>
<step>OCA\OpenConnector\Repair\InitializeRegister</step>
<step>OCA\OpenConnector\Repair\InitializeActions</step>
<step>OCA\OpenConnector\Repair\MigrateLegacyStorage</step>
<step>OCA\OpenConnector\Repair\FlagSourceSecretsWriteOnly</step>
<!-- ocon#151 phase C / ADR-064: RUNS the inline-secret migration (mint,
verify, write credentialRef, null the inline value) now that
organisation-scope resolution is unblocked (openregister#450/#440),
then records whether any source still holds an inline secret into
appconfig (the Phase D gate). Fail-closed and non-fatal; see the
repair step's docblock. -->
<step>OCA\OpenConnector\Repair\RecordInlineSecretMigrationStatus</step>
<!-- ocon#151 phase D: IRREVERSIBLE. Removes the four auto-migratable
secret fields (apikey, secret, password, jwt) from the LIVE source
schema ONLY once every source is verifiably clean of inline values in
them. Runs AFTER the migration above so the gate can be clean.
authenticationConfig is excluded (manual review). The register JSON
keeps all five fields on purpose (see the step's docblock). -->
<step>OCA\OpenConnector\Repair\RemoveMigratedSourceSecretFields</step>
<step>OCA\OpenConnector\Repair\MaterializeCatalogItems</step>
</post-migration>
</repair-steps>

<commands>
<!-- Chain B storage migration: operator entrypoint for the legacy → OpenRegister
row migration (dry-run, per-entity retry, verify). -->
<command>OCA\OpenConnector\Command\MigrateToOpenRegister</command>
<!-- ocon#151 phase C / ADR-064: reports which sources still hold an inline
secret and what each would become in the credential broker. The dry-run
mode writes nothing and emits the "clean" gate phase D must check before
it may remove the schema properties. A real run migrates inline secrets.
(XML comments must not contain a double hyphen, so the dry-run flag is
not written with its leading dashes here.) -->
<command>OCA\OpenConnector\Command\MigrateInlineSecrets</command>
<!-- ocon#232 (ocon#151 follow-up): audits the VESTIGIAL source
authenticationConfig field. No code authenticates from it, so removal
(not a credentialRef migration) is the correct treatment. The default
action is a READ ONLY audit reporting key NAMES only, never values.
Removal DELETES credential data and therefore happens only when a human
passes the explicit opt in flag; it is registered here as a command and
never as a repair step, so an upgrade or maintenance:repair can never
reach the deleting path.
(XML comments must not contain a double hyphen, so the flags are not
written with their leading dashes here.) -->
<command>OCA\OpenConnector\Command\AuthenticationConfig</command>
</commands>

<settings>
<admin>OCA\OpenConnector\Settings\OpenConnectorAdmin</admin>
<admin-section>OCA\OpenConnector\Sections\OpenConnectorAdmin</admin-section>
</settings>

<navigations>
<navigation>
<id>openconnector</id>
Expand All @@ -160,9 +181,4 @@
<icon>app.svg</icon>
</navigation>
</navigations>

<settings>
<admin>OCA\OpenConnector\Settings\OpenConnectorAdmin</admin>
<admin-section>OCA\OpenConnector\Sections\OpenConnectorAdmin</admin-section>
</settings>
</info>
Loading
Loading