Skip to content

pokt-network/pocket-aat-lambda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pocket AAT on AWS Lambda

Lambda implementation for generating Application Authentication Tokens for the Pocket Network.

Overview

This example is a starting point for building an AAT server on AWS Lambda and API Gateway.

Installation

Clone the repo locally.

Your local environment should be running node 12.15.0 to match the version available on Lambda and the version requirements of the associated libraries. For an easy way to install and switch between multiple node versions, see the easy node version switcher, N.

After cloning, change directory to the repo and edit generator.js. You must put in the public key(s) and private key necessary to generate the AAT for your application:

Put your keys here

See the Pocket-AAT-JS library for more details.

Once complete, install the packages:

npm install

If you are not running node 12.15.0 and you attempt to build, you may run into version incompatibility errors once you deploy to Lambda.

Once installed, zip it for preparation to move to Lambda:

zip -q -r /tmp/generator.zip .

Deployment

Open the AWS Console and create a new Lambda function.

Name it aatGenerator running under Node 12.x:

Create Lambda function

After the function and associated resources are created, upload the function and change the handler name on the next screen. The handler should be named generator.generateAAT:

Function editing

Once the function is saved and uploaded you can create a simple test and add a trigger with the API Gateway:

API Gateway

Note that at this point your AAT Generator is open to the world.

Security

There are multiple methods of securing the API Gateway depending on your application architecture. First, see the overview of HTTP APIs at AWS.

Documentation

For more on AATs, see the Pocket-AAT-JS repository, and the Pocket Network documentation.

Contributing

Please read CONTRIBUTING.md for details on contributions and the process of submitting pull requests.

Support & Contact

License

This project is licensed under the MIT License; see the LICENSE.md file for details.

About

Lambda function offering AAT generation

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors