Skip to content
This repository has been archived by the owner on May 27, 2021. It is now read-only.

Add VPN availability to state #297

Closed
mythmon opened this issue Jul 10, 2018 · 0 comments
Closed

Add VPN availability to state #297

mythmon opened this issue Jul 10, 2018 · 0 comments
Assignees

Comments

@mythmon
Copy link
Contributor

mythmon commented Jul 10, 2018

If a user doesn't have VPN access to Normandy Admin, Delivery Console should fall back to using the read only public Normandy API. In order to do this, we need to detect if the VPN is available. This issue covers detecting this, and putting it in the state. It doesn't cover automatically routing requests to different backends.

@mythmon mythmon self-assigned this Jul 10, 2018
bors bot added a commit that referenced this issue Jul 31, 2018
302: Detect if VPN is connected and Normandy Admin is available r=rehandalal a=mythmon

* Added a new state subtree, `network`.
* Move the `requests` state subtree to `network.requests`
* Added `network.availability` state, with a subkey `normandyAdmin`
* Make a canary request to Normandy Admin at startup, and mark it as unavailable if that fails
* Show this data in the header as a warning icon with a tooltip

Currently, the admin's availability is only checked at startup, and requires a refresh to update. In the future we could be smarter and do ongoing checks, including responding to failed requests to the admin. For now I think checking at startup is good enough. I looked into automatically detecting network changes, but [that API isn't available in Firefox](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation#Browser_compatibility).

There might be some things that could be done better with the state handling, specifically around the handling of the pending state. It works ok now, but if we scale to other backend servers that may or may not be available, we might want a richer state than just a boolean.

I expect the UI here to be temporary, so I didn't put a lot of work into it. It is visible enough if you look for it, and I hope that soon we'll have a automatic fallback, so a big scary warning won't be needed.

Fixes #297.

Co-authored-by: Mike Cooper <mythmon@gmail.com>
bors bot added a commit that referenced this issue Jul 31, 2018
302: Detect if VPN is connected and Normandy Admin is available r=rehandalal a=mythmon

* Added a new state subtree, `network`.
* Move the `requests` state subtree to `network.requests`
* Added `network.availability` state, with a subkey `normandyAdmin`
* Make a canary request to Normandy Admin at startup, and mark it as unavailable if that fails
* Show this data in the header as a warning icon with a tooltip

Currently, the admin's availability is only checked at startup, and requires a refresh to update. In the future we could be smarter and do ongoing checks, including responding to failed requests to the admin. For now I think checking at startup is good enough. I looked into automatically detecting network changes, but [that API isn't available in Firefox](https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation#Browser_compatibility).

There might be some things that could be done better with the state handling, specifically around the handling of the pending state. It works ok now, but if we scale to other backend servers that may or may not be available, we might want a richer state than just a boolean.

I expect the UI here to be temporary, so I didn't put a lot of work into it. It is visible enough if you look for it, and I hope that soon we'll have a automatic fallback, so a big scary warning won't be needed.

Fixes #297.

Co-authored-by: Mike Cooper <mythmon@gmail.com>
@bors bors bot closed this as completed in #302 Jul 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants