Commit Graph

60 Commits

Author SHA1 Message Date
Paul Lorenz 2d766accd6 Merge pull request #4147 from openziti/fix/legacy-session-accept
Accept legacy sessions and signal recovery for invalid service tokens
2026-08-13 12:07:24 -04:00
Paul Lorenz d7076430c9 Make ER/T terminator create failures diagnosable. Fixes #4193
- reports edge router policy denials with an access-denied error naming the missing policy,
  replacing the session error reused on the sessionless ER/T and create-circuit-v3 paths
- adds EdgeRouterManager.GetEdgeRouterAccess, which reports which of the two required policy
  links (identity-to-edge-router, service-to-edge-router) is absent, and removes the boolean
  IsAccessToEdgeRouterAllowed it replaces
- logs the controller's rejection on the router at warn level, since it is recoverable and
  retried by the periodic scan; the router previously discarded the error code and message
- delays a new terminator's first create attempt by a fixed 2s so config applied in quick
  succession settles before the router asks, avoiding a 2-3 minute wait for the retry scan; the
  delay is a deliberate stopgap until edge router policy visibility lands in the router data model
- propagates the controller's error code and retry hint to SDK clients on the dial paths, which
  dropped the code and left every refusal classified as unknown
- adds the retry hint header to controller error replies, grouped with the other error-reply
  headers rather than the create-circuit-v3 request headers
- notes that the sync strategy headers alias the edge namespace's 1013-1015 ids and stay
  disjoint only by message content type
- tests the per-policy denial reporting, the error code carried with and without a retry hint,
  the controller-to-SDK error code mapping at both dial relay sites, and the terminator settle
  gate
- waits for terminator establishment in the tunneler dataflow tests instead of a fixed sleep, so
  they no longer race the settle delay
- restores the tproxy multiple-lanIf and multiple-resolver changelog entries with keep markers,
  which regeneration drops because their commits reference pull requests rather than issues
2026-08-03 15:43:30 -04:00
Paul Lorenz f219e6d035 Accept legacy sessions and signal recovery for invalid service tokens. Fixes #4145
- loadFromBolt now accepts a non-JWT (legacy/durable) service session token by
  looking the session up via Session.ReadByToken and verifying it belongs to the
  api session, so a legacy client's existing session keeps working across a
  controller upgrade instead of failing as a malformed JWT
- classifies service-access token validation failures (malformed, expired, bad
  claims, mismatched api session, revoked) as InvalidSession so the client
  re-creates, while revocation-store/datastore read failures remain internalError
  so a transient controller fault does not make clients discard valid sessions
- adds a typed common.InvalidTokenError so ValidateServiceAccessToken can
  distinguish token-level failures from infrastructure failures
2026-07-23 10:53:22 -04:00
Paul Lorenz 86092a8640 Migrate to the sdk-golang v2 module path. For #3884
Bumps the sdk-golang dependency from v1 to the v2 module
(`github.com/openziti/sdk-golang/v2` at v2.0.0-pre1) and updates all
import paths. This is a no-behavior-change precursor that isolates the
dependency migration from the Connect-V2 feature work in #3884.

- Rewrites `github.com/openziti/sdk-golang/...` imports to
  `github.com/openziti/sdk-golang/v2/...` across the main and zititest
  modules.
- Pins both modules to `github.com/openziti/sdk-golang/v2 v2.0.0-pre1`.
- Adapts `edgeXgressConn.AcceptMessage` to the v2 `MsgSink` signature,
  which now takes an `edge.SdkChannel` argument.
- Replaces the removed `edge.Conn.GetRouterId()` with
  `RemoteAddr().String()` in the loop4 traffic-test logging.

For openziti/sdk-golang#936.
2026-06-23 15:43:39 -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 4df6ae564d Update package paths for newly imported storage and ziti-db-explorer packages 2026-04-16 09:18:55 -04:00
Paul Lorenz 7b4ae12c05 Add CreateCircuitV3 for RDM-authorized circuit creation. Fixes #3721
- adds CreateCircuitV3 message type and handler for routers that have
  already authorized dials locally via RDM, bypassing service session
  tokens in favor of identity ID, service ID, and pre-assigned circuit ID
- renames CreateCircuitRequest/Response to CreateCircuitV2Request/V2Response
  for clarity now that V3 exists
- adds CircuitManager.Reserve to atomically claim circuit IDs before routing,
  preventing collisions on pre-assigned IDs
- extends CreateCircuitParams with GetCircuitId so V3 can supply a
  pre-assigned circuit ID (falls back to UUID generation when empty)
- fixes IsDialableByIdentity which was incorrectly calling IsBindableByIdentity
- extracts V2 handler into its own file create_circuit_v2.go
- adds CreateCircuitV3RequestType/ResponseType (20222/20223) to edge_ctrl protobuf
- registers V3 handler in controller server
2026-03-27 14:41:28 -04:00
Andrew Martinez fb2034245d fixes openziti/ziti#3356 adds www-authenticate headers (#3561)
* fixes openziti/ziti#3356 adds www-authenticate headers

- www-authenticate headers are returned on 401s from API requests
- www-authenticate headers are returned during authentication to signal
  addtional JWT bearer tokens needed (secondary ext jwt)
- adds support for additional headers on API errors
- adds SecurityTokenCtx for centralized security header processing
  (legacy, jwt, etc.)
- adds SecurityCtx for centralized identity, auth policy, MFA handling
- refactors existing JWT authentication methods (oidc, legacy) to use
  centralized processing where possible
2026-02-24 10:01:36 -05:00
Paul Lorenz 45bf527441 Provide more error context to SDKs for terminator errors. Fixes #3524 2026-02-04 14:36:21 -05:00
Paul Lorenz 2ffc6e1151 Update ziti version to 2.0 2026-01-28 12:34:10 -05:00
Andrew Martinez bb5cc51a97 adds posture cache, instance, instance data, and event hooks (#3267)
* adds posture cache, instance, instance data, and event hooks

- reworks router security
- abstracts api session and service sessions
- use connection tracker instead of various maps
- doc
- adds service sessions as always JWTs
- addes token logging fields
- removes multiple connection tracking fields
- adds support for router specific posture data/respones
- adds support for router posture check evaluation
- defer dial/bind posture checking for legacy to controller
- fix double session event emitting
- fix session event missing id
2025-10-15 14:01:56 -04:00
Paul Lorenz 981df8269d Support xgress flow control from the SDK. Fixes #2986 2025-04-30 10:27:43 -04:00
Paul Lorenz e647d67325 Update to channel/v4 2025-04-02 15:28:59 -04:00
Andrew Martinez 78605a0955 fix #2865 remove fingerprint checks from controller (#2866)
* fix #2865 remove fingerprint checks from controller

- on their own fingerpint checking does not provide any additional
  security as the underlying certificate is not verified
- fingerprint based checking will not work with spiffeid generated
  certificates or x509 claims
- routers still support sending fingerprints for old controller support
2025-03-04 10:21:38 -05:00
Paul Lorenz 3c9861ca3b Update deps and changelog. Update for SDK changes 2025-02-10 15:35:17 -05:00
Paul Lorenz d84292cfd9 Fix tests 2025-01-07 19:22:47 -05:00
Paul Lorenz cccf0c06af Update to channel/v3. Fixes #2390 2024-09-09 12:23:25 -04:00
Paul Lorenz 0945427320 Migrated edge router tunneler code to use the router data model. Fixes #2121 2024-07-26 17:06:01 -04:00
Paul Lorenz c3b43133d1 Merge fabric and controller model code. Fixes #2205 2024-07-09 16:11:01 -04:00
Paul Lorenz a0245e5cd3 Allow ER/T to intercept services w/out sessions when in HA mode. Fixes #1942 2024-04-16 15:11:00 -04:00
Andrew Martinez 09542c7728 consolidated ha changes 2024-02-29 09:27:56 -05:00
Paul Lorenz 744ae68bbd Fix controller crash. Fixes #1736 2024-02-08 21:55:48 -05:00
Paul Lorenz 26c6263fa3 Fix terminator id race condition. Fixes #1685 2024-01-19 11:31:32 -05:00
Paul Lorenz f3d67b7f49 Update fabric imports 2023-09-28 23:34:28 -04:00
Paul Lorenz 07da3cd513 Merge remote-tracking branch 'edge/main' into merge-edge
Updated package names
Merged golangci-lint configurations
2023-09-27 16:54:53 -04:00
Paul Lorenz 5b59ae13ee Update for moved packages in fabric 2023-08-23 09:40:05 -04:00
Paul Lorenz dba0fb6f7c Move protobufs to common 2023-08-04 17:01:15 -04:00
Paul Lorenz f31f849344 Fix panic removing terminator with invalid session. Fixes #1512 2023-06-02 10:52:41 -04:00
Paul Lorenz f28722cfa6 Handle nil terminator when getting circuit tags 2023-04-27 12:16:09 -04:00
Paul Lorenz 7d6901be3d Add edge code needed for entity change events. Fixes #629 2023-04-25 22:34:02 -04:00
Paul Lorenz 43fc1e96fe Get tests running and do some cleanups 2023-04-25 13:26:19 -04:00
Paul Lorenz bd1b25f60c Update presentation layer for api changes 2023-04-25 13:26:03 -04:00
Paul Lorenz 83bca6a0ba Update for storage and fabric api changes 2023-04-25 13:26:02 -04:00
Paul Lorenz d8e50ba43e Make session edge-router check more efficient. Fixes #1418 2023-04-12 15:54:17 -04:00
Paul Lorenz fd8d41204a Fix error, should be invalid session, not invalid api session. Fixes #1366 2023-03-23 10:43:52 -04:00
Paul Lorenz 2d55b5cc28 Don't delete sessions on failed terminator create 2023-03-23 09:51:14 -04:00
Andrew Martinez e192f271ba remove old "sessionCert" (not ApiSessionCert) bit rot 2023-03-20 18:04:21 -04:00
Paul Lorenz 4abeaa0c0a xgress_edge_tunnel create terminator perf improvements. Fixes #1270
* Make terminator creation asynchronous
* Make terminator creation idempotent
* Improve logging
* Add some timer logging and metrics.
    * controller and router will both log their respective views of how long the terminator create took
    * the router has a new xgress_edge_tunnel.terminator.create_time timer metric
2022-12-15 17:29:29 -05:00
Paul Lorenz 63c161224a Add linter and fix issues found by linter 2022-10-10 16:56:51 -04:00
Paul Lorenz 32c197e5e1 Update to channel v2 2022-09-26 18:20:00 -04:00
Paul Lorenz 1f71f952d7 Update to usage v3 2022-09-16 12:41:36 -04:00
Paul Lorenz 387d54adb1 Handles changes to UpdatedFields and EntityManager. Consolidate bolt
sink/source to edgeEntity. Make patch conversion method optional
2022-07-27 11:33:37 -04:00
Paul Lorenz bae7e40b61 Update for foundation changes 2022-07-01 15:55:30 -04:00
Paul Lorenz 91ea3816b8 Update for terminator terminology changes 2022-06-22 16:24:01 -04:00
Paul Lorenz 2f6a3bc828 Update handler -> manager for base types and config 2022-06-02 00:05:54 -04:00
Paul Lorenz 7cf9dc135d Initial support for raft and command style architecture 2022-06-01 23:52:07 -04:00
Cam Otts e5d1982785 threaded timeout from fabric (#974)
* threaded timeout from fabric

* pr comments

* fix timing

* removed utc on deadline check

* small updates

* updated fabric version and add zero check to timeoutdeadline

* fix wrong fabric version

* Update deps

Co-authored-by: Cam Otts <cam@Cams-MacBook-Pro.local>
Co-authored-by: Paul Lorenz <paul.lorenz@netfoundry.io>
2022-05-13 11:11:25 -05:00
Paul Lorenz 01bea19e1f Update to use transport and storage libs. Use fabric config instead of foundation/config 2022-03-30 22:49:46 -04:00
Paul Lorenz 5be9095e60 Update to use channel library 2022-01-28 11:35:15 -05:00
Paul Lorenz 3f69bfdd43 Update for control channel API changes 2022-01-19 08:37:40 -05:00