Commit Graph

97 Commits

Author SHA1 Message Date
Farukh Khan
99adc96f72 NET-698 (#2671)
* create emqx creds for host on pull if not found

* create emqx creds for host on pull if not found.

* emqx creds creation changed to host authenticate function

* emqx creds creation changed to host authenticate function.

* added node acls update

* added node acls update.
2023-11-27 13:54:21 +04:00
Abhishek K
27378b9c52 NET-765: publish deleted node update on disconnect (#2668)
* publish deleted node update on disconnect

* delete any daemon node

* set peer update for disconnected Node

* set peer update for disconnected Node
2023-11-15 19:53:52 +04:00
Abhishek K
7169db78ea NET-717: DNS Fixes (#2654)
* send dns with complete entry name

* publish dns records on adding host to network from UI

* publish node dns updates when host is removed
2023-11-08 17:43:41 +04:00
Abhishek K
916694b2cf NET-664: Local Connections improvements (#2651)
* deprecate endpoint detection form config

* add peer network info to pull
2023-11-01 20:37:43 +04:00
Abhishek K
7a9dc3458f NET-667: force delete daemon node (#2645)
* force delete zombie node

* return correct resp

* fix zombie hosts processing

* add nil check rather checking error

* pr comments
2023-10-31 14:34:28 +04:00
Abhishek K
eb3ba2879c Peerupdate bug (#2620)
* update static,mtu from client side host update

* update host fields if host exists already on registration

* add additional logging
2023-10-11 15:24:41 +04:00
Matthew R Kasun
876778a1cc open api spec file (#2595)
* remove usergroup

* superadmin

* superadmin creation

* generate openapi spec file

* statticcheck

* review comments
2023-10-04 10:26:38 +04:00
Gabriel de Souza Seibel
23ad85bd8c Add handler that sends MQ msg to upgrade a host (#2582) 2023-10-02 10:37:31 +04:00
Matthew R Kasun
83f2f2ef28 publish node update on ifcace change (#2600) 2023-09-28 14:28:19 +04:00
Abhishek K
166e619f82 NET-602: delete ext clients when ingress node is removed from network (#2554)
* add superadmin role, apis to create superadmin user

* apis to attach and remove user from remote access gateways

* add api to list user's remote client has gateway clients

* remove code related user groups

* remove networks and groups from user model

* refactor user CRUD operations

* fix network permission test

* add superadmin to authorize func

* remove user network and groups from cli

* api to transfer superadmin role

* add api to list users on a ingress gw

* restrict user access to resources on server

* deny request from remote access client if extclient is already created

* fix user tests

* fix static checks

* fix static checks

* add limits to extclient create handler

* set username to superadmin on if masterkey is used

* allow creation of extclients using masterkey

* add migration func to assign superadmin role for existing admin user

* check for superadmin on migration if users are present

* allowe masterkey to extcleint apis

* check ownerid

* format error, on jwt token verification failure return unauthorized rather than forbidden

* user update fix

* move user remote functionality to ee

* fix update user api

* security patch

* initalise ee user handlers

* allow user to use master key to update any user

* use slog

* fix auth user test

* table headers

* remove user role, it's covered in middleware

* setuser defaults fix

* if ingress node is deleted, cleanup gateway clients

* delete ext clients in a go routine

* remove response writer from go routine
2023-09-05 20:37:11 +05:30
Abhishek K
719e0c254d NET-551: User Mgmt Re-Design (#2547)
* add superadmin role, apis to create superadmin user

* apis to attach and remove user from remote access gateways

* add api to list user's remote client has gateway clients

* remove code related user groups

* remove networks and groups from user model

* refactor user CRUD operations

* fix network permission test

* add superadmin to authorize func

* remove user network and groups from cli

* api to transfer superadmin role

* add api to list users on a ingress gw

* restrict user access to resources on server

* deny request from remote access client if extclient is already created

* fix user tests

* fix static checks

* fix static checks

* add limits to extclient create handler

* set username to superadmin on if masterkey is used

* allow creation of extclients using masterkey

* add migration func to assign superadmin role for existing admin user

* check for superadmin on migration if users are present

* allowe masterkey to extcleint apis

* check ownerid

* format error, on jwt token verification failure return unauthorized rather than forbidden

* user update fix

* move user remote functionality to ee

* fix update user api

* security patch

* initalise ee user handlers

* allow user to use master key to update any user

* use slog

* fix auth user test

* table headers

* remove user role, it's covered in middleware

* setuser defaults fix
2023-09-01 14:27:08 +05:30
Gabriel de Souza Seibel
1a1ba1ccf4 [NET-546] Move ee code to ee package, unify ee status and terminology (#2538)
* Move ee code to ee package and unify ee status to IsPro

* Consolidate naming for paid/professional/enterprise version as "pro". Notes:

- Changes image tags
- Changes build tags
- Changes package names
- Doesn't change links to docs that mention "ee"
- Doesn't change parameters sent to PostHog that mention "ee"

* Revert docker image tag being -pro, back to -ee

* Revert go build tag being pro, back to ee

* Add build tags for some ee content

* [2] Revert go build tag being pro, back to ee

* Fix test workflow

* Add a json tag to be backwards compatible with frontend "IsEE" check

* Add a json tag for the serverconfig struct for IsEE

* Ammend json tag to Is_EE

* fix ee tags

---------

Co-authored-by: Abhishek Kondur <abhi281342@gmail.com>
2023-09-01 07:42:05 +05:30
Matthew R Kasun
a629ac352e use controller.Authorizse() middleware for host delete endpoint (#2536)
Co-authored-by: Abhishek K <32607604+abhishek9686@users.noreply.github.com>
2023-08-28 16:58:17 +05:30
Farukh Khan
a9a8596d71 NET-507 (#2506)
* NET-507

* Fixed server restart changing the node expiration date to the defaults.

* Removed expired nodes removal from zombie cleanup routine.

* Added a new expired nodes deletion routine which removes expired nodes every hour.

* NET-507 suggested changes

* Possible fix for zombie nodes upon node deletion from the UI.

* Suggested changes implemented for expired nodes deletion go routine.

* NET-507 typo fix

* typo fix for DeleteNode purge parameter
2023-08-10 20:27:44 +05:30
Aceix
596cc7a945 feat(NET-449): add sync feature to request a host pull from server (#2491) 2023-08-04 13:22:47 +05:30
Abhishek K
7121f370c6 NET-427: Peer Update fixes (#2445)
* send delete peer update always

* fix add/remove host api calls

* keep mq updates in a single go func
2023-07-11 13:00:09 +05:30
Aceix
68b8d7f600 fix(NET-117): force delete hosts and assoc nodes (#2432) 2023-07-10 10:03:59 +00:00
Aceix
b212ae32d1 fix(NET-380): add option to force delete nodes (#2436) 2023-07-10 10:03:47 +00:00
Abhishek Kondur
086ef25ac6 remove peer update context 2023-06-29 00:17:42 +05:30
Abhishek Kondur
4efbe6256f stop context cancel on peer updates 2023-06-28 21:05:21 +05:30
Abhishek Kondur
27ac920069 cache acls 2023-06-27 16:12:06 +05:30
Abhishek K
6c2582651c Net-137: Node relays (#2401)
* revert relays

* initial relay commit

* get relayed allowed ips

* add more relay validation checks, peer logic cleanup

* rm relayed nodes from relay node when relayed node is deleted

* fix egress updates for relayed nodes

* rm unused func

* remove  debug logs

* avoid adding egress ranges on the relayed gw node

---------

Co-authored-by: Matthew R Kasun <mkasun@nusak.ca>
2023-06-19 12:26:14 -04:00
Abhishek K
78e26c4673 add nodes to pull response (#2371) 2023-06-06 22:16:21 -04:00
Matthew R Kasun
9af380fd3b remove node check from getHosts (#2359) 2023-05-31 17:06:14 -04:00
Tobias Cudnik
f62eab1d18 Ignore stale nodes instead of 500 (#2357) 2023-05-31 19:19:12 +05:30
Tobias Cudnik
723375b334 NET-152 enrollment keys for non admins (#2346)
* return 401 instead of 403

* fixed http.StatusForbidden

* Tagged build version (temp)

* Unauthorized_Err when applicable

* untagged version

* fixed PUT /api/users/networks/user1

* - expired token redirs to login
- added `/api/enrollment_keys` for non-admins
- unit test for enrollment keys for non-admins

* handle user perms in `/hosts`

* removed debug

* misc

* - support masteradmin
- return hosts with partial access

* added `ismaster` to middleware
2023-05-31 13:11:54 +05:30
Alex Feiszli
8688e29db9 Merge pull request #2246 from gravitl/NET-35
NET-35: retrieve server public traffic key on pull
2023-05-02 17:01:21 -04:00
Abhishek Kondur
d12e4ecabf set server traffic pub key in pull resp 2023-04-29 17:23:57 +05:30
Abhishek Kondur
75df40be9f fix conflict change 2023-04-26 13:37:07 +04:00
Abhishek Kondur
d0646392b3 merge conflicts resolved 2023-04-25 11:15:35 +04:00
Abhishek Kondur
9e0038f39c merge conflicts resolved 2023-04-25 11:12:22 +04:00
Matthew R Kasun
c510846444 Merge branch 'develop' into GRA-1529-key-update 2023-04-19 13:16:09 -04:00
dcarns
700147e3ca Merge pull request #2171 from walkerwmanuel/GRA-1336-sort-before-sending
GRA-1336: sort before sending
2023-04-19 13:08:08 -04:00
Matthew R Kasun
754ab44a48 Merge remote-tracking branch 'origin/develop' into GRA-1529-key-update 2023-04-19 09:48:04 -04:00
Abhishek Kondur
433b61417b merge conflicts resolved 2023-04-19 13:23:06 +04:00
0xdcarns
18c9bcc58f adapted sso to host registration 2023-04-17 22:23:17 -04:00
Matthew R Kasun
cd89b4abef remove old peer when publickey updated 2023-04-17 18:20:09 -04:00
Matthew R Kasun
63552891ee refactor key updates on host basis vice node 2023-04-13 15:02:14 -04:00
Abhishek Kondur
31d5964f8a check if signal data is sufficient 2023-04-11 13:27:17 +04:00
Abhishek Kondur
726531af25 change relayendpoint type to str 2023-04-11 09:46:51 +04:00
Abhishek Kondur
be021d784e break after signalling matching host 2023-04-10 12:24:05 +04:00
Abhishek Kondur
4d223c1cdc api for signalling peer 2023-04-10 12:14:40 +04:00
walkerwmanuel
9e56135424 Added user sorting and fixed error 2023-04-03 14:36:38 -04:00
walkerwmanuel
09872e9ec5 added sort logic 2023-03-30 16:04:12 -04:00
0xdcarns
63eac1e79c added host pull model, made API 2023-03-22 15:36:53 -04:00
0xdcarns
a1f5d73a58 added request ack 2023-02-17 11:39:30 -05:00
0xdcarns
6b30cef968 handled node additions in more elegant manner 2023-02-17 11:32:02 -05:00
dcarns
92dbfa52a5 Merge pull request #2001 from gravitl/gra-1088_dns_updates
Gra 1088 dns updates
2023-02-15 12:55:58 -05:00
Matthew R Kasun
bd9cf14c02 Merge branch 'develop' into gra-1088_dns_updates 2023-02-15 06:42:09 -05:00
0xdcarns
93473a4e70 updated node topic for publishing 2023-02-14 13:00:08 -05:00