go-lambda-authorizer

command module
v0.0.0-...-8fe3675 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

README

A simple lambda authorizer written in go with dynamodb as backend.

This repo seprates code based upon branches , ref branches for specific implementation

Architechure

Branch: SimpleAndFast

Overview how authorizer connects with api gateway

alt text

Flow diagram

alt text

Prerequisite

  1. To setup aws lambda and CI/CD we use sam, please download it from https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/install-sam-cli.html

Branch Main: Go code is seprated into seprate directories and also introduces support for multiple db by using a interface based approach Also provides a methods to create custom authorizers

Branch SimpleAndFast: Single minimal function tightly integrated with aws dynamodb and apigateway You can fork the repo and create your custom logic suitable for your needs Expects minimal input as env variables Create Zip:

        ```bash

        GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -ldflags="-s -w" -o bootstrap -tags lambda.norpc
        zip myFunction.zip bootstrap    

        ```

To Use sam template (remember to change <region> to your region and <accountId> to your accountId in template.yaml )

```bash
    sam build && sam deploy --guide
```
fill the details and it will create lambda and role for you
now you can connect it as authorizer in your api gateway

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL