https://github.com/drewmoore/aws_api_gateway_jwt_local
https://github.com/drewmoore/aws_api_gateway_jwt_local
Last synced: 27 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/drewmoore/aws_api_gateway_jwt_local
- Owner: drewmoore
- License: mit
- Created: 2024-03-11T17:26:55.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-11T18:00:53.000Z (over 2 years ago)
- Last Synced: 2025-01-16T15:37:01.018Z (over 1 year ago)
- Language: Ruby
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This is a development tool that allows for you to send requests through an AWS API Gateway to your locally running app. Authentication occurs using jwt openid auth, also running an openid server locally.
This assumes to be running in a subfolder of another project. The host project is assumed to use docker compose, and the name of your main app's service is assumed to be `my-app` (not a perfect drop-in for any project, I'll admit). Your app's main service and this add-on use an external network named `my_app`.
## Getting Started
Install ngrok and create free account. Store the api key in the `.env.ngrok` file:
```sh
cp .env.ngrok.example .env.ngrok
```
Follow the instructions for setting up your environment for terraform in [./infra](./infra/README.md)
To run the app and manage the infrastucture, run:
```sh
make
```
Then you can generate a jwt for authentication with the API Gateway:
```sh
make jwt
```
Use this in the header `Authorization: Bearer TOKEN`
Tip: you can use [jwt.io](https://jwt.io) to inspect tokens
To just run the app:
```sh
make app
```
Or if you just need to apply the infrastructure configuration:
```sh
make apply_infra
```
To teardown the local app but not the cloud infrastructure:
```sh
make teardown_app
```
To teardown the cloud infrastructure:
```sh
make teardown_infra
```