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 terraform-hashicups-provider #4

Open im2nguyen opened 4 years ago

im2nguyen commented 4 years ago

The API should have the following functionality for the terraform-hashicups-provider. The terraform-hashicups-provider will be modeled after the terraform-provider-dominos and be used to teach practitioners how to create new Terraform providers and hack existing providers.

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 /signup

POST /signin

POST /orders - needs auth

GET /orders - needs auth

GET /orders/{id} - needs auth

PUT /orders/{id} - needs auth

DELETE /orders/{id} - needs auth