Giter Club home page Giter Club logo

api-gateway's People

Contributors

daviddykeuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

api-gateway's Issues

Parameter handling

Dynamic parts of URLs (like IDs) need to be handled and sent to destination services

Logging

To monitor usage, find errors, and to show off how fast your API is

Request bundling

collate multiple internal requests in to one external request, improving latency for devices with shoddy internet connections

Circit breaker

Stop forwarding requests if the underlying service has been broken for sometime

Fallbacks

Optional return object if the proxied request fails for any region

Keeping the system alive if something dies

Query string handling

Everything from ? onwards on the url needs to be sent on to the destination service

Testing

This thing needs good testing, no one wants to release a 💩

Auth0 fails when no roles are provided

When providing a JWT with no roles property

2018/09/07 03:26:10 http: panic serving 10.244.0.15:49886: interface conversion: interface {} is nil, not string
goroutine 4 [running]:
net/http.(*conn).serve.func1(0x19d0e000)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1697 +0x9f
panic(0x82f55e0, 0x19e40780)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/runtime/panic.go:491 +0x1d0
github.com/turbosonic/api-gateway/initializer.checkRoles(0x19d12600, 0x19c60900, 0x3, 0x19c548b0, 0x1, 0x1, 0x19c548d0, 0x1, 0x1, 0x19c60930, ...)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/initializer/initializer.go:120 +0x108
github.com/turbosonic/api-gateway/initializer.createEndpoint.func1(0x8496660, 0x19c0a020, 0x19d12600)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/initializer/initializer.go:58 +0x77
net/http.HandlerFunc.ServeHTTP(0x19c6e280, 0x8496660, 0x19c0a020, 0x19d12600)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1918 +0x34
goji%2eio.dispatch.ServeHTTP(0x8496660, 0x19c0a020, 0x19d12600)
	/home/travis/gopath/src/goji.io/dispatch.go:17 +0x91
goji%2eio.(*dispatch).ServeHTTP(0x84e1fec, 0x8496660, 0x19c0a020, 0x19d12600)
	<autogenerated>:1 +0x40
github.com/turbosonic/api-gateway/authentication/clients/auth0.CheckJwt.func1(0x8496660, 0x19c0a020, 0x19d12180)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/authentication/clients/auth0/auth0.go:58 +0x426
net/http.HandlerFunc.ServeHTTP(0x19cb9410, 0x8496660, 0x19c0a020, 0x19d12180)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1918 +0x34
github.com/turbosonic/api-gateway/logging.LogHandler.LogHandlerFunc.func1(0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/logging/logging.go:61 +0xa2
net/http.HandlerFunc.ServeHTTP(0x19c59200, 0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1918 +0x34
github.com/turbosonic/api-gateway/responseMarshal.AddHeaders.func1(0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/responseMarshal/responseMarshal.go:23 +0x20f
net/http.HandlerFunc.ServeHTTP(0x19cb9420, 0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1918 +0x34
github.com/turbosonic/api-gateway/responseMarshal.CorsHandler.func1(0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/gopath/src/github.com/turbosonic/api-gateway/responseMarshal/responseMarshal.go:47 +0x190
net/http.HandlerFunc.ServeHTTP(0x19cb9430, 0x84967c0, 0x19d18000, 0x19d12180)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1918 +0x34
goji%2eio.(*Mux).ServeHTTP(0x19cd1440, 0x84967c0, 0x19d18000, 0x19d12000)
	/home/travis/gopath/src/goji.io/mux.go:74 +0x108
net/http.serverHandler.ServeHTTP(0x19c92300, 0x84967c0, 0x19d18000, 0x19d12000)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:2619 +0x8e
net/http.(*conn).serve(0x19d0e000, 0x8496f00, 0x19c460a0)
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:1801 +0x5d1
created by net/http.(*Server).Serve
	/home/travis/.gimme/versions/go1.9.2.linux.amd64/src/net/http/server.go:2720 +0x1f6```

Logging Updates

Logging is really to Elasticsearch not ELK, so update to that. Also include the date in the index of the log to allow easier administration of logs and allow for custom index names in ENV files

Log to InfluxDB

For all that Grafana glory

Create a Grafana dashboard JSON

Authorization

Need to add scopes and rules to endpoints via configuration

CD/CI 🏗

Something like this:

  • Changes to master trigger new alpha docker images
  • Adding the label beta to a commit on master triggers new beta docker images
  • Adding the label release to a commit on master triggers new latest docker images

Config reload

A config might want to be changed without redeploying the code, this might require a management API to be created on a different port

TLS

Things need to be secure, allow for adding SSL certs

Authentication

It would be pretty useless if a gateway didn't keep out the bad guys

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.