* revert inet gws from acl policies
* add egress range with metric for inet gw
* link pro inet funcs
* fix extclient comms with users
* remove TODO comments
* add backwards compatibility to egress ranges
* remove all resources check
* remove device policy check on pro
* fix egress policies for users groups
* add default forwarding rule for inet gw
* revert inet gws from acl policies
* add egress range with metric for inet gw
* link pro inet funcs
* fix extclient comms with users
* remove TODO comments
* move relevant acl and tag code to CE and Pro pkgs
* intialise pro acl funcs
* list gateways by user access
* check user gw access by policies
* filter out user policies on CE
* filter out tagged policies on CE
* fix ce acl comms
* allow gateways tag
* allow gateway tag on CE, remove failover and gw check on acl policy
* add gw rules func to pro
* add inet gw support on CE
* add egress acl API
* add egress acl API
* fix(go): set is_gw when converting api node to server node;
* fix(go): set is_gw when converting api node to server node;
* fix policy validity checker for inet gws
* move dns option to host model
* fix node removal from egress policy on delete
* add migration logic for ManageDNS
* fix dns json field
* fix nil error on node tags
* add egress info to relayed nodes
* fix default network user policy
* fix egress migration
* fix egress migration
* add failover inet gw check
* optiomise egress calls
* auto create gw on inet egress node
* optimise egress calls
* add global user role check
* fix egress on inet gw
* remove addtional checks on inet policy
* add acl policy for static nodes on CE
* remove chained inet gws
* fix multi-inet issue
---------
Co-authored-by: Vishal Dalwadi <dalwadivishal26@gmail.com>
* move relevant acl and tag code to CE and Pro pkgs
* intialise pro acl funcs
* list gateways by user access
* check user gw access by policies
* filter out user policies on CE
* filter out tagged policies on CE
* fix ce acl comms
* allow gateways tag
* allow gateway tag on CE, remove failover and gw check on acl policy
* add gw rules func to pro
* add inet gw support on CE
* add egress acl API
* add egress acl API
* fix(go): set is_gw when converting api node to server node;
* fix(go): set is_gw when converting api node to server node;
* fix policy validity checker for inet gws
* move dns option to host model
* fix node removal from egress policy on delete
* add migration logic for ManageDNS
* fix dns json field
* fix nil error on node tags
* add egress info to relayed nodes
* fix default network user policy
* fix egress migration
* fix egress migration
* add failover inet gw check
* optiomise egress calls
* auto create gw on inet egress node
* optimise egress calls
* add global user role check
* fix egress on inet gw
* remove addtional checks on inet policy
---------
Co-authored-by: Vishal Dalwadi <dalwadivishal26@gmail.com>
* move relevant acl and tag code to CE and Pro pkgs
* intialise pro acl funcs
* list gateways by user access
* check user gw access by policies
* filter out user policies on CE
* filter out tagged policies on CE
* fix ce acl comms
* allow gateways tag
* allow gateway tag on CE, remove failover and gw check on acl policy
* add gw rules func to pro
* add inet gw support on CE
* add egress acl API
* add egress acl API
* fix(go): set is_gw when converting api node to server node;
* fix(go): set is_gw when converting api node to server node;
* fix policy validity checker for inet gws
* move dns option to host model
* fix node removal from egress policy on delete
* add migration logic for ManageDNS
* fix dns json field
* fix nil error on node tags
* add egress info to relayed nodes
---------
Co-authored-by: Vishal Dalwadi <dalwadivishal26@gmail.com>
* feat: api access tokens
* revoke all user tokens
* redefine access token api routes, add auto egress option to enrollment keys
* add server settings apis, add db table for settigs
* handle server settings updates
* switch to using settings from DB
* fix sever settings migration
* revet force migration for settings
* fix server settings database write
* egress model
* fix revoked tokens to be unauthorized
* update egress model
* remove unused functions
* convert access token to sql schema
* switch access token to sql schema
* fix merge conflicts
* fix server settings types
* bypass basic auth setting for super admin
* add TODO comment
* setup api handlers for egress revamp
* use single DB, fix update nat boolean field
* extend validaiton checks for egress ranges
* add migration to convert to new egress model
* fix panic interface conversion
* publish peer update on settings update
* revoke token generated by an user
* add user token creation restriction by user role
* add forbidden check for access token creation
* revoke user token when group or role is changed
* add default group to admin users on update
* chore(go): import style changes from migration branch;
1. Singular file names for table schema.
2. No table name method.
3. Use .Model instead of .Table.
4. No unnecessary tagging.
* remove nat check on egress gateway request
* Revert "remove nat check on egress gateway request"
This reverts commit 0aff12a189.
* remove nat check on egress gateway request
* feat(go): add db middleware;
* feat(go): restore method;
* feat(go): add user access token schema;
* add inet gw status to egress model
* fetch node ids in the tag, add inet gw info clients
* add inet gw info to node from egress list
* add migration logic internet gws
* create default acl policies
* add egress info
* add egress TODO
* add egress TODO
* fix user auth api:
* add reference id to acl policy
* add egress response from DB
* publish peer update on egress changes
* re initalise oauth and email config
* set verbosity
* normalise cidr on egress req
* add egress id to acl group
* change acls to use egress id
* resolve merge conflicts
* fix egress reference errors
* move egress model to schema
* add api context to DB
* sync auto update settings with hosts
* sync auto update settings with hosts
* check acl for egress node
* check for egress policy in the acl dst groups
* fix acl rules for egress policies with new models
* add status to egress model
* fix inet node func
* mask secret and convert jwt duration to minutes
* enable egress policies on creation
* convert jwt duration to minutes
* add relevant ranges to inet egress
* skip non active egress routes
* resolve merge conflicts
* fix static check
* update gorm tag for primary key on egress model
* create user policies for egress resources
* resolve merge conflicts
* get egress info on failover apis, add egress src validation for inet gws
* add additional validation checks on egress req
* add additional validation checks on egress req
* skip all resources for inet policy
* delete associated egress acl policies
* fix failover of inetclient
* avoid setting inet client asd inet gw
* fix all resource egress policy
* fix inet gw egress rule
* check for node egress on relay req
* fix egress acl rules comms
* add new field for egress info on node
* check acl policy in failover ctx
* avoid default host to be set as inet client
* fix relayed egress node
* add valid error messaging for egress validate func
* return if inet default host
* jump port detection to 51821
* check host ports on pull
* check user access gws via acls
* add validation check for default host and failover for inet clients
* add error messaging for acl policy check
* fix inet gw status
* ignore failover req for peer using inet gw
* check for allowed egress ranges for a peer
* add egress routes to static nodes by access
* avoid setting failvoer as inet client
* fix egress error messaging
* fix extclients egress comms
* fix inet gw acting as inet client
* return formatted error on update acl validation
* add default route for static nodes on inetclient
* check relay node acting as inetclient
* move inet node info to separate field, fix all resouces policy
* remove debug logs
---------
Co-authored-by: Vishal Dalwadi <dalwadivishal26@gmail.com>
* add peerkey to network egress routes model
* add peerkey to network egress routes model
* filter out conflicting routes from node
* add support for egress HA on relay
* add support for egress HA on relay
* add support for egress HA on relay
* skip if curr node is relay node of the peer
* skip if curr node is relay node of the peer
* fix failover egress HA
* add network to egress route model
* clone before modifying
* check for user policies on uni direction check
* add all network fwd rule
* delete all network policies and tags on network deletion
* add peerkey to network egress routes model
* add peerkey to network egress routes model
* filter out conflicting routes from node
* add support for egress HA on relay
* add support for egress HA on relay
* add support for egress HA on relay
* skip if curr node is relay node of the peer
* skip if curr node is relay node of the peer
* fix failover egress HA
* add network to egress route model
* clone before modifying
* check for user policies on uni direction check
* add all network fwd rule
* add peerkey to network egress routes model
* add peerkey to network egress routes model
* filter out conflicting routes from node
* add support for egress HA on relay
* add support for egress HA on relay
* add support for egress HA on relay
* skip if curr node is relay node of the peer
* skip if curr node is relay node of the peer
* fix failover egress HA
* add network to egress route model
* clone before modifying
* check for user policies on uni direction check
* add support for egress ranges on acl policy
* add egress ranges to acl rules
* add egress ranges to acl policies
* Add egress ranges to acl rules
* add egress ranges to fw update
* fetch acl rules for egress networks
* apply egress policies for devices
* configure user policies for egresss routes
* fix gw tag name migration
* fix egress acl rules for static nodes
* add egress ranges for static nodes on ingress gw
* fileter acl IPs to be unique
* cleanup IOT logic from peer update
* make acl Rule Dst List
* cleanup egress ranges from acl policies
* create user group default acl policy for gateways
* remove remote access name ids
* rm egress ranges removal from acl policies
* simplify user permissions on nodes
* add additional nameservers to extclient dns
* remove debug logs
* fix static checks