Commit graph

43 commits

Author SHA1 Message Date
Max Ma b59658024c
add enable/disable failover in nmctl command (#2857) 2024-03-20 15:12:42 +07:00
Aceix b8c1dde152
fix(NET-1044): use new update acls endpoint (#2842)
allow for updating both node and client acls
2024-03-05 18:02:27 +07:00
Aceix 8aa185d880
feat(NET-678): add saas support to nmctl (#2687)
* feat(NET-678): add saas support to nmctl

* fix(NET-678): fix context endpoint for sso
2023-12-13 14:04:09 +04:00
Matthew R Kasun 823182cf09
add force flag to host/node delete (#2548)
* add force flag to host/node delete

* review comments

---------

Co-authored-by: Abhishek K <32607604+abhishek9686@users.noreply.github.com>
2023-09-13 10:10:17 +05:30
Matthew R Kasun 1e2fae0652
remove node uncordon (#2549) 2023-09-11 09:48:42 +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
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
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
Matthew R Kasun 78640f1342
Extclient NET-63x (#2286)
* model changes

* additional fields for extclient create

* add DNS to extclient config

* extclient name checks

* update extclient

* nmctl extclient

* final tweaks

* review comments

* add extclientdns to node on ingress creation

* fix to add ingress dns to api (#2296)

---------

Co-authored-by: Aceix <aceixsmartX@gmail.com>
2023-05-17 10:58:03 -04:00
Matthew R Kasun 7d8aeb66c1 correct api path 2023-04-13 17:36:27 -04:00
Matthew R Kasun 12004aa09a refactor key updates on host basis vice node 2023-04-13 16:08:39 -04:00
0xdcarns 0b7df753f7 removed references to AccessKey model 2023-03-13 16:02:44 -04:00
Anish Mukherjee c5311c0cd5 add enrollment key to nmctl 2023-03-02 17:40:31 +05:30
Anish Mukherjee 6a03947384 update host network modification endpoints 2023-02-14 17:25:22 +05:30
Anish Mukherjee 02ba1ce6ae move relay logic to hosts 2023-01-24 16:00:12 +05:30
Anish Mukherjee f04828f1d4 update node models to ApiNode 2023-01-16 10:32:26 +05:30
Anish Mukherjee 8b5eb0cbd4 add host endpoints to cli 2023-01-05 18:53:12 +05:30
Anish Mukherjee fd21d960fc minor refactor 2023-01-02 16:06:14 +05:30
Anish Mukherjee 93fdf359b3 add callback for headless sso 2023-01-02 14:48:39 +05:30
Anish Mukherjee 289bb3e5ec add headless sso login 2023-01-02 13:18:40 +05:30
Anish Mukherjee 9f2def1808 add master_key check on JWT refresh 2022-12-09 20:56:43 +05:30
Anish Mukherjee 98e60edb19 retry only once for refreshing JWT 2022-12-09 19:55:27 +05:30
Anish Mukherjee 94dc0d9c8a add a simple get request function 2022-12-08 19:04:23 +05:30
Anish Mukherjee b2d0a6dfe9 use cached JWT token and refresh on expiry 2022-12-08 18:53:57 +05:30
Anish Mukherjee 87f560f0ac add function comment 2022-12-08 18:07:45 +05:30
Anish Mukherjee a98a116bf7 add network users subcommand 2022-11-29 19:23:39 +05:30
Anish Mukherjee 683fe7abb1 add metrics and usergroup subcommands 2022-11-28 19:27:17 +05:30
Anish Mukherjee d999f7b86e add comments to exported functions 2022-11-28 18:16:56 +05:30
Anish Mukherjee da2d143e39 add user subcommand 2022-11-28 18:16:56 +05:30
Anish Mukherjee db014c93bd add external client config fetch subcommand 2022-11-28 18:16:56 +05:30
Anish Mukherjee b58040b9b8 add user create and list 2022-11-28 18:16:56 +05:30
Anish Mukherjee 7004c8dd3e add ext_client create, get, delete and list commands 2022-11-28 18:16:56 +05:30
Anish Mukherjee 9466124cf2 add logs and server info retrieval functionalities 2022-11-28 18:16:56 +05:30
Anish Mukherjee 2e0b4726c9 add delete and push dns subcommands 2022-11-28 18:16:56 +05:30
Anish Mukherjee f8d65e2a80 minor refactor 2022-11-28 18:16:56 +05:30
Anish Mukherjee d9c9d29d33 add node management 2022-11-28 18:16:56 +05:30
Anish Mukherjee b5c9fe4e40 add ACL management 2022-11-28 18:16:56 +05:30
Anish Mukherjee c1f652487c fix delete key endpoint 2022-11-28 18:16:56 +05:30
Anish Mukherjee aab92ce88d add access key subcommand 2022-11-28 18:16:56 +05:30
Anish Mukherjee dddfab263c implement network delete and update node_limit 2022-11-28 18:16:56 +05:30
Anish Mukherjee 6a493b951a add network create,get and list 2022-11-28 18:16:56 +05:30
Anish Mukherjee fa9b7643cb add config management commands 2022-11-28 18:16:56 +05:30