2021-08-15 16:56:26 +02:00
|
|
|
package client
|
|
|
|
|
|
|
|
import (
|
2022-02-08 18:03:27 +01:00
|
|
|
"io"
|
|
|
|
|
2022-03-26 12:08:54 +01:00
|
|
|
"github.com/netbirdio/netbird/client/system"
|
|
|
|
"github.com/netbirdio/netbird/management/proto"
|
2021-08-15 16:56:26 +02:00
|
|
|
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
|
|
|
|
)
|
|
|
|
|
2022-01-18 16:44:58 +01:00
|
|
|
type Client interface {
|
|
|
|
io.Closer
|
|
|
|
Sync(msgHandler func(msg *proto.SyncResponse) error) error
|
|
|
|
GetServerPublicKey() (*wgtypes.Key, error)
|
2022-06-23 17:04:53 +02:00
|
|
|
Register(serverKey wgtypes.Key, setupKey string, jwtToken string, sysInfo *system.Info, sshKey []byte) (*proto.LoginResponse, error)
|
|
|
|
Login(serverKey wgtypes.Key, sysInfo *system.Info, sshKey []byte) (*proto.LoginResponse, error)
|
2022-05-08 11:04:57 +02:00
|
|
|
GetDeviceAuthorizationFlow(serverKey wgtypes.Key) (*proto.DeviceAuthorizationFlow, error)
|
2023-07-27 11:31:07 +02:00
|
|
|
GetPKCEAuthorizationFlow(serverKey wgtypes.Key) (*proto.PKCEAuthorizationFlow, error)
|
2023-06-12 14:43:55 +02:00
|
|
|
GetNetworkMap() (*proto.NetworkMap, error)
|
2021-08-15 16:56:26 +02:00
|
|
|
}
|