mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Allowlist support
This commit is contained in:
@@ -944,7 +944,21 @@ Http::shutdown()
|
||||
*/
|
||||
$pattern = $route->getLabel('audits.payload', true);
|
||||
if (! empty($pattern)) {
|
||||
$auditContext->payload = $responsePayload;
|
||||
$pattern = $route->getLabel('audits.payload.allowList', []);
|
||||
if(empty($pattern)) {
|
||||
$auditContext->payload = $responsePayload;
|
||||
} else {
|
||||
$auditContextPayload = [];
|
||||
|
||||
foreach ($pattern as $key) {
|
||||
if (isset($responsePayload[$key])) {
|
||||
$auditContextPayload[$key] = $responsePayload[$key];
|
||||
}
|
||||
}
|
||||
|
||||
$auditContext->payload = $auditContextPayload;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$publisherForAudits->enqueue(AuditMessage::fromContext($auditContext));
|
||||
|
||||
@@ -43,6 +43,13 @@ class Create extends Action
|
||||
->label('event', 'rules.[ruleId].create')
|
||||
->label('audits.event', 'rule.create')
|
||||
->label('audits.resource', 'rule/{response.$id}')
|
||||
->label('audits.payload', true)
|
||||
->label('audits.payload.allowList', [
|
||||
'domain', 'type', 'region', 'trigger', // Generic config
|
||||
'deploymentId', 'deploymentInternalId', // Deployment congif
|
||||
'deploymentResourceInternalId', 'deploymentResourceId', 'deploymentResourceType', // Site / Function config
|
||||
'redirectUrl', 'redirectStatusCode', // Redirect config
|
||||
])
|
||||
->label('sdk', new Method(
|
||||
namespace: 'proxy',
|
||||
group: null,
|
||||
|
||||
Reference in New Issue
Block a user