refactor(store): consume OpenRegister's GenericStoreService, delete the app-local proxy (ADR-080) - #109
Merged
Conversation
…he app-local proxy (ADR-080) StoreController now extends AppHost's GenericStoreControllerBase and inherits search() plus the SSRF-guarded, redirect-refusing, token-private fetch. RemoteTemplateStoreService (331 lines) and its test file are deleted; the behaviour and the SSRF controls live in OpenRegister's GenericStoreServiceTest. Install stays here, and only install — cloning a template into a local virtual app is OpenBuild-specific and differently authorized from the connector-adapter and agent-template installs in other apps. Three things the tests caught that review would not have: 1. The suite could not load StoreController at all — `extends` is resolved by the AUTOLOADER, not the container, and the OR AppHost classes are stubbed here rather than autoloaded. Added stubs for GenericStoreService, StoreDescriptor and GenericStoreControllerBase. This is the same mechanism by which a missing sibling app 500s EVERY route in production, which is why ADR-080 restricts subclassing to apps declaring openregister a hard <app> dependency — this app qualifies (8 controllers already type-hint OR classes). 2. The search test's `getParam` mock returned one value for ANY key, so `kind` silently received the query string. Made it key-aware; the action reads `q` and `kind` separately. 3. tests/stubs/openregister-stubs.php defines a NO-OP SecurityService, because the real guard does DNS lookups that fail for .test fixture hostnames. Any "SSRF negative control" written against that stub passes regardless of what the guard does. Corrected the docblock to say so, and to point at the OpenRegister suite where the real guard is exercised. The new store stub is deliberately non-behaving for the same reason. 743/743 unit tests, 7/7 on the store controller.
Contributor
Quality Report — ConductionNL/openbuild @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ❌ | ||||
| phpstan | ❌ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ✅ | ✅ 662/662 | |||
| PHPUnit | ⏭️ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Quality workflow — 2026-08-03 18:50 UTC
Download the full PDF report from the workflow artifacts.
StoreController is a plain Controller injecting GenericStoreService, with its
own ~30-line search() action, rather than subclassing a cross-app base. The
inheritance broke phpstan ('extends unknown class', which it refuses to let you
ignore), psalm, and the unit suite's class loading — one stub entry now covers
the injected type-hint instead.
phpstan OK, psalm no errors, 743/743 tests.
Contributor
Quality Report — ConductionNL/openbuild @
|
| Check | PHP | Vue | Security | License | Tests |
|---|---|---|---|---|---|
| lint | ✅ | ||||
| phpcs | ✅ | ||||
| phpmd | ✅ | ||||
| psalm | ✅ | ||||
| phpstan | ✅ | ||||
| phpmetrics | ✅ | ||||
| eslint | ✅ | ||||
| stylelint | ✅ | ||||
| build | ✅ | ||||
| composer | ✅ | ✅ 100/100 | |||
| npm | ✅ | ✅ 662/662 | |||
| PHPUnit | ✅ | ||||
| Newman | ⏭️ | ||||
| Playwright | ⏭️ |
Coverage: 89.4% (17/19 statements)
Quality workflow — 2026-08-03 18:58 UTC
Download the full PDF report from the workflow artifacts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
StoreControllernow extends AppHost'sGenericStoreControllerBaseand inheritssearch()plus the SSRF-guarded, redirect-refusing, token-private fetch.RemoteTemplateStoreService(331 lines) and its test file are deleted; the behaviour and the SSRF controls live in OpenRegister'sGenericStoreServiceTest.Install stays here, and only install — cloning a template into a local virtual app is OpenBuild-specific and differently authorized from the connector-adapter and agent-template installs in other apps.
Depends on ConductionNL/openregister#2310.
Three things the tests caught that review would not have
1. The suite could not load
StoreControllerat all.extendsis resolved by the autoloader, not the container, and the OR AppHost classes are stubbed here rather than autoloaded — so every test in the class errored before it ran. Added stubs for the three new classes.This is the same mechanism by which a missing sibling app 500s every route in production, which is why ADR-080 restricts subclassing to apps declaring openregister a hard
<app>dependency. This app qualifies — 8 controllers already type-hint OR classes — but an app where OR is optional must use composition instead.2. The search test's
getParammock returned one value for any key, sokindsilently received the query string. Made it key-aware; the action readsqandkindseparately.3.
tests/stubs/openregister-stubs.phpdefines a NO-OPSecurityService, because the real guard does DNS lookups that fail for.testfixture hostnames. Any "SSRF negative control" written against that stub passes regardless of what the guard does — so this app's SSRF tests were never testing the guard. Corrected the docblock to say so and to point at the OpenRegister suite where the real guard is exercised. The new store stub is deliberately non-behaving for the same reason.Verification
743/743 unit tests · 7/7 on the store controller.
Companion PRs: hydra (ADR-079/080), nextcloud-vue, openregister, openconnector.