Skip to content

pga03/first-discovery-native-host

Repository files navigation

first-discovery-native-host

####About This native messaging host is responsible for writing GPII user tokens generated by the First Discovery Tool to the USB drive. The First Discovery Tool sends messages to this Chrome native messaging host via a Chrome extension, and this host in turn creates two files:

  1. .gpii-user-token.txt - contains the user's token
  2. .first-discovery-preferences.txt - contains the user's preference set in JSON

This repository is not useful by itself. It should be used with its companion browser extension and a first discovery server:

  1. https://github.com/pga03/extension-chrome-windows
  2. https://github.com/pga03/first-discovery-server

####Messaging background

See these links for additional information on Chrome's messaging capabilities:

  1. https://developer.chrome.com/extensions/messaging
  2. https://developer.chrome.com/extensions/nativeMessaging

####Installation

  1. Install the Chrome extension (https://github.com/pga03/extension-chrome-windows) and obtain the Chrome extension ID (it can occasionally change when installed in development mode). You will use this extension ID in step 3.
  2. Download this repository and unzip if necessary.
  3. Add your Chrome extension id obtained in step 1 to the allowed_origins array in the com.ibm.firstdiscovery.json file.
  4. Run install-host.bat as an administrator.
What does the installation process do?
  1. Creates a folder at C:\Program Files (x86)\First-Discovery-Chrome-Extension
  2. Copies the downloaded contents of this repository to it
  3. Sets a registry setting so Chrome can find the native messaging host

Note: The install removes any previous versions and registry keys, and can be re-run without first uninstalling.

#####Dependencies

  1. Python 2.7.x is installed and available on the PATH (https://www.python.org/downloads/windows/)
  2. This is intended to run on Windows 7
  3. Chrome

####Uninstall

  1. Run C:\Program Files (x86)\First-Discovery-Chrome-Extension\uninstall-host.bat as an administrator
What does the uninstall process do?
  1. Deletes C:\Program Files (x86)\First-Discovery-Chrome-Extension
  2. Deletes the registry setting created by the install

####Configuration

#####Logging Logging is disabled by default. Edit python-host and set isLogging to True if desired. Logs are written to C:\Program Files (x86)\First-Discovery-Chrome-Extension

#####USB Drive Path This assumes a USB key will be mounted at the E:\ drive. Edit python-host and set usbDriveLetter as needed. You might need to edit this if you have additional disc drives, disks, or network drives mapped on your machine.

NOTE: If the native host isn't given a valid USB drive, it will revert to using the first available drive it can find (searching alphabetically starting at D:\)

#####Registry setting The registry entry used is located at HKCU\Software\Google\Chrome\NativeMessagingHosts

####Testing Run python python-host test to run tests. Output and results will be in the terminal window

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published