mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
Use injected 'params' directly for audit resource labels
audits.resource labels only reference URL path params (resource IDs), so the audit code can use the injected 'params' local directly instead of reconstructing the full resolved param set. The path+query/body+default reconstruction now lives only in the cache hook, where the screenshot cache.resource label genuinely needs query params. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
cd0936c721
commit
c9059c75a4
1 file changed
+1
-8
@@ -863,13 +863,6 @@ Http::shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
// Reproduce the resolved param set: injected path values take precedence
|
||||
// over query/body params, falling back to each param's declared default.
|
||||
$requestParams = [];
|
||||
foreach ($route->getParams() as $key => $param) {
|
||||
$requestParams[$key] = $params[$key] ?? $request->getParam($key, $param['default']);
|
||||
}
|
||||
|
||||
/**
|
||||
* Abuse labels
|
||||
*/
|
||||
@@ -910,7 +903,7 @@ Http::shutdown()
|
||||
*/
|
||||
$pattern = $route->getLabel('audits.resource', null);
|
||||
if (! empty($pattern)) {
|
||||
$resource = $parseLabel($pattern, $responsePayload, $requestParams, $user, $project);
|
||||
$resource = $parseLabel($pattern, $responsePayload, $params, $user, $project);
|
||||
if (! empty($resource) && $resource !== $pattern) {
|
||||
$auditContext->resource = $resource;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user