Closed nxtcoder36 closed 1 week ago
This pull request implements changes to improve device management, enhance security, and optimize the logout process. The main changes include adding device labels for better identification, implementing a local device deletion on logout, and refining SSH connection checks.
sequenceDiagram
participant apic as apiClient
participant fc as FileClient
participant kl as Kloudlite
participant user as User
apic->>fc: GetWGConfig()
fc-->>apic: wgconfig
apic->>apic: GetCurrentUser()
apic-->>user: user
apic->>kl: klFetch("cli_createGlobalVPNDevice", {...})
kl-->>apic: respData
apic->>apic: Process respData
sequenceDiagram
participant fc as FileClient
participant os as OperatingSystem
fc->>os: Stat(vpnConfigPath)
alt vpnConfigPath exists
fc->>os: RemoveAll(vpnConfigPath)
os-->>fc: success or error
end
fc->>os: Remove(sessionFile)
os-->>fc: success or error
classDiagram
class apiClient {
+CreateDevice(devName, displayName, team string) *Device
+CreateVpnForTeam(team string) *Device
+GetAccVPNConfig(team string) *fileclient.TeamVpnConfig
+ListVpnDevices(team string) []Device
+GetClustersOfTeam(team string) []Cluster
}
class Device {
+Metadata: map[string]any
}
class User {
+UserId: string
}
apiClient --> Device
apiClient --> User
classDiagram
class fclient {
+Logout() error
}
Change | Details | Files |
---|---|---|
Added device labels for better identification and management |
|
domain/apiclient/device.go |
Implemented local device deletion on logout |
|
domain/fileclient/auth.go |
Added functionality to list VPN devices |
|
domain/apiclient/device.go |
Updated cluster listing functionality |
|
domain/apiclient/k3s-local.go |
Modified SSH connection check |
|
pkg/sshclient/ssh.go |
Summary by Sourcery
Enhance device creation by adding metadata labels for local UUID and ownership, and implement a method to list VPN devices with filtering. Simplify the logout process by removing the VPN configuration directory. Comment out the spinner update message in the SSH connection check function.
Bug Fixes:
Enhancements:
Chores: