1
0
Fork 1
mirror of https://github.com/thatmattlove/hyperglass.git synced 2026-04-26 01:38:32 +00:00
Commit graph

1104 commits

Author SHA1 Message Date
Tan Siewert
79d235c2ff
frr: return AS0 if AS_PATH length is zero
Local prefixes usually do not have an AS_PATH:
```
vtysh -c "show bgp ipv4 unicast 10.10.10.10 json" | jq '.paths[].aspath'
{
  "string": "Local",
  "segments": [],
  "length": 0
}
```

Set AS0 as a temporary solution when AS_PATH length is zero. This
avoids parser failures for local prefixes, though ideally we should
use the device's actual ASN (see TODO in code).

Signed-off-by: Tan Siewert <tan@siewert.io>
2025-10-04 21:35:30 +02:00
Tan Siewert
32873934cf
frr: set default values for optional next-hop fields
The metric and used fields might not be returned, causing the parser to
fail if they are not present. The absence was observed in FRR 10.4.1
with a multipath IPv6 route that has two next-hops (one GUA, one LL):
```
$ vtysh -c "show bgp ipv6 unicast 2003::/19 json" | jq '.paths[].nexthops'
[
  {
    "ip": "2a0d:2146:bdff:120::1",
    "afi": "ipv6",
    "scope": "global",
    "linkLocalOnly": false,
    "length": 32,
    "metric": 0,
    "accessible": true
  },
  {
    "ip": "fe80::3e61:408:1e3e:cff0",
    "afi": "ipv6",
    "scope": "link-local",
    "length": 32,
    "accessible": true,
    "used": true
  }
]
[
  {
    "ip": "2a0d:2146:bdff:120::1",
    "afi": "ipv6",
    "scope": "global",
    "linkLocalOnly": false,
    "length": 32,
    "metric": 0,
    "accessible": true
  },
  {
    "ip": "fe80::3e61:408:1e3e:cff0",
    "afi": "ipv6",
    "scope": "link-local",
    "length": 32,
    "accessible": true,
    "used": true
  }
]
```

Tested: Query a prefix with multiple next-hops where the metric or used
attributes are missing on one of them.

Signed-off-by: Tan Siewert <tan@siewert.io>
2025-10-04 21:35:27 +02:00
Tan Siewert
934e8f3146
bgp_route_frr: skip empty route query results
In case a route is not present in the RIB, FRR returns an empty JSON
object:

```
$ vtysh -c "show bgp ipv4 unicast 1.2.3.4 json"
{}
```

Skip these empty objects to prevent the parser from failing.

Signed-off-by: Tan Siewert <tan@siewert.io>
2025-10-04 21:35:17 +02:00
Jason Hall
98abca6e8e Update ssh.py
Fixed linting errors
2025-09-29 20:29:05 -04:00
Jessie Bryan
2868d505b8 fix(proxy): pass proxy.port to open_tunnel as ssh_port keyword 2025-09-29 20:29:05 -04:00
Jason Hall
af7cf95968
Merge branch 'main' into computroniks/bug/#311-fix-field-validation 2025-09-27 20:58:59 -04:00
Jason Hall
b52a383691 fixes formatting 2025-09-25 23:40:58 -04:00
Chumy
8f690adb5c Fix bug: Directives will be error on deserialize rules and field with None type 2025-09-25 23:17:21 -04:00
Jason Hall
c68b00423a
Update pnpm-workspace.yaml 2025-06-14 22:17:03 -04:00
Jason Hall
cf137bd7e8
format and lint 2025-06-14 21:44:20 -04:00
Jelson Stoelben Rodrigues
23522da754 fix: ensure query_target is transformed after validation
Transformation must occur after validation, or else the transformation will possibly make the validation fail
2025-06-09 21:37:14 -04:00
Jelson Stoelben Rodrigues
f67c676a2d feat: add Huawei BGP Route Input Plugin
Create builtin plugin to transform input field before passing to Huawei device
2025-06-09 21:37:14 -04:00
Jelson Stoelben Rodrigues
44f8faa1e5 fix: timeout when fetching bgp routes
Huawei has pagination by default and when the output exceeds 24 lines it expects the user to keep scrooling to display the output. This makes the netmiko time out. By passing "| no-more" the pagination will be disabled for the command
2025-06-09 21:37:14 -04:00
Chris Wiggins
51c7f9eef6 feat: Add FRR structured output for BGP Routes 2025-06-09 21:12:18 -04:00
GrandArcher
e6e11ee058
Update mikrotik.py (#292)
Fixed Mikrotik_BGPRoute to print all routes that contain {target} instead of having to be an exact match to {target}.
2025-06-06 05:36:54 -04:00
KyleM
2ba8b2c67c
Fix VyOS Directives. (#284)
* Fixed vyos directives syntax

* Trying raw output

* Switched from MTR to traceroute as hyperglass cannot handle the encoding of MTR output.
2025-06-06 05:25:42 -04:00
Mattie Nickson
b7e268bf18
Fixed API docs rendering
The use of `strip_whitespace` in `Field` for the query validation model caused the automatic generation of the API docs to fail with `ValueError: `schema_extra` declares key `strip_whitespace` which does not exist in `Schema` object`. By switching from `Field` to `Annotated` with `StringConstraints`, this avoids this issue allowing API docs to be correctly rendered.

Signed-off-by: Mattie Nickson <mnickson@sidingsmedia.com>
2025-06-06 10:08:59 +01:00
Mattie Nickson
6d132e27b4
Fixed validation of no condition rules
Previously, when processing rules with no condition, an extra RuleWithPattern rule was also added to the rule list causing a validation error. This has been corrected.

Signed-off-by: Mattie Nickson <mnickson@sidingsmedia.com>
2025-06-04 17:59:49 +01:00
Mattie Nickson
d653461b5d
Fix field validation for device config.
Some of the field validator methods for device config used `values` as a dictionary (presumably from an old version of pydantic). This is now passed as a `ValidationInfo` object by pydantic, which caused issues when code attempted to access it. The affected methods have been updated to fix the issue.

Fix #311

Signed-off-by: Mattie Nickson <mnickson@sidingsmedia.com>
2025-06-04 13:33:28 +01:00
cooperwinser
c369af439d Removed Union import 2025-05-17 23:34:15 +10:00
cooperwinser
7135ec3c9c Fix: allow integer values in extCommunityListRaw field for Arista BGP parsing 2024-12-09 12:08:25 +11:00
cooperwinser
2ed949a7a4 Fix: allow integer values in extCommunityListRaw field for Arista BGP parsing 2024-12-09 11:53:19 +11:00
Matt Love
c2142ee76f
Merge pull request #264 from openxbr/main
Fix for IPv6 traceroute for juniper devices
2024-07-01 00:06:15 -04:00
thatmattlove
ec3c55aa81 prepare v2.0.4 2024-07-01 00:01:03 -04:00
thatmattlove
a5bc1ca8a0 fix formatting 2024-06-30 23:55:59 -04:00
thatmattlove
0f52bc438f closes #268: fix issue with mikrotik commands 2024-06-30 23:55:05 -04:00
thatmattlove
e0751311ba remove unnecessary logging 2024-06-30 23:54:37 -04:00
thatmattlove
f340e65082 fix BGP route validation 2024-06-30 23:33:06 -04:00
thatmattlove
41248231ae fix logging issues 2024-06-30 23:22:46 -04:00
thatmattlove
b617df24d1 fixes #267: fix response caching 2024-06-30 22:22:44 -04:00
thatmattlove
3b0abd5ba8 don't cache errors 2024-06-30 21:34:42 -04:00
thatmattlove
0fd5bc7997 fix incorrectly named ui filename 2024-06-30 21:16:21 -04:00
Renato Ornelas
e8997b981c Fix for IPv6 traceroute for juniper devices 2024-06-19 15:11:22 -03:00
thatmattlove
7eb8d8e925 fix formatting 2024-06-16 17:18:58 -04:00
thatmattlove
4733dd1893 prepare v2.0.3 2024-06-16 17:17:13 -04:00
thatmattlove
08fd310b44 fix issue where pattern rules failed validation 2024-06-16 17:12:54 -04:00
thatmattlove
6d06b9809d (possibly) fix log width issue 2024-06-16 16:59:22 -04:00
thatmattlove
30fda91bc8 closes #262: fix mikrotik error 2024-06-16 16:54:14 -04:00
thatmattlove
e19dd675e5 fix issue where results accordion did not re-open 2024-06-16 16:53:46 -04:00
thatmattlove
8a9766b99f formatting cleanup 2024-06-16 16:53:30 -04:00
thatmattlove
4d5e259f6e fix non-success display issue 2024-06-16 16:53:14 -04:00
thatmattlove
0137b042dc prepare v2.0.2 2024-06-01 15:44:49 -04:00
thatmattlove
6b37ce96f6 fix logo alignment on small screens; closes #258 2024-06-01 15:40:49 -04:00
thatmattlove
aab4ada723 add support for any DoH provider; closes #254; closes #256 2024-06-01 15:25:41 -04:00
thatmattlove
bfcae89bf0 fix prepending of HYPERGLASS_APP_PATH to values; closes #253 2024-06-01 15:08:59 -04:00
thatmattlove
8a3d704eca fix broken license link 2024-06-01 14:50:00 -04:00
thatmattlove
b796149a26 fix dropdown remaining open after selection; closes #257 2024-06-01 14:49:05 -04:00
thatmattlove
7eb4f5ca93 fix leftover issue from #247 if build_dir does not exist 2024-05-31 23:11:08 -04:00
thatmattlove
35d9c26eff update version to 2.0.1 2024-05-31 23:06:33 -04:00
thatmattlove
1d1dcd8319 fix logo width on mobile 2024-05-31 23:00:51 -04:00