Code Monkey home page Code Monkey logo

apisecurityinaction's Introduction

API Security in Action

This repository contains source code that accompanies the book API Security in Action, written by Neil Madden and published by Manning Publications in November 2020. Please see Manning's website for information on purchasing a copy, or its available from Amazon and other retailers.

Note: there is no source code on the main branch. You need to check out the branch for the chapter you are reading.

The git repo is organized with a separate branch for each chapter, starting with Chapter 2. Actually there are two branches per chapter. The branches called "chapter02", "chapter03" etc will give you the source code as needed for starting out on the given chapter. The branches named "chapter02-end", "chapter03-end" etc give the final source code after all the alterations in that chapter. Typically the source code at the end of a chapter is also identical to the start of the next chapter.

I strongly recommend working through the code listings from the book.

The source code can also be downloaded as a zip file from Manning's website.

Prerequisites

The following are needed to run the code examples:

  • Java 11 or later. See https://adoptopenjdk.net for installers.
  • A recent version of Apache Maven - I use 3.6.1.
  • For testing, curl. On Mac OS X you should install a version of curl linked against OpenSSL rather than Secure Transport, otherwise you may need to adjust the examples in the book.
  • I highly recommend installing mkcert for working with SSL certificates from chapter 3 onwards.

The API server for each chapter can be started using the command

mvn clean compile exec:java

This will start the Spark/Jetty server running on port 4567. See chapter descriptions for HTTP requests that can be used.

Chapter 10 and onwards have more detailed requirements to run the sample code. Please consult the book for exact instructions.

Postman

I've created a Postman collection to help you perform operations using the API developed during the book as an alternative to curl. You can import the collection from this url: https://www.postman.com/collections/ef49c7f5cba0737ecdfd

Chapters

Chapter 2 - Secure API development

Chapter 3 - Securing the Natter API

Chapter 4 - Session cookie authentication

Chapter 5 - Modern token-based authentication

Chapter 6 - Self-contained tokens and JWTs

Chapter 7 - OAuth 2 and OpenID Connect

Chapter 8 - Identity-based access control

Chapter 9 - Capability security and Macaroons

Chapter 10 - Microservice APIs in Kubernetes

Chapter 11 - Securing service to service APIs

Chapter 12 - Securing IoT communications

Chapter 13 - Securing IoT APIs

apisecurityinaction's People

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.