/monitor-dslogon

A service for monitoring dslogon

Primary LanguageJavaScriptMIT LicenseMIT

styled with prettier PRs Welcome MIT License

Overview

This is a high level browser automated program for monitoring DSLogon for uptime.

Setup for development

  • Instructions to install NodeJS version manager, nvm.

  • Install nodejs version 8 or above by running:

    • nvm install 8 or nvm install 10
    • nvm use 8 or nvm use 10.
  • Git clone the code: git clone git@github.com:fartbagxp/monitor-dslogon.git.

  • Install all third party libraries: npm install.

    • This includes a headless Chrome browser for Puppeteer.
  • Copy .env.sample to .env: cp .env.sample .env.

  • Fill out the environment variables in the .env file.

Editor Choice

I use vs-code with a prettier extension.

How it works

Puppeteer is a NodeJS library which provides a high level API to automate Google Chrome. By simulating Chrome, we have the full ability of viewing a particular user's experience when logging in.

How to run

# Simple Test run with screenshots saved to debug folder.
npm run start-dev

# Simulate a production run
npm start

# Running tests
npm test

Verification on whether DSLogon is up or down

  1. We take screenshots and validate the HTML provided to ensure that end users experience are what we expect them to be.

    • You can try this by running npm run start-dev, and the resulting screenshot and HTML will appear in the debug folder.
  2. We also verify the HTML for correctness, by verifying certain key terms such as logged in, to verify that the user has been logged in properly.

  3. We should verify that all HTTP request calls were completely properly, and that no error was captured in the Chrome console.

TODO

  1. Password failure, need to check all HTTPS error codes for various submission requests.
  2. Connection Reset on DSLogon page. Will end at 6.
  3. Outage means redirection from ID.me will hang forever at 6. From going directly through DSLogon, it'll give you a 500 http status code.
  4. 60 login time through DSLogon is around the right time.
  5. Error 60 gives back 200 HTTP status code.