GithubHelp home page GithubHelp logo

sam-auth's Introduction

Serverless Lab -- Authenticated Orders Service

In this lab, you will be building a serverless orders service using AWS SAM. This service will receive webhooks from a delivery service, such as DoorDash or GrubHub, that indicate orders to be placed. You will store the orders in a database and provide an endpoint to check the status of a given order.

To do this, you will create two HTTP endpoints:

  • Create Order (POST /orders): An endpoint to receive webhooks from the delivery service.

  • Get Order (GET /orders/{orderId}): An endpoint to check the status of a given order using the orderId.

You will use DynamoDB to store the Order information.

Finally, you want to include authorization on the Create Order endpoint to ensure that the requests are valid orders from the delivery service. The delivery service has given you a static token that will be included in every Create Order request.

Getting started

Before walking through the steps below, create a new directory for your application.

In that directory, create a barebones template.yml file with the following contents:

AWSTemplateFormatVersion: 2010-09-09
Description: >-
  sam-auth

Transform:
  - AWS::Serverless-2016-10-31

Steps:

This lab is comprised of five steps. Each step has instructions in a sub-directory, as well as the final code for that step.

The steps are:

  1. Add the CreateOrder endpoint
  2. Add the GetOrder endpoint
  3. Add a simple authorization check
  4. Use Parameter Store to hold secrets
  5. Use a custom authorizer in API Gateway

sam-auth's People

Contributors

alexdebrie avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.