diff options
| author | Emīls Piņķis <emils@mullvad.net> | 2019-06-25 17:29:07 +0100 |
|---|---|---|
| committer | Emīls Piņķis <emils@mullvad.net> | 2019-06-26 14:18:38 +0100 |
| commit | 5ec6e66436e9ed4dd77cafb00b0ba003ed7b9eff (patch) | |
| tree | afe703e3403e42d448eb25c9b5a80993d810af55 | |
| parent | f994f2b111fedc92c14e9644fa4c4759920da828 (diff) | |
| download | mullvadvpn-5ec6e66436e9ed4dd77cafb00b0ba003ed7b9eff.tar.xz mullvadvpn-5ec6e66436e9ed4dd77cafb00b0ba003ed7b9eff.zip | |
Support new key events in GUI
| -rw-r--r-- | gui/src/main/daemon-rpc.ts | 8 | ||||
| -rw-r--r-- | gui/src/main/index.ts | 4 | ||||
| -rw-r--r-- | gui/src/shared/daemon-rpc-types.ts | 9 |
3 files changed, 20 insertions, 1 deletions
diff --git a/gui/src/main/daemon-rpc.ts b/gui/src/main/daemon-rpc.ts index f50428ea8a..215807b2a7 100644 --- a/gui/src/main/daemon-rpc.ts +++ b/gui/src/main/daemon-rpc.ts @@ -337,6 +337,14 @@ const daemonEventSchema = oneOf( object({ relay_list: relayListSchema, }), + object({ + wireguard_key: oneOf( + enumeration('too_many_keys', 'generation_failure'), + object({ + new_key: string, + }), + ), + }), ); export class ResponseParseError extends Error { diff --git a/gui/src/main/index.ts b/gui/src/main/index.ts index 15a137dd10..b086b97d08 100644 --- a/gui/src/main/index.ts +++ b/gui/src/main/index.ts @@ -486,6 +486,10 @@ class ApplicationMain { this.setSettings(daemonEvent.settings); } else if ('relayList' in daemonEvent) { this.setRelays(daemonEvent.relayList, this.settings.relaySettings); + } else if ('wireguardKey' in daemonEvent) { + /// TODO: handle wireguard key events properly. + log.info(`Received new key event`); + log.info(daemonEvent); } }, (error: Error) => { diff --git a/gui/src/shared/daemon-rpc-types.ts b/gui/src/shared/daemon-rpc-types.ts index 32cd6c4d0f..120ef3a0b0 100644 --- a/gui/src/shared/daemon-rpc-types.ts +++ b/gui/src/shared/daemon-rpc-types.ts @@ -74,7 +74,8 @@ export interface IProxyEndpoint { export type DaemonEvent = | { stateTransition: TunnelStateTransition } | { settings: ISettings } - | { relayList: IRelayList }; + | { relayList: IRelayList } + | { wireguardKey: KeygenEvent }; export type TunnelStateTransition = | { state: 'disconnected' } @@ -278,6 +279,12 @@ export interface ISettings { bridgeState: BridgeState; } +export type KeygenEvent = INewWireguardKey | 'too_many_keys' | 'generation_failure'; + +export interface INewWireguardKey { + newKey: string; +} + export type BridgeState = 'auto' | 'on' | 'off'; export interface IBridgeConstraints { |
