netbird/client/cmd
Bethuel Mmbaga 8febab4076
Improve Client Authentication (#1135)
* shutdown the pkce server on user cancellation

* Refactor openURL to exclusively manage authentication flow instructions and browser launching

* Refactor authentication flow initialization based on client OS

The NewOAuthFlow method now first checks the operating system and if it is a non-desktop Linux, it opts for Device Code Flow. PKCEFlow is tried first and if it fails, then it falls back on Device Code Flow. If both unsuccessful, the authentication process halts and error messages have been updated to provide more helpful feedback for troubleshooting authentication errors

* Replace log-based Linux desktop check with process check

To verify if a Linux OS is running a desktop environment in the Authentication utility, the log-based method that checks the XDG_CURRENT_DESKTOP env has been replaced with a method that checks directly if either X or Wayland display server processes are running. This method is more reliable as it directly checks for the display server process rather than relying on an environment variable that may not be set in all desktop environments.

* Refactor PKCE Authorization Flow to improve server handling

* refactor check for linux running desktop environment

* Improve server shutdown handling and encapsulate handlers with new server multiplexer

The changes enhance the way the server shuts down by specifying a context with timeout of 5 seconds, adding a safeguard to ensure the server halts even on potential hanging requests. Also, the server's root handler is now encapsulated within a new ServeMux instance, to support multiple registrations of a path
2023-09-19 19:06:18 +03:00
..
down.go Revert "setting cli flags to proper commands (#860)" (#916) 2023-05-31 16:06:42 +02:00
login_test.go Rename module to netbirdio/netbird (#288) 2022-03-26 12:08:54 +01:00
login.go Improve Client Authentication (#1135) 2023-09-19 19:06:18 +03:00
root_test.go Revert preshared-key shorthand flag (#671) 2023-02-06 10:35:37 +01:00
root.go Revert "setting cli flags to proper commands (#860)" (#916) 2023-05-31 16:06:42 +02:00
service_controller.go Revert "setting cli flags to proper commands (#860)" (#916) 2023-05-31 16:06:42 +02:00
service_installer.go Revert "setting cli flags to proper commands (#860)" (#916) 2023-05-31 16:06:42 +02:00
service.go Revert "setting cli flags to proper commands (#860)" (#916) 2023-05-31 16:06:42 +02:00
ssh.go fix error codes on cli 2023-06-23 16:27:10 +02:00
status_test.go Use local time zone for display last update changes (#825) 2023-04-27 16:02:00 +02:00
status.go Update GitHub Actions and Enhance golangci-lint (#1075) 2023-09-04 17:03:44 +02:00
testutil.go Feature/ephemeral peers (#1100) 2023-09-04 11:37:39 +02:00
up_daemon_test.go Rename module to netbirdio/netbird (#288) 2022-03-26 12:08:54 +01:00
up.go Feature/permanent dns (#967) 2023-07-14 21:56:22 +02:00
version.go Add version info command to signal server (#739) 2023-03-15 07:54:51 +01:00