Coder Social home page Coder Social logo

brian-childress / lambda-hasura-abac-poc Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 5 KB

This is a simple POC for accessing a Hasura GraphQL server via API Gateway and Lambda function (AWS), leveraging ABAC to return user specific data.

Dockerfile 7.36% JavaScript 91.06% Shell 1.58%

lambda-hasura-abac-poc's Introduction

Containers

GraphQL

A Serverless project to create an API Gateway and Lambda function to access the Hasura API via a /graphql endpoint. The Lambda currently adds a couple Hasura specific headers and passes the request directly to Hasura.

TODO:

  • Use code-gen for specific user roles
  • Add schema validation based on user

Dev-Container

This is a work horse container, it has access to generate dummy data and post it directly to the database.

GraphQL-Engine

A Hasura container.

Postgres

A Postgres DB container.

Getting started

Making requests

POST http://0.0.0.0:3000/dev/graphql

_Example GraphQL Request:

query MyQuery {
  files(order_by: {created_at: asc}, limit: 100) {
    id
    filename
  }
}

Handy SQL Commands for debugging and resetting data

Remove all data, reset Auto-Increment ID:

TRUNCATE <table name> RESTART IDENTITY;

Get the total count of rows:

SELECT COUNT(*) FROM <table name>;

Exporting Database Schema:

pg_dump -c -v -h $POSTGRES_HOST -U $POSTGRES_USER -d $POSTGRES_DB > example.sql

OR

pg_dump -c -v postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@$POSTGRES_HOST/$POSTGRES_DB > example.sql

lambda-hasura-abac-poc's People

Contributors

brian-childress avatar

Watchers

 avatar  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.