Commit Graph

89 Commits

Author SHA1 Message Date
Paul Lorenz a0e53e29d4 Auto-GC stale router links. Fixes #4005
- adds a structured xlink.LinkKey ({DialerBinding, Protocol, DestId,
  ListenerBinding}) used by all staleness and GC checks, replacing the
  pre-rendered key string each side used to pass around
- adds the CheckStaleLinks ctrl message and the `ziti ops verify stale-links`
  CLI for operator-driven, two-sided staleness verification with optional --gc,
  which acts only when both endpoints agree
- implements auto-GC via the router.link.v1 gcMode (preserve/orphaned/changed):
  the router walks its xlinks after each Apply that mutates listeners, dialers,
  or gcMode and closes one-sided-stale entries under the configured mode
- sweeps a removal under orphaned whatever the removed config said, including
  preserve, since a removal leaves no listeners and no dialers and every
  remaining link is one the router can never re-establish
- reports staleness as a three-state verdict (unknown/notStale/stale) so a side
  that cannot judge a link abstains instead of guessing; a destination absent
  from the registry's listener snapshot means "listeners unknown", not "peer has
  none", which keeps a briefly unhealthy peer from losing its live links
- rebuilds the link surface only when a listener or dialer definition actually
  moves, so a gcMode-only change no longer rebinds every listen socket
- gates CheckStaleLinks on a new RouterStaleLinkCheck capability and explains
  each unqueryable endpoint, including one left unasked by the filter, so a
  partial verdict says which of the three causes applies
- detects a peer re-advertising the address a link was dialed to from the
  dialing side, not just from the peer's own listener side
- pins every verdict to the link iteration it was computed against, faults that
  iteration rather than the current one, and takes the conditional removal's
  result as the decision, so a link re-dialed while the sweep was running is
  neither closed nor reported as collected
- resolves which side a report speaks for from the sending router against the
  controller's link map rather than from the side the report names, so one
  router cannot fill both sides and satisfy the both-agree rule --gc depends on
- bounds the query fan-out with a semaphore, matching the other validation
  sweeps, since each query carries a minute-long reply timeout
- fails the CLI when the result stream ends before every link is reported, and
  drains results already buffered before declaring any missing
- rejects an unrecognized match mode rather than resolving it to changed, the
  broadest removal criterion
- consolidates the controller-managed router configuration changelog into one
  section, replacing the status that said routers do not yet consume configs at
  runtime, and documents the per-config-type opt-in
- restores the Current Beta Features section, dropped when the 2.0 changelog was
  archived, and lists controller-managed router configuration in it
- adds unparseable to the codespell ignore list, a spelling variant the
  dictionary flags as a typo

For #3743.
2026-09-11 15:56:22 -04:00
Paul Lorenz e8b42b89ae Add OIDC auth fablab test and supporting test infrastructure
- adds an oidc-auth-test fablab model that exercises OIDC authentication end to end, with an event-forwarder component, an oidc-test-client, a ziti-prox-c component, and OIDC event/gossip/traffic validations
- moves zitirest out of the public API into separate test-only shims: an integration-test shim (tests/restclient.go) and a fablab shim (zititest/zitirest), and repoints upgrade-test at the fablab shim
- adds region-isolation network partitioning and packet capture on all interfaces to the chaos toolkit
- queues oidc-test-client results reporting on a single sender goroutine with a bounded write deadline, so a stalled results circuit can't block the traffic loops
- counts results events dropped when that queue fills and reports them to the collector as errors, so a reporting outage fails validation instead of looking like a clean run
- bounds the event forwarder's event and keepalive writes, and checks for shutdown on every send attempt, so an unreadable destination can't park the forward loop holding its lock
- logs read errors on collector connections instead of ending collection for that client silently
- bounds the oidc-auth-test debug server's header and body reads
- matches ziti-prox-c process matching to the version-agnostic binary name, so a version change still finds the running process
- points upgrade-test's per-service terminator count at the shared validations helper
- adds a fablab design summary doc
2026-08-28 22:00:01 -04:00
Paul Lorenz ae806045b5 Convert self-describing receive handlers to channel/v5. For #3983
- channel.TypedReceiveHandler -> channel.ContentTypeReceiver
- binding.AddTypedReceiveHandler(h) -> channel.AddReceiveHandlers(binding, h)

channel/v5 repurposes TypedReceiveHandler for the senders-typed handler and replaces the
self-describing pattern with ContentTypeReceiver plus the AddReceiveHandlers free function
(openziti/channel#262). Mechanical conversion; does not build on its own.
2026-06-18 12:51:02 -04:00
Paul Lorenz 1c122af490 Rewrite channel/v4 imports to channel/v5. For #3983
- moves the channel dependency to channel/v5 v5.0.10 and sdk-golang to v1.9.0 in the root and zititest modules
- mechanically rewrites every channel/v4 import path to channel/v5

This is the import-path-only step; the API-level changes the switch requires land in the following commit. This commit does not build on its own.
2026-06-18 12:51:02 -04:00
Paul Lorenz 0ee288ecbf Distribute routers and router-target configs through the RDM. Fixes #3976 (#3977)
- adds a `DataState.Router` event variant (id, name, fingerprint,
  configs) to the RDM protobuf and the matching ConfigType.Target field
  flows
- loads routers into `RouterDataModelSender` at startup and registers
  entity-change listeners so router create/update/delete and config
  reassignment emit RDM events
- filters `Config` events per-router at `RouterSender`: each router
  sees the full `Router` set but only its own router-target Configs
- receiver-side: parses and stores `Router` entities; GCs router-target
  Configs locally when they drop off the router's `Configs` list, so
  no synthetic remove events are needed on the wire
- extends the `router-data-model-test` fablab model with router-config
  distribution scenarios (assignment, reassignment, controller
  restart, RDM cache miss)
- updates `validate-router-data-model` to recognize the new event
  shape
- refreshes the design doc to describe per-router filtering and the
  change-notification flow
2026-06-16 22:31:43 -04:00
Paul Lorenz b5eaeefdb3 Prep for channel v5: bind handler invocation, send priorities. Fixes #3942
- invokes bind handlers via h.BindChannel(binding) instead of binding.Bind(h), which channel v5 removes from the Binding interface
- removes WithPriority from edge dial and state message sends; priority was already a no-op on grouped channels and channel v5 removes the priority API
2026-06-05 15:24:45 -04:00
Paul Lorenz 6b869cea9d Add support for ctrlChanListener on router to the model. Fixes #3635 2026-03-07 00:00:51 -05:00
Paul Lorenz 90112219a3 Support multi-underlay control channels. Fixes #3550 2026-02-11 14:20:29 -05:00
Paul Lorenz da9ef76d19 Optimize imports 2026-01-28 15:01:35 -05:00
Paul Lorenz 2ffc6e1151 Update ziti version to 2.0 2026-01-28 12:34:10 -05:00
Paul Lorenz ffe6e16b76 Separate raft command submission limiting from in-flight limiting. Fix some create terminator error handling. Fixes #3318 2025-12-03 17:01:28 -05:00
Paul Lorenz 653063767e Add alert events. Fixes #3264 2025-10-15 14:21:07 -04:00
Paul Lorenz 9d4ff055b5 Update for SDK flow control changes 2025-07-18 12:42:45 -04:00
Paul Lorenz b21db0faa1 Implement circuit validation API and CLI. Fixes #3098 2025-06-16 13:57:42 -04:00
Paul Lorenz e647d67325 Update to channel/v4 2025-04-02 15:28:59 -04:00
Paul Lorenz ec57c80ff7 ER/T Hosting HA chaos test and fixes (#2806)
* Add ERT hosting chaos test. Also add ert terminator validation utility. Fixes #2288

* Rework ER/T terminator management based on SDK terminator management code

* Update deps

* Make sdk/ert-terminators into a constant
2025-02-25 17:02:21 -05:00
Paul Lorenz 110446a990 Add doc generator for events. Add event doc. Fixes #2593 2025-01-31 12:23:43 -05:00
Paul Lorenz a4d66f863b Switch router storage to serialized protobuf, rather than json 2025-01-07 19:23:06 -05:00
Paul Lorenz 29a199ce12 Add router data model chaos test. Fixes #2550 2025-01-07 19:21:53 -05:00
Paul Lorenz c2162ea9a9 Add cluster id, to prevent merging disparate clusters. Fixes #2541 2024-11-14 12:34:17 -05:00
Paul Lorenz cccf0c06af Update to channel/v3. Fixes #2390 2024-09-09 12:23:25 -04:00
Paul Lorenz 77d27ca781 Enhance the router data model with config information, fixes #2010 Add subscription model to router data model, fixes #1990 2024-07-17 14:31:39 -04:00
Paul Lorenz c3b43133d1 Merge fabric and controller model code. Fixes #2205 2024-07-09 16:11:01 -04:00
Paul Lorenz fab81e4cd4 Add terminator chaos testing and fix issues found. Fixes #1794 Fixes #1369 2024-03-12 10:31:36 -04:00
Paul Lorenz 41a37ebe7e Add initial router link validation utility. Fixes #1678 2024-01-05 13:10:02 -05:00
Mario Trangoni 126ee5d79c codespell: Add spelling check and fix all issues
Signed-off-by: Mario Trangoni <mjtrangoni@gmail.com>
2023-12-19 10:52:42 +01:00
Paul Lorenz db6554ee06 Implement idempotency for sdk terminators. Fixes #1446 2023-12-01 15:44:05 -05:00
Paul Lorenz f3d67b7f49 Update fabric imports 2023-09-28 23:34:28 -04:00
Paul Lorenz 509364d908 Remove trace events from dispatcher. Move trace to common 2023-08-16 12:39:42 -04:00
Paul Lorenz cdfd037da9 Move protobuf definitions to common 2023-08-10 19:38:48 -04:00
Paul Lorenz 368d6e5568 Move config, ctrl_msg and handler_common to common/ 2023-08-10 17:29:08 -04:00
Paul Lorenz 8dbc759d45 move event and events packages to controller 2023-08-10 17:10:17 -04:00
Paul Lorenz 820e6391a4 Add heartbeat config and controller peer heartbeats. Fixes openziti/fabric#507
Adds config to controller for heartbeat config
Add config to routers for heartbeat config
Adds configurable heartbeats to controller <-> controller connections
2023-02-28 09:47:53 -05:00
Paul Lorenz 26f5af9d47 Support streaming all events to websocket. Remove stream metrics and cicuits. Fixes openziti/fabric#563 2022-12-20 09:36:15 -05:00
Paul Lorenz 7caa06c6a3 Add new usage type to metrics stream 2022-12-15 12:21:59 -05:00
Paul Lorenz 4a1f234839 Add linter and update deps 2022-10-10 13:29:40 -04:00
Paul Lorenz 519574497e Update to channel v2 2022-09-26 17:00:34 -04:00
Paul Lorenz 9aa41409b3 Cleanup trace controller loop. Refactor for multiple control channels: openziti/fabric#469 2022-09-22 11:05:35 -04:00
Paul Lorenz 4d05c59df0 Run gofmt -w -s 2022-08-22 14:17:43 -04:00
Paul Lorenz 77bce93e85 Refactor events subsystem. Add link events. Fixes openziti/fabric#415
Previously we often had two sets of events, one in the network
package, and then another in the events package. We now only
have one, in the events package. Events now have a public API,
 with minimal deps. There's an implementation package which has
the dependencies. This allows the network package to generate
events, without have a circular dependency on the events
implementation package.
2022-07-15 18:31:52 -04:00
Paul Lorenz 3d49022f4a Update for foundation changes 2022-07-01 14:29:12 -04:00
Paul Lorenz b26fcf8909 Fix copyright 2022-06-29 16:59:46 -04:00
Paul Lorenz 630378121a Remove management channel 2022-06-29 16:07:10 -04:00
Paul Lorenz a731cd9aec Circuit failed events and rename terminator identity -> instanceId 2022-06-22 14:34:32 -04:00
Cam Otts 45d49324c6 move terminator address to seperate field (#412)
* move terminator address to seperate field

* update circuit streaming to handle dedicated terminator address field

* Added circuit event terminator local address
2022-06-09 11:11:44 -05:00
Paul Lorenz a64c626cb4 Controller -> Manager for entity managers 2022-06-02 22:53:22 -04:00
Paul Lorenz 8dfdce7fab Update to current protobuf library 2022-05-10 14:54:00 -04:00
Paul Lorenz e21d41df05 Notify controller of invalid destinations in routes.
Allow xgress and links to be destinguished by ID suffix
If a link destination is missing, send a link fault
Add forget-link router debug agent op to allow testing invalid
destinations
2022-04-26 22:16:58 -04:00
Paul Lorenz e2d29d3f07 Rework model for circuit inspections. Add inspect support back to mgmt channel 2022-04-19 10:38:23 -04:00
Cam Otts 4b7a4d1081 added circuit creation timespan (#349)
* added circuit creation timespan

* added creation timespan to event message
2022-04-06 11:14:43 -05:00