fix: normalize missing bruteforce_protection and headers_to_exclude on ExApp routes#882
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
🚧 Files skipped from review as they are similar to previous changes (4)
📝 WalkthroughWalkthroughThis PR adds ExAppMapper::parseJsonList to normalize JSON-list DB fields and tests it. Callers were updated to use it: ExAppProxyController (bruteforce_protection, headers_to_exclude) and HarpService (route bruteforce_protection). ExAppService::registerExAppRoutes now returns the ExApp reloaded from persistence and broadens its exception handling. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 5dd5e717-920d-4226-963f-1a581d18c6eb
📒 Files selected for processing (5)
lib/Controller/ExAppProxyController.phplib/Db/ExAppMapper.phplib/Service/ExAppService.phplib/Service/HarpService.phptests/php/Db/ExAppMapperTest.php
…n ExApp routes Signed-off-by: Oleksander Piskun <oleksandr2088@icloud.com>
21a31ac to
2e78425
Compare
|
/backport to stable33 |
|
/backport to stable34 |
ExAppProxyController::buildHeadersWithExcludecrashes withTypeError: json_decode(): Argument #1 must be of type string, null givenwhen a route'sheaders_to_exclude(orbruteforce_protection) column is NULL or otherwise non-string - the proxy returns HTTP 500 before the request ever leaves Nextcloud.This PR centralizes the parse in a single static helper
ExAppMapper::parseJsonList()that toleratesNULL, malformed JSON, and non-string inputs, and uses it from the three sites that read those columns (ExAppProxyController,HarpService).ExAppService::registerExAppRoutesis also tightened to refetch the ExApp after insert and broaden its catch.A follow-up PR will add fail-fast validation at registration time so malformed
info.xml/--jsonpayloads are rejected upfront with a clear error, instead of being silently coerced to'[]'as they are today.