Skip to content

Latest commit

 

History

History
42 lines (30 loc) · 918 Bytes

README.md

File metadata and controls

42 lines (30 loc) · 918 Bytes

Authenticated API for HPI

Built on top of HPI_API and setup is largely taken from seanbreckenridge's work.

If you need an in-depth guide for how HPI_API works, I suggest going to the above repo so this repo doesn't duplicate documentation.

Installation

pip install https://github.com/hpi/authenticated_hpi_api/

Running

By default, HPI_API listens on port 5050.

auth_hpi_api server -k <public key, no headers> -i <JWT issuer>

Examples

Example uses https://github.com/madelinecameron/hpi

$ curl -H "Authorization: Bearer <jwt>" http://localhost:5050/my/eightsleep/sessions
{
  "page": 1,
  "limit": 50,
  "items": [
    {
      ...
    },
  ]
}

$ curl -H "Authorization: Bearer <bad jwt>" http://localhost:5050/my/eightsleep/sessions
{
  "error": "<error message>"
}