hashicorp-demoapp / product-api-go

Products API written in Go
Mozilla Public License 2.0
42 stars 26 forks source link

Define API endpoints for packer-plugin-hashicups #14

Closed sylviamoss closed 3 years ago

sylviamoss commented 3 years ago

The API should have the following functionality for the packer-plugins-hashicups. The packer-plugins-hashicups will be used to teach practitioners how to create new Packer plugins and hack existing providers.

The plugins' main idea is to create customized coffees with different ingredient quantities from the ones available in the "menu". For example a Packer Spiced Latte with 50ml of espresso instead of 40ml.

JWT Token

Any endpoint that needs auth must have this header: Authorization: Bearer <token>. It will be a JWT token containing the user_id, username, and the token expiration date.

Endpoints

POST /coffees - needs auth

POST /coffees/{id:[0-9]+}/ingredients - needs auth