Commit graph

74 commits

Author SHA1 Message Date
Abhishek K
c02ec193db
NET-1920: Add disconnected node status (#3300)
* create peer ack table

* add restricted status

* add disconnected status
2025-01-28 11:26:12 +05:30
abhishek9686
5b49872d5d fix update acl policy 2024-09-26 21:00:04 +04:00
abhishek9686
e258f12ecb set Acl DB crud 2024-09-24 19:09:15 +04:00
abhishek9686
d64f098181 Tag CRUD APIs 2024-09-17 19:34:45 +04:00
Abhishek K
2e8d95e80e
NET-1227: User Mgmt V2 (#3055)
* user mgmt models

* define user roles

* define models for new user mgmt and groups

* oauth debug log

* initialize user role after db conn

* print oauth token in debug log

* user roles CRUD apis

* user groups CRUD Apis

* additional api checks

* add additional scopes

* add additional scopes url

* add additional scopes url

* rm additional scopes url

* setup middlleware permission checks

* integrate permission check into middleware

* integrate permission check into middleware

* check for headers for subjects

* refactor user role models

* refactor user groups models

* add new user to pending user via RAC login

* untracked

* allow multiple groups for an user

* change json tag

* add debug headers

* refer network controls form roles, add debug headers

* refer network controls form roles, add debug headers

* replace auth checks, add network id to role model

* nodes handler

* migration funcs

* invoke sync users migration func

* add debug logs

* comment middleware

* fix get all nodes api

* add debug logs

* fix middleware error nil check

* add new func to get username from jwt

* fix jwt parsing

* abort on error

* allow multiple network roles

* allow multiple network roles

* add migration func

* return err if jwt parsing fails

* set global check to true when accessing user apis

* set netid for acls api calls

* set netid for acls api calls

* update role and groups routes

* add validation checks

* add invite flow apis and magic links

* add invited user via oauth signup automatically

* create invited user on oauth signup, with groups in the invite

* add group validation for user invite

* update create user handler with new role mgmt

* add validation checks

* create user invites tables

* add error logging for email invite

* fix invite singup url

* debug log

* get query params from url

* get query params from url

* add query escape

* debug log

* debug log

* fix user signup via invite api

* set admin field for backward compatbility

* use new role id for user apis

* deprecate use of old admin fields

* deprecate usage of old user fields

* add user role as service user if empty

* setup email sender

* delete invite after user singup

* add plaform user role

* redirect on invite verification link

* fix invite redirect

* temporary redirect

* fix invite redirect

* point invite link to frontend

* fix query params lookup

* add resend support, configure email interface types

* fix groups and user creation

* validate user groups, add check for metrics api in middleware

* add invite url to invite model

* migrate rac apis to new user mgmt

* handle network nodes

* add platform user to default role

* fix user role migration

* add default on rag creation and cleanup after deletion

* fix rac apis

* change to invite code param

* filter nodes and hosts based on user network access

* extend create user group req to accomodate users

* filter network based on user access

* format oauth error

* move user roles and groups

* fix get user v1 api

* move user mgmt func to pro

* add user auth type to user model

* fix roles init

* remove platform role from group object

* list only platform roles

* add network roles to invite req

* create default groups and roles

* fix middleware for global access

* create default role

* fix nodes filter with global network roles

* block selfupdate of groups and network roles

* delete netID if net roles are empty

* validate user roles nd groups on update

* set extclient permission scope when rag vpn access is set

* allow deletion of roles and groups

* replace _ with - in role naming convention

* fix failover middleware mgmt

* format oauth templates

* fetch route temaplate

* return err if user wrong login type

* check user groups on rac apis

* fix rac apis

* fix resp msg

* add validation checks for admin invite

* return oauth type

* format group err msg

* fix html tag

* clean up default groups

* create default rag role

* add UI name to roles

* remove default net group from user when deleted

* reorder migration funcs

* fix duplicacy of hosts

* check old field for migration

* from pro to ce make all secondary users admins

* from pro to ce make all secondary users admins

* revert: from pro to ce make all secondary users admins

* make sure downgrades work

* fix pending users approval

* fix duplicate hosts

* fix duplicate hosts entries

* fix cache reference issue

* feat: configure FRONTEND_URL during installation

* disable user vpn access when network roles are modified

* rm vpn acces when roles or groups are deleted

* add http to frontend url

* revert crypto version

* downgrade crytpo version

* add platform id check on user invites

---------

Co-authored-by: the_aceix <aceixsmartx@gmail.com>
2024-08-20 17:08:56 +05:30
Abhishek K
0d4552db5e
NET-1064: Oauth User SignUp Approval Flow (#2874)
* add pending users api

* insert user to pending users on first time oauth login

* add pending user check on headless login

* fix conflicting apis

* no records error

* add allowed emails domains for oauth singup to config

* check if user is allowed to signup
2024-04-03 11:20:19 +05:30
Seongbin Hong
ea235a5d3f
Merge branch 'develop' into bugfix_v0.22.0_bump-gorqlite-to-a8a425b1a6aa 2024-01-25 20:25:45 +09:00
VertexToEdge
f7118d6cf7 Bump github.com/rqlite/gorqlite from v0.0.0-20210514125552-08ff1e76b22f to v0.0.0-20240122221808-a8a425b1a6aa 2024-01-24 20:54:22 +09:00
abhishek9686
6749fb4516 add trial license logic 2024-01-19 14:51:51 +05:30
0xdcarns
2e6eaac274 moved data structure to db 2023-03-03 14:23:51 -05:00
0xdcarns
a5e7147b69 initial commit, began unit tests 2023-02-14 17:21:51 -05:00
0xdcarns
d6b1fb4b17 added rwmutex to db calls 2023-02-09 19:30:59 -05:00
0xdcarns
7a2c225eb1 added mq and database connected funcs and endpoint 2023-02-06 12:09:21 -05:00
0xdcarns
cc529ab3bd finished initial crud for hosts, fixed stun server close bug 2022-12-19 14:55:24 -05:00
0xdcarns
88cd0a6497 initial commit 2022-09-13 15:25:56 -04:00
0xdcarns
de91533372 added better state management to make OAuth sign-ins HA 2022-08-04 10:03:39 -04:00
afeiszli
b281047168 adding functions to handle certs in DB 2022-06-30 21:56:11 -04:00
Matthew R. Kasun
2c00f96a71 remove unused function 2022-06-27 10:35:34 -04:00
0xdcarns
5e327fdea4 set max open conns to 1 for sqlite 2022-03-21 09:14:04 -04:00
0xdcarns
9d0d3ea732 added mutex for sqlite 2022-03-15 22:37:30 -04:00
0xdcarns
6061ccec76 began ACL implementation 2022-03-10 14:55:40 -05:00
afeiszli
1c06cfc8f7 modified getpeers for hub network 2022-02-18 11:43:49 -05:00
0xdcarns
ad79f2ea1f addresses review comments 2022-01-29 18:18:46 -05:00
0xdcarns
95b9444325 log cleanup 2022-01-29 18:18:46 -05:00
0xdcarns
410efbab50 switched to eliptical strategy 2022-01-29 18:18:46 -05:00
0xdcarns
3dadb8dcbf added e.. 2022-01-29 18:18:46 -05:00
0xdcarns
aa22afeb95 tracking mod 2022-01-29 18:18:46 -05:00
0xdcarns
ac632a75b7 refactored struct 2022-01-29 18:18:46 -05:00
0xdcarns
3483e45beb added struct to model 2022-01-29 18:18:46 -05:00
0xdcarns
c40c905b3b edited chunk size 2022-01-29 18:18:46 -05:00
0xdcarns
c748594c02 data adapt 2022-01-29 18:18:46 -05:00
0xdcarns
90fcddb588 log add 2022-01-29 18:18:46 -05:00
0xdcarns
2b5c5afeb4 remove some logs 2022-01-29 18:18:46 -05:00
0xdcarns
fb69d54f24 change key size 2022-01-29 18:18:46 -05:00
0xdcarns
48d6d57f25 trying again 2022-01-29 18:18:46 -05:00
0xdcarns
50c95f66cb node debug 2022-01-29 18:18:46 -05:00
0xdcarns
7be2b0e09d adjusted to byte buffer 2022-01-29 18:18:46 -05:00
0xdcarns
d27dee0691 debugging 2022-01-29 18:18:46 -05:00
0xdcarns
0015d6fdf8 added encryption/decryption strategy 2022-01-29 18:18:46 -05:00
0xdcarns
7846420fa7 added timer hooks 2022-01-25 11:00:56 -05:00
afeiszli
aa4baa5503 fixing minor things for code review 2022-01-23 09:39:48 -05:00
afeiszli
e3e239ab84 adding code review changes 2022-01-22 10:12:33 -05:00
afeiszli
351a2ac5a8 switch time to 24 hour checkins 2022-01-21 14:16:28 -05:00
afeiszli
4d2a85f879 adding telemetry 2022-01-20 17:50:42 -05:00
0xdcarns
e45a485bce added comments, optimized memory 2021-12-10 15:01:10 -05:00
afeiszli
932712619a remade server logs 2021-12-06 15:31:08 -05:00
afeiszli
ccbd6f90f7 fixing windows 2021-11-17 21:57:27 -05:00
0xdcarns
7939e5968f good first draft, fixed test 2021-10-21 20:32:23 -04:00
0xdcarns
4e4e8b3ab5 began oauth implementation 2021-10-21 15:28:58 -04:00
0xdcarns
454a44b85b reverted, new permissions on db 2021-10-20 11:00:35 -04:00