lanscape 1.3.7__tar.gz → 1.3.8a1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of lanscape might be problematic. Click here for more details.
- {lanscape-1.3.7/lanscape.egg-info → lanscape-1.3.8a1}/PKG-INFO +1 -1
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/api/tools.py +23 -4
- {lanscape-1.3.7 → lanscape-1.3.8a1/lanscape.egg-info}/PKG-INFO +1 -1
- {lanscape-1.3.7 → lanscape-1.3.8a1}/pyproject.toml +1 -1
- {lanscape-1.3.7 → lanscape-1.3.8a1}/tests/test_api.py +24 -1
- {lanscape-1.3.7 → lanscape-1.3.8a1}/LICENSE +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/MANIFEST.in +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/README.md +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/__main__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/app_scope.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/decorators.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/device_alive.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/errors.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/ip_parser.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/logger.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/mac_lookup.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/net_tools.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/port_manager.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/runtime_args.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/scan_config.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/service_scan.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/subnet_scan.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/version_manager.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/libraries/web_browser.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/mac_addresses/convert_csv.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/mac_addresses/mac_db.json +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/ports/convert_csv.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/ports/full.json +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/ports/large.json +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/ports/medium.json +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/ports/small.json +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/resources/services/definitions.jsonc +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/app.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/api/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/api/port.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/api/scan.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/web/__init__.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/blueprints/web/routes.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/main.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/shutdown_handler.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/css/style.css +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/android-chrome-192x192.png +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/android-chrome-512x512.png +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/apple-touch-icon.png +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/favicon-16x16.png +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/favicon-32x32.png +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/favicon.ico +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/img/ico/site.webmanifest +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/core.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/layout-sizing.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/main.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/on-tab-close.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/quietReload.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/scan-config.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/shutdown-server.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/subnet-info.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/js/subnet-selector.js +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/static/lanscape.webmanifest +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/base.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/core/head.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/core/scripts.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/error.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/info.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/main.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/config.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/export.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/ip-table-row.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/ip-table.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/overview.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan/scan-error.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/scan.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape/ui/templates/shutdown.html +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape.egg-info/SOURCES.txt +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape.egg-info/dependency_links.txt +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape.egg-info/requires.txt +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/lanscape.egg-info/top_level.txt +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/setup.cfg +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/tests/test_env.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/tests/test_library.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/tests/test_logging.py +0 -0
- {lanscape-1.3.7 → lanscape-1.3.8a1}/tests/test_utils.py +0 -0
|
@@ -5,7 +5,7 @@ API endpoints for subnet testing and listing.
|
|
|
5
5
|
import traceback
|
|
6
6
|
from flask import request, jsonify
|
|
7
7
|
from lanscape.ui.blueprints.api import api_bp
|
|
8
|
-
from lanscape.libraries.net_tools import get_all_network_subnets
|
|
8
|
+
from lanscape.libraries.net_tools import get_all_network_subnets, is_arp_supported
|
|
9
9
|
from lanscape.libraries.ip_parser import parse_ip_input
|
|
10
10
|
from lanscape.libraries.errors import SubnetTooLargeError
|
|
11
11
|
from lanscape.libraries.scan_config import DEFAULT_CONFIGS
|
|
@@ -46,7 +46,26 @@ def list_subnet():
|
|
|
46
46
|
def get_default_configs():
|
|
47
47
|
"""
|
|
48
48
|
Get default scan configurations.
|
|
49
|
+
|
|
50
|
+
When active ARP lookups are not supported on the host system, adjust any
|
|
51
|
+
presets that rely on ``ARP_LOOKUP`` to use the ``POKE_THEN_ARP`` fallback
|
|
52
|
+
instead. This keeps presets such as ``accurate`` usable without requiring
|
|
53
|
+
frontend overrides.
|
|
49
54
|
"""
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
55
|
+
arp_supported = is_arp_supported()
|
|
56
|
+
|
|
57
|
+
configs = {}
|
|
58
|
+
for key, config in DEFAULT_CONFIGS.items():
|
|
59
|
+
config_dict = config.to_dict()
|
|
60
|
+
|
|
61
|
+
if not arp_supported:
|
|
62
|
+
lookup_types = list(config_dict.get('lookup_type') or [])
|
|
63
|
+
if 'ARP_LOOKUP' in lookup_types:
|
|
64
|
+
lookup_types = [lt for lt in lookup_types if lt != 'ARP_LOOKUP']
|
|
65
|
+
if 'POKE_THEN_ARP' not in lookup_types:
|
|
66
|
+
lookup_types.append('POKE_THEN_ARP')
|
|
67
|
+
config_dict['lookup_type'] = lookup_types
|
|
68
|
+
|
|
69
|
+
configs[key] = config_dict
|
|
70
|
+
|
|
71
|
+
return jsonify(configs)
|
|
@@ -5,6 +5,7 @@ Tests REST API endpoints for port management, subnet validation, and scan operat
|
|
|
5
5
|
import json
|
|
6
6
|
import time
|
|
7
7
|
import unittest
|
|
8
|
+
from unittest.mock import patch
|
|
8
9
|
|
|
9
10
|
from lanscape.ui.app import app
|
|
10
11
|
from lanscape.libraries.net_tools import get_network_subnet
|
|
@@ -157,13 +158,35 @@ class ApiTestCase(unittest.TestCase):
|
|
|
157
158
|
if count == -1:
|
|
158
159
|
self.assertFalse(data.get('valid'))
|
|
159
160
|
|
|
161
|
+
def test_default_scan_configs_adjust_for_arp_support(self):
|
|
162
|
+
"""Accurate preset should fall back when ARP lookup is unavailable."""
|
|
163
|
+
with patch('lanscape.ui.blueprints.api.tools.is_arp_supported', return_value=False):
|
|
164
|
+
response = self.app.get('/api/tools/config/defaults')
|
|
165
|
+
|
|
166
|
+
self.assertEqual(response.status_code, 200)
|
|
167
|
+
configs = json.loads(response.data)
|
|
168
|
+
|
|
169
|
+
accurate_lookup = configs['accurate']['lookup_type']
|
|
170
|
+
self.assertNotIn('ARP_LOOKUP', accurate_lookup)
|
|
171
|
+
self.assertIn('POKE_THEN_ARP', accurate_lookup)
|
|
172
|
+
|
|
173
|
+
def test_default_scan_configs_keep_arp_when_supported(self):
|
|
174
|
+
"""Accurate preset should retain ARP lookup when supported."""
|
|
175
|
+
with patch('lanscape.ui.blueprints.api.tools.is_arp_supported', return_value=True):
|
|
176
|
+
response = self.app.get('/api/tools/config/defaults')
|
|
177
|
+
|
|
178
|
+
self.assertEqual(response.status_code, 200)
|
|
179
|
+
configs = json.loads(response.data)
|
|
180
|
+
|
|
181
|
+
accurate_lookup = configs['accurate']['lookup_type']
|
|
182
|
+
self.assertIn('ARP_LOOKUP', accurate_lookup)
|
|
183
|
+
|
|
160
184
|
def _render_scan_ui(self, scanid):
|
|
161
185
|
uris = [
|
|
162
186
|
'/info',
|
|
163
187
|
f'/?scan_id={scanid}',
|
|
164
188
|
f'/scan/{scanid}/overview',
|
|
165
189
|
f'/scan/{scanid}/table',
|
|
166
|
-
f'/scan/{scanid}/table?filter=test',
|
|
167
190
|
f'/export/{scanid}'
|
|
168
191
|
]
|
|
169
192
|
for uri in uris:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|