Commit Graph
118 Commits
Author SHA1 Message Date
YueGuobin 1649fb7b7a api: add endpoint serving the project .gns3 topology file
GET /v3/projects/{project_id}/gns3file returns the raw .gns3 file as
application/json so the WebUI can render topology thumbnails without
opening the project. Adds a public Project.topology_file property.
2026-08-24 22:19:09 +08:00
YueGuobin e0962a59ed feat: add GET/PUT /v3/settings server settings API
GET returns all settings sections except the deprecated
VirtualBox/VMware ones (Server.Audit privilege); secrets are
masked and Controller.jwt_secret_key is excluded entirely.
PUT applies a partial update (Server.Modify privilege): masked
or empty secrets mean unchanged, null removes the option, the
response carries the new values plus restart_required, and a
settings.updated notification is emitted. New
Server.Audit/Server.Modify privileges are seeded into the
Administrator role at table creation.
2026-08-23 18:54:31 +08:00
YueGuobin 7e8c515a3c api: expose installed netmiko device types for the web UI
New GET /v3/netmiko/device_types endpoint returns the device types
supported by the netmiko library installed on the server, including
the gns3-copilot custom drivers, so the web UI can populate the
netmiko_device_type dropdown on templates and nodes.

The list is read at runtime from netmiko's ssh_dispatcher.CLASS_MAPPER
registry (the same table ConnectHandler dispatches on), filtered to
drop the '_ssh' aliases and the 'autodetect' pseudo type, and cached
for the process lifetime. Returns 501 when netmiko is not installed
(ai-features extra).
2026-08-21 21:41:42 +08:00
YueGuobin 300c53e6fb templates: persist appliance metadata on install
Appliance fields that describe the appliance (vendor information, default
credentials, installation instructions...) were dropped when installing a
template. Keep them in a new appliance_metadata JSON column on the
templates table, filled by the appliance-to-template conversion for both
registry v1-6 and v8 (version level values override the appliance level
ones). The nested schema allows extra fields so future registry fields
persist without a migration.
2026-08-21 21:41:42 +08:00
YueGuobin 1c68a52856 fix: address appliance v8 install review findings
- install: resolve the image directory from the version's settings type and
  skip image handling for docker appliances; guard appliance.images
- appliance schema: validate template_properties against template_type,
  align cpu_throttling with the qemu template, add kvm and version idlepc
- conversion: map IOU image to path, kvm disable to accel=tcg, inherit only
  same-type default settings, symbol fallback from the effective category,
  template_properties cannot override structural fields
- allow clearing netmiko_device_type with an empty string
- download the template symbol regardless of the level it is defined at and
  give qemu guests a default symbol
2026-08-21 21:41:42 +08:00
YueGuobin 9260108f53 templates: add netmiko_device_type for automation tools
Common template field (schema + templates table column + Alembic
migration) holding the Netmiko device type (e.g. 'cisco_xr', 'nokia_srl')
so Netmiko/Nornir based tooling can look up how to reach a node's CLI
without hard-coded vendor mappings. Free-form lowercase string on
purpose: Netmiko's platform list evolves independently of GNS3.
2026-08-21 21:41:35 +08:00
grossmj 0219914103 fix: breaking change with dependency FastAPI v0.137.0
https://fastapi.tiangolo.com/release-notes/#specific-breaking-changes
2026-08-11 18:47:02 +02:00
Jeremy Grossmann 909ccf8fcd Merge branch '3.1' into base-configs-3.0 2026-08-08 22:11:39 +02:00
YueGuobin f7b19dae99 marker: tighten marker name max length from 128 to 32
128 characters was far beyond any realistic marker label (icmp, arp, tcp-syn)
and would have collided with the pcap filename budget once a tag prefix is
added later. Cap the user-facing name at 32 in both MarkerCreate and
MarkerDefinitionCreate; the compute-side name guard now also rejects names
longer than 48, which covers the `global-{def_name}` inherited form (≤ 39).
2026-08-05 00:49:37 +08:00
Cristi 2abc7e09a3 Adds controller and compute API support for explicitly pulling or updating Docker images. 2026-07-24 16:40:20 +03:00
YueGuobin 213738f0a5 test(marker): add controller + API route tests for traffic-insight
19 controller-layer tests covering start/stop/update_marker (storage,
inheritance guards + bypasses, partial-update preservation of render
hints), project-def CRUD (fan-out, sync, delete-cleanup regression),
apply_defs_to_new_link, persist_markers/asdict, and aggregation.

15 API-route tests covering per-link create/update/delete (201/200/204),
global-prefix rejection on create (409 regression), bad-format rejection
(422), PUT/DELETE-on-inherited guard (409 regression), project-def CRUD
endpoints, and the aggregation view.

All 34 tests pass when run as part of the full suite.
2026-07-16 00:39:52 +08:00
YueGuobin 0e8d0cb87b Add stateless JWT refresh token mechanism
- New config: Controller.jwt_refresh_token_expire_minutes (default 30 days)
- New endpoint: POST /v3/access/users/refresh (public, unauthenticated)
- Login/authenticate responses now include refresh_token
- AuthService: _create_token helper, create_refresh_token, get_token_data
  now parses type claim (token_use) for token classification
- Security: refresh tokens rejected on HTTP + WebSocket access paths;
  /refresh strictly requires type=='refresh'
- Logout works for free via existing token_version mechanism
- Tests: 9 new TestRefreshToken cases, all passing; 34 existing tests
  still pass (no regressions)
2026-06-23 22:39:11 +08:00
YueGuobin cbb21e8e40 feat: Node file streaming, recursive listing, file type detection, and file delete
- Stream file GET/POST through controller without buffering in memory
- Add recursive and subdirectory filtering to node file listing
- Replace file extension with magic-based file type detection
- Add DELETE endpoint for node and project files
- Include directories in listing response
- Add params and stream support to http_query
- Fix lambda closures, streamer exception scope, and delete error codes
2026-06-09 22:52:50 +08:00
Jeremy Grossmann 12347b24aa Merge branch '3.1' into base-configs-3.0 2026-06-01 11:39:40 +02:00
YueGuobin 92a0fa6cd7 Fix packet filter validation tests: use correct ubridge filter type names 2026-05-31 00:38:03 +08:00
YueGuobin 67c6f3c970 test: fix privilege count assertions after adding LLMConfig privileges
The LLMConfig.Audit and LLMConfig.Modify privileges added to the User
role increased the default privilege count from 25 to 27. Update test
assertions to match the new counts.
2026-05-28 01:24:22 +08:00
Volobue b5e44b5403 added mock user in api endpoints tests 2026-05-25 22:17:14 +03:00
Volobue 01511f3aef added endpoint to v3 branch 2026-05-25 21:37:04 +03:00
Volobue b74ebafb8f api endpoint implemented 2026-05-25 20:07:05 +03:00
grossmj 9c988b34d0 Fix snapshots after merging 2026-04-11 19:54:49 +08:00
grossmj d97aedb625 Fix tests 2026-04-06 20:03:38 +08:00
UmmmAGoodName 4cf8b79692 Fix addressing issue #2005 including tests 2026-04-05 21:51:52 +02:00
Mr.GIitch 302878b391 Merge branch 'GNS3:3.0' into 3.0 2026-03-12 14:44:43 +01:00
grossmj 3abecc8492 Fix IOU tests 2026-03-12 14:18:35 +08:00
UmmmAGoodName 4a45a68703 Changed errors to new type, was causing warnings 2026-03-11 18:48:36 +01:00
grossmj 4606613673 Fix image handling 2026-03-05 12:38:28 +08:00
grossmj 47a7324eb5 Fix tests 2026-02-25 19:00:57 +08:00
grossmj 4d35477e46 Add/fix tests 2026-02-23 23:27:36 +08:00
grossmj 1d45df6613 Upgrade dependencies 2026-01-24 21:38:58 +08:00
grossmj 90cf73e434 Fix tests 2025-04-18 13:38:01 +07:00
grossmj 5019167098 Fix interface information API endpoint for Cloud/NAT devices 2025-04-16 15:26:56 +07:00
Mark Paronyan f21887dbab tests(get_iface): add unittests 2025-03-23 14:28:58 +00:00
grossmj ba4e0c945d Refactor tests and upgrade dev package requirements 2025-01-17 19:12:44 +10:00
grossmj 08693871ae Support to create templates based on image checksums. 2025-01-03 21:35:14 +07:00
grossmj ac4c5f5985 Improve tests for pruning images 2025-01-03 19:56:41 +07:00
grossmj e17a79e261 Fix tests 2025-01-02 23:17:55 +07:00
grossmj 4758431c76 Improvements for built-in disks
* Checksum is updated in the database for updated disks.
* It is not possible to prune them.
2025-01-02 23:10:51 +07:00
grossmj 9d6cea665a Replace python-jose library by joserfc 2024-12-30 15:25:24 +07:00
grossmj ae538dd11d Fix test user with wrong creds 2024-10-31 19:31:17 +10:00
grossmj ce4dd17409 Upgrade fastapi and fix tests 2024-10-31 19:23:28 +10:00
grossmj 689d476b71 Fix tests 2024-04-28 18:03:06 +07:00
grossmj 5092bd2fdf List elements when a project is closed 2023-10-09 13:16:12 +10:00
grossmj 674381f1be Fix tests 2023-09-25 21:08:23 +10:00
grossmj 7534718a1c Remove privileges endpoint from roles 2023-09-14 22:41:08 +07:00
Jeremy Grossmann 63c1defd9a Merge branch '3.0' into resource-pools 2023-09-14 22:38:52 +07:00
Sylvain MATHIEU OBS 10eeefc1f5 API: add endpoint to expose availables privileges to web UI 2023-09-12 15:24:54 +02:00
grossmj a95dda0d1d Complete resource pool support for projects 2023-09-11 18:15:03 +07:00
grossmj d53ef175f8 DB and API for resource pools 2023-09-07 17:31:11 +07:00
grossmj 8aa9d1aae6 Upgrade dependencies and fix user group tests 2023-09-03 17:58:51 +07:00
grossmj 6ec97a704f Put user, groups, roles and ACL under /access 2023-09-02 19:10:02 +07:00