update
This commit is contained in:
@@ -1473,6 +1473,22 @@ class ApiKernel
|
||||
return;
|
||||
}
|
||||
|
||||
$settings = $this->getCustomerSettings($customerId);
|
||||
$allowedTables = $this->normalizeBridgeTables($settings['bridge_tables'] ?? []);
|
||||
if ($allowedTables && !empty($schema['tables']) && is_array($schema['tables'])) {
|
||||
$allowedMap = array_fill_keys($allowedTables, true);
|
||||
$schema['tables'] = array_values(array_filter($schema['tables'], static function ($entry) use ($allowedMap) {
|
||||
if (is_string($entry)) {
|
||||
$name = $entry;
|
||||
} elseif (is_array($entry)) {
|
||||
$name = $entry['name'] ?? $entry['table'] ?? $entry['label'] ?? '';
|
||||
} else {
|
||||
$name = '';
|
||||
}
|
||||
return $name !== '' && isset($allowedMap[$name]);
|
||||
}));
|
||||
}
|
||||
|
||||
$this->respond([
|
||||
'ok' => true,
|
||||
'tables' => $schema['tables'] ?? [],
|
||||
@@ -1664,6 +1680,7 @@ class ApiKernel
|
||||
$rotateBridge = !empty($this->in['rotate_bridge_token']);
|
||||
$rotateSender = !empty($this->in['rotate_sender_token']);
|
||||
$rotateExternal = !empty($this->in['rotate_external_token']);
|
||||
$bridgeTables = $this->normalizeBridgeTables($this->in['bridge_tables'] ?? []);
|
||||
|
||||
if ($bridgeUrl && !filter_var($bridgeUrl, FILTER_VALIDATE_URL)) {
|
||||
$this->fail('Ungültige Bridge-URL', null, 422);
|
||||
@@ -1679,6 +1696,7 @@ class ApiKernel
|
||||
'bridge_token' => $bridgeToken,
|
||||
'sender_token' => $senderToken,
|
||||
'external_api_token' => $externalToken,
|
||||
'bridge_tables' => $bridgeTables,
|
||||
]);
|
||||
|
||||
$this->respond(['ok' => true, 'settings' => $settings]);
|
||||
|
||||
Reference in New Issue
Block a user