Commit Graph

102 Commits

Author SHA1 Message Date
Andrew Martinez b562fb5c07 splits API specs into composible modules
- splits Open API 2.0 (swagger) into client/management APIs
- uses go-swaggers flatten capabilities
- uses newer version of go-swagger (v0.27.0)
- introduces /edge/client/v1, /edge/management/v1
- non-prefixed URLs default to /edge/client/v1
- splits some shared management/client API handlers
- renames some REST models to "client" instead of "limited"
- passes all apitests, fails dataflow upd test (main fails this as well)
- updates generate rest script for powershell
- todo: test generate rest script for bash
- todo: use xweb (different branch)
2021-05-04 11:30:32 -04:00
Paul Lorenz 57da48f142 Move terminator validation from xtv to control channel handler 2021-04-29 13:46:54 -04:00
Andrew Martinez 4a9b226f0e adds the ability for router to extend their enrollment
- routers can now opt to extend their enrollment at any time with a
  previous or new key
- adds tests for router enrollment
- adds tests for router enrollment extension
2021-04-14 09:21:59 -04:00
Andrew Martinez 3014bdc405 new tests, don't prune policies w/ no checks 2021-03-24 14:06:09 -04:00
Andrew Martinez 1100d6f388 update service update on posture data change, tests 2021-03-23 09:54:47 -04:00
Paul Lorenz 680852f80e Allow tunnel to run over xgress directly 2021-03-22 14:33:54 -04:00
Andrew Martinez c54a007202 formalize posture data API output, add service request errors
- GET /identity/{id}/posture-data is now formalized in the swagger.yml
- posture data output now includes the last 100 failed service requests
  with temporal posture data state
- added ziti controller instance id header to detect restarts
- add GET /identity/{id}/failed-service-requests
2021-03-19 09:49:44 -04:00
Andrew Martinez 623681db87 add lastActivityAt
- as updates to API Sessions can now happen later than the last time
  they were active, updatedAt is no longer the correct representation of
  the last activity an API Session had
- move all logic that used updatedAt to lastActivityAt
- add migration to set lastActivityAt
2021-03-17 13:49:12 -04:00
Andrew Martinez 5841f6fa70 use batch for api access last updates 2021-03-15 11:14:45 -04:00
Andrew Martinez 219c19c8e7 fix map passed by reference in shallow struct copy 2021-03-08 15:58:57 -05:00
Andrew Martinez fff256487c status to state in broker 2021-03-08 15:04:51 -05:00
Andrew Martinez 90ca54adb8 adds thread safe router state
Router state used to be stored and accessed in a thread unsafe way.
State is now locks on a mutex for setting values and values are copied
out for referencing.
2021-03-08 14:55:36 -05:00
Paul Lorenz 735eb1d80f Move ApiError and FieldError to foundation 2021-03-03 14:44:26 -05:00
Andrew Martinez b784577f36 add new error state for router sync, move defers to catch router info 2021-02-19 20:58:53 -05:00
Andrew Martinez 4afc0bd0b6 fix dupe connection testing by looking at strat stat not network state 2021-02-19 11:18:09 -05:00
Andrew Martinez a51cf270f2 ignore duplicate connecting routers, do not dereference er hostnames
hostnames may be a nil pointer at times now due to the fact that edge
routers may be waiting to sync and may be "online" but edge hellos
have not been exchanged.
2021-02-19 10:19:26 -05:00
Paul Lorenz 155bbd8217 Validate sessions on controller instead of edge router 2021-02-17 20:38:13 -05:00
Andrew Martinez d76fcbc168 merge stops in instant strat, add broker stop to shutdown 2021-02-15 13:39:07 -05:00
Andrew Martinez a8f1b8b79a moves sync strat/state to headers 2021-02-15 13:22:07 -05:00
Andrew Martinez d07618c9d5 modular edge router sync
- edge router sync is now modular and can have different strategies
- plans to make this configurabe in the future with multiple strat
- legacy strategy is called "instant" and is the only option
- instant strat now supports control signaling and resync requests
- edge routers now do not remove connections till after a full sync
- added the ability for the controller to report the er sync status
- added er syn status to GET /edge-routers list and detail
- improved log output in sync logic
2021-02-15 13:22:07 -05:00
Andrew Martinez 2c1a9dd82b ignores dupe router startup
A second edge router starting up could offline the original according to
the edge. This would cause issues w/ API Session and Session
distribution.
2021-02-10 10:58:50 -05:00
Curt Tudor 2c6814aaa4 edge router enhancements for browZer support (#499) 2021-02-04 06:09:46 -05:00
Andrew Martinez df1f2a1a75 fixes #497 send session header
- add server headers during HTTP handler delegation rather than at HTTP
  response time
- remove all old header setting locations
- remove unused status writer and other response code
- add manual set on authentication for session headers
2021-02-01 14:28:29 -05:00
Paul Lorenz f485d4e8c3 Update service poller to use service update callback 2021-01-29 15:32:51 -05:00
Andrew Martinez 308d7f3a10 mfa initial
- add mfa read endpoints
- add mfa enroll enpoints
- fix mfa library timing issues
- adds mfa at tests
- adds admin mfa management endpoints
- adds admin mfa at tests
- improve at tests
- fix auth check vs auth query
- fix swagger for auth queryies
- fix swagger doc
- adds more api tests for validation
- redo auth query structure
- redo mfa endpoints
- move mfa verify to authenticate router:wq
- add recovery code support and tests
- add partial session authentication status
2021-01-19 08:36:27 -05:00
Andrew Martinez 65be49c609 Add appId and appVersion to sdkInfo 2021-01-18 10:38:43 -05:00
Paul Lorenz c370dff45c Notify clients to refresh after restart 2021-01-15 16:20:13 -05:00
Paul Lorenz 2194d8a2e2 Implement service change notifications 2021-01-15 15:28:59 -05:00
Andrew Martinez a3789c063a adds support of API Session Certificates
- adds ability for any authenticated API Session to create ephemeral
 certificates
- allows UPDB session connection
- adds create/delete/read of current api session certificates
- add session cert pem result on create and detail
- fixes ER not updating sessions with new certs from API session
- fixes naming of session vs apiSession on members, functions, etc
- organizes ER state manager functions into apiSession vs session
- adds api session ids to api sessions and sessions sent from the
  controller to ERs
- ensure api and ns fingerprints are the same
- filter api session certs by valid periods
- clarify fingerprint func naming
2021-01-06 09:42:57 -05:00
Andrew Martinez c726f158d6 fixes #365 adds hasApiSession and hasEdgeRouterConnection 2020-10-20 15:00:22 -04:00
Andrew Martinez 3bbff3a01a support version info from fabric 2020-10-07 07:25:14 -04:00
Paul Lorenz 50bc204dd5 Add edge terminator validator 2020-09-29 09:27:05 -04:00
Paul Lorenz 50c6b3e4b3 Support identity dial/bind 2020-09-29 09:27:03 -04:00
Paul Lorenz 734e9a5542 Fix service policy migration. Update for terminator precendence changes. Log panic stacks. Fixes GH-291 2020-09-03 10:22:27 -04:00
Andrew Martinez a97fbd1ffa remove session delete sync
Turns out this is important for high availability reworked probe and sdk
to deal with it as it was.
2020-08-26 13:35:03 -04:00
Andrew Martinez 006995db6c use fabric event system for session lifecycle 2020-08-25 13:15:47 -04:00
Andrew Martinez f92b88e395 Merge branch 'master' into stream.sessions.276 2020-08-24 08:40:29 -04:00
Andrew M faec4b95ba various fixes for API streaming and data net support
- http requests should hard timeout w/ a reasonable response
- edge routers should close when an API session token is not provided or
  does not match
- stream both types of sessions on edge router connect
- stream sessions for time out processing/deletion
- add id to session messages (edge control pb update, breaks backwards
  compat)
2020-08-24 08:31:45 -04:00
Paul Lorenz c179f87538 Improve session create performance. Closes GH-281 2020-08-20 12:35:04 -04:00
Paul Lorenz e2ad712948 Add edge session events API. Closes GH-229 2020-08-11 14:00:57 -04:00
Andrew M e39c21b6a1 e2e support fixes #173
- adds edge level edge_transport xgress
- adds service encyrptionRequired flag (rest API, protobuffs)
- adds edge router encryption checks
2020-07-27 16:18:46 -04:00
Paul Lorenz 8e7f096b22 Fix hello timeout by making it fully async. Fixes GH-248 2020-07-20 17:31:16 -04:00
Andrew M f76e2a1c55 remove old embedded files
- old postgres files
- packr migration adapter struct
- remove packr and sql migration deps
2020-07-09 14:58:40 -04:00
Andrew M 1242a1b950 fixes #240
- adds spec router
- updates swagger to allow for both JSON and YAML spec bodies
- pulls spec from generated rest server
2020-07-09 09:29:09 -04:00
Andrew M 6182beeffa rename text producer
- text producer is now pem producer only
- remove ability to render errors in pem producer
- update tests
- fix accept header processing for multiple accepts in one header
2020-07-07 11:44:40 -04:00
Andrew M 923b182b85 fixes #233 return API errors as JSON if possible 2020-07-01 15:54:20 -04:00
Andrew M 5ddefc25c2 Merge branch 'master' into use.shortids 2020-06-17 17:24:24 -04:00
Paul Lorenz 64ce3a92df move edge routers under fabric routers. Fixes GH-144 2020-06-17 16:36:14 -04:00
Andrew M 6571dbd72c use shortids 2020-06-16 17:33:45 -04:00
Andrew M 7d34b9eadf set base path to /edge/v1
- reroute API requests for the root to edge/v1 (i.e. / -> /edge/v1
- fix pagination empty values being omitted
2020-06-16 12:15:35 -04:00