Giter VIP home page Giter VIP logo

gotiator's Introduction

Gotiator

A tiny API Gateway based on JWTs.

Gotiator can handle simple API proxying with signing for single page apps that already use JWTs for authentication.

Gotiator Proxy is released under the MIT License. Please make sure you understand its implications and guarantees.

Installing

go get github.com/netlify/gotiator
gotiator serve

Configuration

Settings can be set either by creating a config.json or setting NETLIFY_ prefixed environment variables. IE.:

{
  "jwt": {
    "secret": "2134"
  }
}

Is the same as:

GOTIATOR_JWT_SECRET=2134 gotiator serve

You must set your JWT secret (and we strongly recommend doing this with an environment variable) to match the JWT issuer (like Auth0) or netlify-auth.

You configure API proxying from the config.json:

{
  "apis": [
    {"name": "github", "url": "https://api.github.com/repos/netlify/gotiator", "roles": ["contributor"]}
  ]
}

To sign outgoing requests with a Bearer token, you must set an environment variable with the token, based on the name of the API. If the API is called github, you must set:

NETLIFY_API_GITHUB=1234

The roles property specifies which roles should have access to the API. Roles should be encoded in the JWT claims under app_metadata.roles. Any request with a correctly signed JWT that includes one of the roles in it's app_metadata will be allowed to make requests to the API signed with your token via /:api_name.

With the above example, a user with a JWT proving the claim that she has the role "contributor", can send signed requests to GitHub's API scoped to this repo, via:

GET|POST|DELETE|PATCH /github

gotiator's People

Contributors

biilmann avatar calavera avatar brycekahle avatar rybit avatar

Stargazers

Cam Kemshal-Bell avatar Milan Lesichkov avatar Chang Xiaodong avatar  avatar Henrique Mitsuo avatar Software Nerd avatar  avatar Jarangutan avatar Hyeseong Kim avatar Yacine Rezgui avatar edtechl avatar Yijie avatar cesargm avatar Venky B avatar Ximena avatar 尹名洋 avatar Marcus Weiner avatar Rj avatar Felipe Monteiro avatar David Quagebeur avatar gaurav patel avatar Debjyoti Aich avatar Nicholas Wagner avatar Yrvin Escorihuela avatar  avatar fall simply avatar Manuj Bhatia avatar Cizel Shi avatar zouyi avatar Andrew Dyke avatar Jesus Urrutia avatar Arthur Tkachenko avatar Luca G. Soave avatar super watano avatar Suriyaa Sundararuban avatar Alexander Semyenov avatar Kelly Campbell avatar Jamie Folsom avatar Alex Galhardo avatar K Cartlidge avatar Guru Prasath Anandapadmanaban avatar David C avatar  avatar Dobrosław Żybort avatar ⊣˚∆˚⊢ avatar Sten Roger Sandvik avatar Guayo Mena avatar Leo avatar Will Fife avatar Taofiki Yussuff avatar  avatar Gokhan Celik avatar Denis Denisov avatar Chris Watson avatar Patrick Smith avatar Rob Rankin avatar John Manoogian III avatar José Dulanto avatar Alan Cohen avatar  avatar denistsoi avatar Michael Leonard avatar Muhammad Sumon Molla Selim avatar Joël Galeran avatar Lukasz B. avatar Ria avatar Reuben Cummings avatar Fabio Ribeiro avatar Rafael Jesus avatar

Watchers

 avatar Esteban (Kito) Pastorino avatar Bret Comnes avatar David Wells avatar James Cloos avatar Eli Williamson avatar Todd Morey avatar Kuznetsov Ilia avatar Tim Erickson avatar Sarfaraz Rydhan avatar Lauren Sell avatar Rafa avatar Luna Yu avatar swyx.io avatar  avatar Amer Ali avatar Aaron (Yueh-Han) Huang avatar Dennis Padiernos avatar ingrid epure avatar Yrvin Escorihuela avatar Perry avatar Cassandra Ferrara avatar  avatar cesargm avatar Cam Kemshal-Bell avatar

gotiator's Issues

Make golint pass an enable it in Travis to ensure the code remains consistent

- Do you want to request a feature or report a bug?

This is an enhancement to improve code quality.

- What is the current behavior?

Right now we're ignoring Go's linter rules.

- What is the expected behavior?

We should make sure the project passes the linter rules and enable make lint in Travis.

- Please mention your Go version, and operating system version.

Go 1.8 and up.

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.