Skip to content

ris314/gql-auth-proto

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GQL Auth - Prototype

This repository is an exploration of the GraphQL network request process flow as it relates to determining the auth context and supplying it to downstream resolvers.

Please see scope and observations for a detailed narrative.

Dependencies

  • Node
  • Rover CLI * Optional. Used if you want to make changes to the GQL schema and update the gateway's super-graph.

Installing

Clone the repo locally. Then, within your terminal change the directory to gql-auth-proto and run:

npm install

Services

To run all services, within the project directory in the terminal:

npm start

Fibonacci Sequence

Simple server with a single endpoint listening for POST requests.

GQL server

GraphQL server with a straightforward schema and implementation.

Dependency: Fibonacci Sequence

GQL gateway

Exposes GQL server as a subgraph. Please note that gateway implementation and configuration are purposefully made simple without introducing additional subgraphs to minimize scope and retain the focus on the request process flow investigation.

Dependency: GQL server

Usage

With the services running, you can use Apollo studio to send queries to either GQL server or GQL gateway.

You must supply the Authorization header in order to authenticate and authorize requests.

In order to simulate an authorized user making requests, you can use the following:

purpose
Authorization: none simulates authenticated user without rights to view any data
Authorization: limited simulates user with rights to view a subset of available data
Authorization: super simulates user with full data read permissions

Please see the auth directory to understand more.

Note on console logs

Each service logs color coded request processing events to the console. This mechanism is used to demonstrate the execution flow and parameters supplied to invoked functions within the execution sequence.

About

Auth model exploration for FaaS GraphQL resolvers.

Resources

Stars

Watchers

Forks