This repository provides examples of the Threat Stack v2 API. The examples center on setting up Hawk authentication.
All sample projects require the same environment variables to be set:
TS_USER_ID- User id of the api key holderTS_API_KEY- API key for the user specified by TS_USER_IDTS_ORGANIZATION_ID- Organization id of the organization to access
Install Python 3 to run the python example.
To install dependencies, run pip:
pip install -r requirements.txtRun the following python command using the environment variables:
TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x python3 example.pyDisclaimer: Ruby's HAWK implementation is no longer maintained. You may want to consider a different language.
Examples have been removed, but leaving a signpost here for readers.
Before you can install the dependencies, you must install Java and Maven 3.
To install dependencies, run mvn:
mvn compileRun the following mvn command using the environment variables:
TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x mvn exec:javaBefore you can install the dependencies, you must install Node and npm.
To install dependencies, run npm:
npm installRun the following node command using the environment variables:
TS_USER_ID=x TS_ORGANIZATION_ID=x TS_API_KEY=x node example.jsPlease see our Go CLI repository at threatstack/ts.