Code Monkey home page Code Monkey logo

protect-and-track's Introduction

Protect and Track Demo · Build status

Protect and Track

The Protect and Track Demo leverages the Virtru SDK for JavaScript as well as the TDF Architecture in order to secure files and share them with others, while maintaining visibility and control of your data.

This demo showcases features such as:

  • Securing a file such that only intended recipients can access its data
  • Sharing a secured file with others, using Google Drive, or Dropbox
  • Revoking access to a secured file, so users can no longer access its data

See it Live

Go here to test drive the live demo. Afterwards, check the out Virtru's Developer Hub for a step-by-step guide on how it all works.

See How it Works

To see how the Virtru SDK works within this demo look for comments with Virtru:. Specifically, you can look at:

Authorizations

Encrypt & Decrypt

  • Document.js to see how we
    • create client
    • encrypt a file
    • build a policy
    • revoke a policy
    • build a policy from an id
  • download.js
    • unwrap a TDF html file
    • decrypt an encrypted file

Policy Changes

Run it Locally

This demo can run on your local environment. Please ensure you meet the prerequisites and follow the steps.

Run Tests

  • E2E tests:

    • Make sure SAUCE_USER, SAUCE_PASS, you can find them in 1Password

    • npm run test-e2e, available environment vars:

      • any valid TEST_ENVIRONMENT_NAME, such as production, staging, or develop01
      • any valid TEST_MARKER, such as smoke and regression.
    • WARNING: due to e2e tests requires BP CRX to send secure email, it could be very slow when uploading BP CRX to SauceLabs for testing, especially when BP CRX files are large

    • automated-test-scripts-v3 is to provide BDD-based tests to make it simpler to be understood across team.

    • Benefits of using automated-test-scripts-v3:

      • Separation of concerns. tests(including the feature files and the skeleton test_xxx.py files) can now reside inside of the product repo, without the need to switch context to different repos
      • Common BDD step implementations and 3rd party integrations will be provided by automated-test-scripts-v3
      • It is possible to provide a conftest.py file in the same e2e test folder to override or define new test step implementations
      • No need to use triggered steps, test steps and test reports will be available directly in the product build pipeline.
    • TEST_ENVIRONMENT_NAME determines which URL the e2e test will run against, in BuildKite CI/CD pipelines:

      • For master/staging/develop branches, TEST_ENVIRONMENT_NAME will be set based on BUILDKITE_BRANCH accordingly
      • for other branches, TEST_ENVIRONMENT_NAME will be based on DEPLOY_ENVIRONMENT_NAME, currently only develop01 is supported, because it needs BP CRX with that environment in chrome store to be able to run the tests
    • For detailed use cases and explanations, please refer use cases section

Prerequisites

To be able to use Federated OAuth we suggest you to modify your /etc/hosts. This is an optional step, but note the fallback authentication will be email code only.

Windows

  • Install a POSIX-compatible environment such as Cygwin or Cmder
  • Install NVM
  • Edit c:\Windows\System32\Drivers\etc\hosts to include 127.0.0.1 local.virtru.com

Alternatively you could install Windows Subsystem for Linux and use the instructions below for Linux

Linux / MacOS

  • Install NVM
  • Edit /etc/hosts to include 127.0.0.1 local.virtru.com

Getting Started

# Clone the repository
$ git clone [email protected]:virtru/protect-and-track.git

# Change directory
$ cd protect-and-track

# Install node via NVM
$ nvm use

# Install node modules
$ npm ci

# Start the node server
$ sudo npm start

If running successfully, your default browser may automatically open. If not visit https://local.virtru.com.


You may be presented with a warning screen with a message similar to "Your connection is not private." This is due to the self-signed SSL certificate when running in development mode. To access the demo:

  • Chrome: Click Advanced then Proceed to local.virtru.com (unsafe)
  • Firefox: Click Advanced then Accept the Risk and Continue
  • Safari: Click Show Details then visit this website
  • Opera: Click Help me understand then Proceed to local.virtru.com (unsafe)

Getting Help

There are many ways to get our attention:

  • You can join Virtru's Developer Hub Community Slack channel to get your questions answered.
  • You can open a support ticket here.

License

Copyright © 2019 Virtru Corporation

This repository is released under the MIT license for all artifacts in this repository, with the following exceptions which are subject to our Virtru Data Protection Platform Subscription Agreement:

  • virtru-sdk

protect-and-track's People

Contributors

anelsonvirtru avatar avkvirtru avatar benlstanley avatar biscoe916 avatar codycoggins-virtru avatar dependabot[bot] avatar dmihalcik-virtru avatar ivanovspvirtru avatar jigalag avatar karthikbhat avatar krokhmaliuk-virtru avatar nnamdi101 avatar osheikhvirtru avatar patmantru avatar pnancarrow avatar ttdmayshark avatar virtru-tdewitt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

protect-and-track's Issues

No support for IE11, and Edge

Issue and Steps to Reproduce

There is no support for IE11, or Edge for 'Download'.

  1. Go through steps to encrypt a file, then
  2. Attempt to download the file

Versions

v1.1.1

Screenshots

N/A

Expected

I expect the file to download

Actual

It doesn't :)

Additional Details

Grant user input hidden after Revoke, then Reset

Issue and Steps to Reproduce

Grant user input hidden after Revoke, then Reset

Steps to reproduce:

  1. Add file
  2. Grant a user access
  3. Sign in, and protect
  4. Revoke all
  5. Reset

Versions

v1.1.1

Screenshots

Screen Shot 2019-08-06 at 5 49 14 PM

Expected

See steps to repro

Actual

See steps to repro

Additional Details

Getting surprising number of 'user rate limit' errors for sharing on google drive

Issue and Steps to Reproduce

When sharing with Google Drive, one is often met with 'user rate limit' errors.

Versions

v1.1.1

Screenshots

n/a

Expected

I expect the share to be successful

Actual

It isn't due to rate limiting.

Additional Details

We need to get the gdrive app verified. Or switch to use clientIds for one of our already verified gdrive apps.

TEST

export const getPolicy = async ({ encrypted, virtruClient }) => {
const decryptParams = new Virtru.DecryptParamsBuilder()
.withArrayBufferSource(encrypted.payload)
.build();
const uuid = await virtruClient.getPolicyId(decryptParams);
return await virtruClient.fetchPolicy(uuid);
};

Incorrect email caused UI to assume auth

Issue and Steps to Reproduce

  1. Enter an invalid email address in step 1 of auth.
  2. then click on GSuite authentication
  3. land in GSsuite auth page
  4. Hit back button to land back on the demo site
  5. Enter the same email address again in step 1 of auth.

The demo app assumes that the user is authenticated (even though the user is actually not authenticated to the backend.

Versions

v1.1.1

Screenshots

Expected

Show error message in the UI that the auth failed.

Actual

The demo app assumes that the user is authenticated (even though the user is actually not authenticated to the backend.

Additional Details

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.