Code Monkey home page Code Monkey logo

express-gateway's Introduction

A Microservices API Gateway Built Using Express.js and Express Middleware


npm CircleCI Azure Pipelines CodeCov Gitter Module LTS Adopted'

Express-Gateway

DEPRECATION NOTICE This Project is no longer maintained. Read here for more details or if you're interested in taking over that project.

Express Gateway is a microservices API gateway that sits at the heart of any microservices or serverless architecture, regardless of what language or platform you're using.

Express Gateway secures your microservices and serverless functions and expose them through APIs using Node.js, Express and Express middleware.

Developing cloud native applications, orchestrating and managing them now can be done insanely fast all on one seamless platform without having to introduce additional infrastructure.



Main Features

  • Microservices and Serverless QoS Proxy and Security
  • Built Entirely on JavaScript/Node.js using Express and Express Middleware
  • Dynamic Centralized Config
  • API Consumer and Credentials Management
  • Plugins and Plugin Framework
  • Distributed Data Store
  • CLI
  • REST API
  • Cloud Native Execution

Installation

If you have Node.js already installed:

# install Express Gateway
$ npm install -g express-gateway

Creating a Gateway

# create a new gateway using the CLI
$ eg gateway create

Get Help

Need help or have a question?

Community

Express has a community that we hope to extend further with Express Gateway's gateway use case for Express and its middleware.

Roadmap

The Express Gateway roadmap consists of three parts:

  1. FeatHub - features requested and voted on by any community member, this feeds into the...
  2. Roadmap - the published roadmap of all features under considerations and projected timeframes, the highest priority items are put into the...
  3. Waffle board - a real time as a public task board on Waffle.io with backlog of stories for the next release

LTS Policy

Module Version Release Date Minimum EOL EOL With Status
1.x.x Jul 2016 Dec 2019 Node 8 Current

Contribution

All contributions welcome! Please see the contributor's guide

License

Apache-2.0 License

Copyright © Express Gateway Contributors

express-gateway's People

Contributors

alamgirqazi avatar albertlinga avatar altsang avatar bhageena avatar bploetz avatar brady-conn avatar brunovillanova avatar ciaranashton avatar ddunkin avatar dependabot[bot] avatar dotbits avatar drmegavolt avatar fcioffi avatar irfanbaqui avatar iwko avatar jinasonlin avatar judev avatar k-soze avatar kaischwarz-cnic avatar kevinswiber avatar mfrye avatar mohammadwasi avatar nakardo avatar ontehfritz avatar ravikp7 avatar rlisagor avatar sootysec avatar srcnix avatar stanislaw-glogowski avatar xvincentx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

express-gateway's Issues

API Entity: Link API endpoints to APIs

There are public endpoints, and then there are APIs, we need to validate the logical model that an API is a set of public endpoints.

Roman's design within the Express gateway has the most granular level listed within the configuration - public endpoint URLs (non-grouped) and private endpoints that the EG proxies to. Need to think about introducing API entity as a set of public endpoints.

E0/S3: EG Admin API

Create EG Admin API to manipulate the JSON config parameters.

Investigating options with and without LoopBack.

E11/S1: Redirect URL for external authorization server

For the authentication that is NOT handled by the EG, needs to be re-directed an external authorization URL so that the URL can be redirected to when a user accesses the EG.

This should be specified in authorization_url

Deploy EG

Extend LB workspace to deploy the new EG created in LB workspace.

E18/S1: Spec for Key Authentication

Ability to create a pipeline with key based processor to provide authentication through a set of EG generated keys for each API Consumer

An API Consumer should be able to have a set of key credentials associated with their identity.

Environment variable

Add environment variable override based on the 12-factor app config for the EG config.

[Cancelled] E16/S1: Pipeline resolution based on hostname and path both with wildcard support

Example description

publicEndpoints: # specify pipeline per domain and path
cats:
host: ".cats.com" # regexp support
path: / # optional defaults to /
pipeline: cats_pipeline
mycats:
host: "
.mycats.com"
path: /cats
pipeline: cats_pipeline
big-dogs:
host: big-dogs.com
pipeline: dogs_pipeline
animals-cats:
host: "animals.com"
path: /cats
pipeline: cats_pipeline
animals-dogs:
host: "animals.com"
path: /dogs
pipeline: dogs_pipeline

E0/S2: EG architecture design

Create a Design/Architectural Document that describes how and what the EG admin API be built, so that all dependencies from the EG OSS project AND LB commercial product are identified with the right decisions.

[Cancelled] E16/S1: Configuration file improvements

Breakdown config file to more linear structure

####Public Endpoints
host, path, pipeline_name

####Private Endpoints
url, port, path

http server configs
port

https server configs
port and certificates

pipelines

APIs - group of public endpoint (Does not include consumer management)

YAML example:
publicEndpoints: # specify pipeline per domain and path
cats:
host: ".cats.com" # regexp support
path: / # optional defaults to /
pipeline: cats_pipeline
mycats:
host: "
.mycats.com"
path: /cats
pipeline: cats_pipeline
big-dogs:
host: big-dogs.com
pipeline: dogs_pipeline
animals-cats:
host: "animals.com"
path: /cats
pipeline: cats_pipeline
animals-dogs:
host: "animals.com"
path: /dogs
pipeline: dogs_pipeline

http: # if not specified EG will not start http server
port: 9080

https: # if not specified EG will not start https server
port: 9443
certificates: # will use SNI callback to provide proper certificate for domain
"*.lunchbadger.io":
key: "example/keys/lunchbadger.io.key.pem"
cert: "example/keys/lunchbadger.io.cert.pem"
"api.lunchbadger.com":
key: "example/keys/lunchbadger.com.key.pem"
cert: "example/keys/lunchbadger.com.cert.pem"
"default":
key: "example/keys/lunchbadger.io.key.pem"
cert: "example/keys/lunchbadger.io.cert.pem"

privateEndpoints: # urls to downstream services
cats_service:
url: "http://localhost"
port: 3000
path: / # optional defaults to /
dogs_service:
url: http://localhost
port: 4000

pipelines:
cats_pipeline:
title: Cats Pipeline
policies:
- action:
name: proxy # proxy to cats_service downstream service
privateEndpoint: cats_service

dogs_pipeline:
title: dogs Pipeline
policies:
- condition:
name: always
# action:
# name: oauth2-basic
# params:
# - action:
# name: oauth2-bearer
# - action:
# name: ensure-autenticated # ensure user has logged in 403 otherwise
# - action:
# name: oauth2-scope
# allow-scopes:
# - '/dogs'
action:
name: proxy # proxy to dogs_service downstream service
privateEndpoint: dogs_service

apis:
animals:
name: animals
plan: free
public_endpoints:
- cats
- mycats
- dogs

E7/S1: OAuth2 scope

Allow a user to specify OAuth2 scope as OAuth2 scope tags within a pipeline to match public endpoint URLs

Example:
{
"condition": ["pathExact", "/protected/resourceA"],
"action": "tag",
"params": {
"tags": ["oauth2", "scope:resourceA"]
}
}

JWT Plugin: 3rd part introspection capabilities

A developer familiar with Express middleware should be able to take any middleware that extracts the parameters that are necessary to construct a configured instance of it to be passed dynamically when instantiating that middleware.

Those parameters should go into EG config files in a standardized format.

E20/S2: EG App data - where and how to store

EG App data would be more key-value and or rows and tables and not have hierarchical nor document like structure like the config data. Because this can live in distributed and single data stores, the lowest common denominator would be something like keys and values that can be transposed into rows/columnar based store and grouped into tables or namespaces.

API Entity: Associate API consumer with API

The EG runtime configuration needs associate API consumers with the APIs (and their endpoints) through the configured pipelines. Although it's not necesary to explicity do so, granularity could be specified to link APIs with specific instances of pipelines where a processor may have specific parameter values for a given API consumer.

Example:
Customer API is linked to a pipeline where a rate limiter is specified and Consumer Bob and Consumer Bill exist
Consumer Bob may have rate limiting parameters: 1000 req/minute
Consumer Bill may have rate limiting parameters: 2000 req/minute
The SAME API backed by the SAME pipeline have two different parameter values for Bob and Bill.

E20/S1: Separate app data from config data

There is EG app data (such as consumer records) that is kept separate from the config data so that I can separate configuration from master/app data

EG should support the ability to separate app data from config data. Config data would be data that is used to configure Express Gateway and be considered metadata. App data would be data that a USER of EG would generate using EG, for example - creating API consumers in the consumer management system

EG config file

Store default config file in /etc/expressgateway/gateway.conf

E0/S1: Research on LB + EG API architecture

The LB architecture has an API called a workspace API. The workspace API manipulates LoopBack projects. The same workspace API needs to be extended to manipulate Express Gateways. The big question here is - how do we surface an API for Express Gateway? Do we do this without LoopBack?

  1. take LoopBack, which already has Express in it - and pare down to barebone REST (strong-remoting) and marry Roman's EG capabilities into it
  2. take Express Gateway - examine LoopBack, identify REST capabilities and extract and put into Express Gateway
  3. take Express Gateway - extend with REST capabilities w/o LoopBack (controversial - we want to avoid)

E14/S1: Ability to passing upstream and downstream headers

Ability to passing in EG custom headers downstream so that use cases like path tracing, audit, request/response time introspection and metadata can be realized.

EG should be able to inject, modify and preserve upstream and downstream headers as needed for its own instrumentation as well as preserving system metadata for consumers and backend producers.

E6/S1: tag apiEndpoint with SCOPE

Allow a user to specify the OAuth2 tag within a pipeline's path to match all endpoints URLs

Example:
condition: ["always"]
or by a particular path
condition: ["pathExact", "/protected/resourceA"]
this would trigger the policy.

E19/S1: Add microservices context in EG

EG has APIs as containers for public endpoints. EG has private endpoints as well. We should think about the parallel that we have already within LunchBadger. A microservice is a unit of deployment of functionality that has dependencies and externalization in the form of private enpoints. In LB - a model has a built in private endpoint. If you proxy in front of a microservice, the microservice can have N number of private endpoints. Therefore a microservice is a container of private endpoints.

Clustering: Multiple EG instances with central configuration - spec only

As an EG admin, I would want to be able to configure multiple EG instances that are all driven off central configuration, so that I have scale and high availability.

An EG admin should be able to create mutiple gateway instances that are assigned different configurations but also share centralized information.

Example:
Gateway 1: has 2 pipelines and fronts /catalog and /cart public endpoints
Gateway 2: has 1 pipeline and fronts /user endpoint
Both Gateway 1 and 2 should share the same set of API consumer data for access and assignment

E10/S1: API endpoints with OAuth2 scopes

The authorization system would need to provide a set of scopes that the user is authorizing to be provided to the client application. We need API endpoints with OAuth2 scopes

E17/S1: Basic Authentication

Ability to create a pipeline with a Basic Auth processor to provide basic authentication for API Consumers.

An API Consumer should be able to have basic auth credentials associated with their identity.

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.