npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

api-gateway-service

v0.161.2-121167a

Published

[![CircleCI](https://circleci.com/gh/ElateralLtd/api-gateway-service/tree/master.svg?style=shield&circle-token=)](https://circleci.com/gh/ElateralLtd/api-gateway-service/tree/master) [![Coverage Status](https://coveralls.io/repos/github/ElateralLtd/api-g

Downloads

5

Readme

api-gateway-service

CircleCI Coverage Status

Enter your description here

Development

  docker-compose up
  localhost:8080/documentation
Dependencies
  • docker
  • docker-compose
Requirements
  • eslint linting
  • 100% unit test coverage
Scripts

|Command|Description| |---|---| |start|Starts the service| |start:watch|Starts the service with watch and inspect| |lint|Checks project linting| |lint:fix|Checks project linting and fixes what it can| |test|Test runner| |test:watch|Test runner with watch| |coverage|Coverage checker| |coverage:watch|Coverage checker with watch| |ci|Run CI checks|

Coveralls

$COVERALLS_REPO_TOKEN env var must be provided in the project settings

CSRF

CSRF_ALLOW_ANY_ACCOUNT_ROUTES is semicolon separated value. Note that if you want to allow root call use '/;' not ';'. Also avoid using trailing semicolon.

Is not vulnerable if:
  1. has no referrer header
  2. req.path starts with any CSRF_ALLOW_ANY_ACCOUNT_ROUTES and req.headers.referer domain is corresponding any existing account.fqdn
  3. isWildCardOriginRequest:
  • req.path === '/graphql' and query is allowed in config.cors.allowedGQLQueries
  • config.cors.allowedRoutes includes req.path
  • req.path starts with any of config.cors.allowedWildcardRoutes

Then using originProvider:

  • if req.headers['x-elateral-fqdn'], then get account from req.headers['x-elateral-fqdn'] if exists, return its http(s)://fqdnFromAccount.com named ORIGIN
  • isWildCardOriginRequest (same as in step 2) returned true, return false named ORIGIN
  • if req.path starts with aid, then get account from aid if exists, return its http(s)://fqdnFromAccount.com named ORIGIN
  1. if req.headers.referer starts with ORIGIN
  2. if ORIGIN === false
  3. if req.headers.origin === ${config.cors.protocol}://${config.apiHost} // callingFromApiHost
Is vulnerable if:
  1. using originProvider returned Error. Possible if:
  • no account with such req.headers['x-elateral-fqdn']
  • if aid is in route and no account with such aid // originProvider can return undefined if it was unable to solve origin, in that case we can’t assume if req is CSRF or not, we get to next step. Undefined origin is used in CORS check.
  1. all above checks passed and still have no info if req is CSRF or not

CORS

CORS_ALLOWED_WILDCARD_ROUTES and CORS_ALLOWED_ROUTES are semicolon separated values. Note that if you want to allow root call use '/;' route not ';'. Also avoid using trailing semicolon.

Is not CORS vulnerable if:
  1. Using originProvider returned origin:
  • from req.headers['x-elateral-fqdn'], then get account from req.headers['x-elateral-fqdn'] if exists, return its http(s)://fqdnFromAccount.com named ORIGIN
  • isWildCardOriginRequest (same as in step 2) returned true, return 'false' named ORIGIN
  • from req.path starts with aid, then get account from aid if exists, return its http(s)://fqdnFromAccount.com named ORIGIN
  1. Using originProvider returned origin as false:
  • isWildCardOriginRequest (same as in step 2 of not vulnerable CSRF), return false named ORIGIN In this case we disable CORS for this request - making its Access-Control-Allow-Origin: * - wildcard
Is CORS vulnerable if:
  1. Using originProvider returned Error. Possible if:
  • no account with such req.headers['x-elateral-fqdn']
  • if aid is in route and no account found with such aid
  1. if originProvider passed all steps and conditions and was unable to solve origin and returned undefined