Coder Social home page Coder Social logo

openthc / pipe Goto Github PK

View Code? Open in Web Editor NEW
12.0 3.0 4.0 310 KB

Common interface/API Wrapper for different cannabis compliance reporting engines ("CRE")

Home Page: https://openthc.com/pipe/

License: MIT License

PHP 87.84% HTML 2.21% Shell 6.47% CSS 3.06% Hack 0.41%
cannabis biotrack metrc leafdata mjfreeway

pipe's Introduction

OpenTHC PIPE

The PIPE is a logging proxy for multiple cannabis regulatory compliance engines. It's basically an intentional MITM for these upstream proxy.

Built before we learned about krakend.io. Also checkout openapi-cop.

Installation

  • Clone this Repo
  • Run composer update
  • Copy ./etc/cre.ini.example to ./etc/cre.ini and configure it.
  • Change owner and permissions on ./var so the web-server can read/write

Authentication

Authentication must take place with the backend compliance reporting engine ("CRE"). The authentication for pipe itself is just a passthru to the selected backend system. PIPE then maintains a session state via headers, cookie or query-string parameters. The authentication parameters are determined by the cre selection.

Supported Compliance Engines

  • BioTrackTHC ("BT") - Delaware*, Hawaii, Maine, New Mexico, North Dakota, Illinois, Puerto Rico
  • Akerna/MJ Freeway/LeafData ("LD") - Pennsylvania*, Washington*, Utah*
  • Metrc ("FM") - Alaska, California, Colorado, Massachusetts, Nevada, Oregon

BioTrack

These systems authenticate with a company, username and password

curl \
	--data 'company=123456789' \
	--data '[email protected]' \
	--data 'password=DoNotTe11!'

LeafData

These systems use a License ID and a Contact Key. This system is in use, but closed in Pennsylvania; no longer used in Washington and we don't know the status of Utah

curl \
	--data 'license=A123456' \
	--data 'license-key=SOMESEQUENCE'

Metrc

These system require a program key and contact key. The program key is given to the software provider by Metrc and is configured in cre.ini. The contact key is from the licensee, its permissions will be determined by the user which acquires it. For best results, use a key from an administrator / super-user type role.

curl \
	--data 'program-key=ABC123' \
	--data 'license-key=ZYX987'

Supported Objects

  • Plants - (BT, LD, FM)
  • Inventory Lots (BT, LD, FM)
  • Laboratory Result (BT, LD, FM)
  • Products (LD, FM)
  • Zones (aka: Areas, Rooms) - (BT, LD, FM)
  • Vehicles - BT

See Also

pipe's People

Contributors

djbusby avatar thecompanydream avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

pipe's Issues

Implement Basic Tests

Implement Tests to check the PIPE configuration, system stuff.

Implement tests to hit at least the /ping endpoint of every supported CRE.

Implement some tests to actually hit the CRE backend using either BUNK or some test keys.

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.