netbird/management/server/http
Bethuel Mmbaga acb73bd64a
[management] Remove redundant get account calls in GetAccountFromToken (#2615)
* refactor access control middleware and user access by JWT groups

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor jwt groups extractor

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor handlers to get account when necessary

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor getAccountFromToken

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor getAccountWithAuthorizationClaims

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix merge

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* revert handles change

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* remove GetUserByID from account manager

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix tests

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor getAccountWithAuthorizationClaims to return account id

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor handlers to use GetAccountIDFromToken

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix tests

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* remove locks

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* refactor

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* add GetGroupByName from store

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* add GetGroupByID from store and refactor

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* Refactor retrieval of policy and posture checks

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* Refactor user permissions and retrieves PAT

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* Refactor route, setupkey, nameserver and dns to get record(s) from store

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* Refactor store

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix lint

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix tests

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix add missing policy source posture checks

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* add store lock

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* fix tests

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

* add get account

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>

---------

Signed-off-by: bcmmbaga <bethuelmbaga12@gmail.com>
2024-09-27 17:10:50 +03:00
..
api [misc] Fix ip range posture check example (#2628) 2024-09-23 10:02:03 +02:00
middleware Add context to throughout the project and update logging (#2209) 2024-07-03 11:33:02 +02:00
util Add context to throughout the project and update logging (#2209) 2024-07-03 11:33:02 +02:00
accounts_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
accounts_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
dns_settings_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
dns_settings_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
events_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
events_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
geolocation_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
geolocations_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
groups_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
groups_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
handler.go [management] Add accessible peers endpoint (#2579) 2024-09-12 16:19:27 +03:00
nameservers_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
nameservers_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
pat_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
pat_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
peers_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
peers_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
policies_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
policies_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
posture_checks_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
posture_checks_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
routes_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
routes_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
setupkeys_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
setupkeys_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
users_handler_test.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00
users_handler.go [management] Remove redundant get account calls in GetAccountFromToken (#2615) 2024-09-27 17:10:50 +03:00