Skip to content

jrazmi/pykc-lambda-dyn-auth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lambda, Python, DyanmoDB - Authentication Service

NOTE: Not Production Checked

Setup your virtualenv

Install: Flask, Zappa

$(venv) pip install flask zappa

Run your app and make sure local host is returning hello world.

$(venv) python app.py

Chapter 01 - Initializing Zappa

$ git checkout ch-01

Make sure you have your aws account/creds setup

$(venv) zappa init

Follow the setup instructions.

$(venv) zappa deploy

Assuming no errors zappa will give you a amazon api endpoint. Verify that your hello world app is up and running!

Chapter 02 - Boto3 and DynamoDB

$ git checkout ch-02

Checkout boto3 docs.

boto3 is a dependency of zappa and automatically installed if you are using it outside of zappa just $ pip install boto3 where you need it

Create a dynamoDB table in your AWS console.

Create a new item in your table.

Make sure your email endpoint is working locally. $(venv) zappa update

Chapter 03 - Lambda Packages and Registration

$ git checkout ch-03

There are a number of python packages that need to be pre-compiled in order to run on Lambda. Our friend Misserlou, creator of zappa, created an external lambda-packages python repo.

$(venv) pip install -r requirements.txt

Review the register app route in app.py

Test it locally with the bash scripts in cmds.

$(venv) zappa update

Chapter 04 - JWTs and Password hashing.

$(venv) git checkout ch-04 $(venv) pip install -r requirements.txt

Review the login endpoint.

Test it locally

Update Zappa!

Chapter 05 - Protected Routes

$(venv) git checkout ch-05

Review the auth required decorator

Login with credentials and then use the token to GET request the auth checkpoint

Deploy

Chapter 06 - Invoking other functions

$(venv) git checkout ch-06 Note the authorizer function where we updated the token to be stored in Flask's g variable.

Review the execute route.

Deploy!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published