$rule['id'] ?? '-', 'description' => $rule['description'] ?? '-', 'status' => $rule['status'] ?? '-', 'actions' => isset($rule['authentication_rules'][0]['actions']) ? implode(', ', array_map(fn($action) => $action['type'] . ': ' . $action['value'], $rule['authentication_rules'][0]['actions'])) : '-', 'conditions' => isset($rule['authentication_rules'][0]['conditions']) ? implode(', ', array_map(fn($condition) => $condition['attribute'] . ' ' . $condition['operator'] . ' ' . $condition['value'], $rule['authentication_rules'][0]['conditions'])) : '-' ]; }, $response['items']); $_SESSION['auth_rules_list'] = $auth_rules_list; } else { $auth_rules_list = "No authentication rules found or invalid response format."; } ?>