Tyk Open Source API Gateway written in Go
Go C Shell Python JavaScript Java Other
Latest commit 2fe8a67 Jan 17, 2017 @mvdan mvdan committed with lonelycode Fix all remaining non-pointer uses of HostList
Updates #368.
Permalink
Failed to load latest commit information.
.github Add templates for issues and PR's Jan 17, 2017
apps Merge branch 'develop' into experiment/coprocess Oct 14, 2016
coprocess Add gRPC Java bindings. Jan 16, 2017
event_handlers Updating sample handler code Aug 19, 2016
install Made default conf use a max idle limit Nov 15, 2016
js Added JS Middleware auth plgin support Sep 29, 2016
middleware Add CPP proto bindings. Oct 26, 2016
policies Sampe policy file Feb 25, 2015
templates Added host checker functionality Oct 26, 2015
utils ci: move script to separate file, enforce gofmt Jan 16, 2017
vendor Fix all remaining non-pointer uses of HostList Jan 17, 2017
.gitignore Merge pull request #332 from mvdan/more-patches Jan 13, 2017
.travis.yml ci: move script to separate file, enforce gofmt Jan 16, 2017
CHANGELOG.md UPdated changelog Jan 5, 2017
LICENSE.md Added license Aug 13, 2014
README.md README: use single CI badge, remove gitter Jan 14, 2017
analytics.go Simplify some error logic Jan 17, 2017
analytics_url_normaliser_test.go Added URL normalisation for analytics Jul 6, 2016
api.go Always use pointers for APIDefinition Jan 17, 2017
api_definition_manager.go Always use pointers for APIDefinition Jan 17, 2017
api_definition_test.go Always use pointers for APISpec Jan 17, 2017
api_healthcheck.go Remove more unused code Jan 16, 2017
api_loader.go Fix all remaining non-pointer uses of HostList Jan 17, 2017
api_test.go Always use pointers for APISpec Jan 17, 2017
audit.go Simplify some error logic Jan 17, 2017
auth_manager.go Simplify some error logic Jan 17, 2017
batch_requests.go Remove a few dead assignments Jan 6, 2017
batch_requests_test.go Always use pointers for APISpec Jan 17, 2017
blueprint.go Remove more unused code Jan 16, 2017
command_mode.go Always use pointers for APIDefinition Jan 17, 2017
config.go Instrumentation now works with StatsD, it can be enabled with env var… Dec 24, 2016
config_utils.go Simplify some error logic Jan 17, 2017
coprocess.go Simplify some coprocess code Jan 17, 2017
coprocess_api.go Remove more explicit types, now inferred Jan 16, 2017
coprocess_bundle.go Simplify some error logic Jan 17, 2017
coprocess_bundle_test.go Fix tests. Sep 20, 2016
coprocess_dummy.go Simplify some coprocess code Jan 17, 2017
coprocess_events.go Take care of DispatchEvent when CP is not initialized. Oct 24, 2016
coprocess_grpc.go Remove more explicit types, now inferred Jan 16, 2017
coprocess_helpers.go Fixed initialiser Nov 8, 2016
coprocess_id_extractor.go Run goimports on all the code Jan 6, 2017
coprocess_id_extractor_test.go Always use pointers for APISpec Jan 17, 2017
coprocess_lua.go Fix indentation of non-Go code Jan 17, 2017
coprocess_native.go Update native dispatcher interface. Sep 14, 2016
coprocess_python.go Simplify some error logic Jan 17, 2017
coprocess_python_api.c Added MaxIdleConnsPerHost Nov 15, 2016
coprocess_test.go Always use pointers for APISpec Jan 17, 2017
coprocess_test_helpers.go Fix indentation of non-Go code Jan 17, 2017
dashboard_register.go Simplify some error logic Jan 17, 2017
distributed_rate_limiter.go Fix all remaining non-pointer uses of HostList Jan 17, 2017
event_handler_webhooks.go Fix const name typo Jan 17, 2017
event_handler_webhooks_test.go Fix indentation of non-Go code Jan 17, 2017
event_system.go Always use pointers for APISpec Jan 17, 2017
extended_method_versioning_test.go Fix all "should omit type" golint warnings Jan 16, 2017
gateway_test.go Always use pointers for APISpec Jan 17, 2017
handler_error.go Fix all "should omit type" golint warnings Jan 16, 2017
handler_proxy.go Caching processes are now seperate, org quotas user definable, less o… Jul 7, 2015
handler_success.go Remove more unused code Jan 16, 2017
handler_websocket.go Fix all remaining non-pointer uses of HostList Jan 17, 2017
host_checker.go Simplify some error logic Jan 17, 2017
host_checker_manager.go Simplify some error logic Jan 17, 2017
instrumentation_handlers.go Fix all "should omit type" golint warnings Jan 16, 2017
instrumentation_statsd_sink.go gofmt again, now with -s Jan 6, 2017
jsvm_event_handler.go Run goimports on all the code Jan 6, 2017
ldap_auth_handler.go Simplify some error logic Jan 17, 2017
le_helpers.go Remove more unused code Jan 16, 2017
main.go Simplify some error logic Jan 17, 2017
middleware.go Fix all "should omit type" golint warnings Jan 16, 2017
middleware_HMAC.go Remove more unused code Jan 16, 2017
middleware_access_rights.go Added some instrubmentation for the speed of middleware and the API c… Dec 21, 2016
middleware_api_security_handler.go Fix error message for invalid admin auth Sep 18, 2014
middleware_auth_key.go Remove more unused code Jan 16, 2017
middleware_auth_key_test.go Always use pointers for APISpec Jan 17, 2017
middleware_basic_auth_check.go Added some instrubmentation for the speed of middleware and the API c… Dec 21, 2016
middleware_basic_auth_test.go Always use pointers for APISpec Jan 17, 2017
middleware_check_HMAC_test.go Always use pointers for APISpec Jan 17, 2017
middleware_chooser.go Optimisations Aug 27, 2016
middleware_context_vars.go Simplify some more code Jan 6, 2017
middleware_example_test.go Remove more unused code Jan 16, 2017
middleware_granular_access.go Remove more unused code Jan 16, 2017
middleware_ip_whitelist.go Added some instrubmentation for the speed of middleware and the API c… Dec 21, 2016
middleware_ip_whitelist_test.go Always use pointers for APISpec Jan 17, 2017
middleware_jwt.go Simplify some error logic Jan 17, 2017
middleware_jwt_test.go Always use pointers for APISpec Jan 17, 2017
middleware_key_expired_check.go Make golint happy with errors Jan 16, 2017
middleware_method_transform.go Remove more unused code Jan 16, 2017
middleware_modify_headers.go Remove more unused code Jan 16, 2017
middleware_oauth2_key_exists.go Added some instrubmentation for the speed of middleware and the API c… Dec 21, 2016
middleware_openid.go Simplify some error logic Jan 17, 2017
middleware_organisation_activity.go Make golint happy with errors Jan 16, 2017
middleware_rate_check.go Remove more unused code Jan 16, 2017
middleware_rate_limiting.go Simplify some more bool expressions Jan 16, 2017
middleware_redis_cache.go Simplify some error logic Jan 17, 2017
middleware_request_size_limit.go Remove more unused code Jan 16, 2017
middleware_track_endpoints.go Added some instrubmentation for the speed of middleware and the API c… Dec 21, 2016
middleware_transform.go Simplify some error logic Jan 17, 2017
middleware_url_rewrite.go Remove more unused code Jan 16, 2017
middleware_version_check.go Simplify some more bool expressions Jan 16, 2017
middleware_virtual_endpoint.go Simplify some more bool expressions Jan 16, 2017
monitor.go Simplify some code Jan 5, 2017
multi_target_proxy_handler.go Make golint happy with errors Jan 16, 2017
multiauth_test.go Always use pointers for APISpec Jan 17, 2017
oauth_manager.go Simplify some error logic Jan 17, 2017
oauth_manager_test.go Always use pointers for APISpec Jan 17, 2017
plugins.go Fix all "should omit type" golint warnings Jan 16, 2017
policy.go Remove unnecessary type conversions Jan 6, 2017
redis_cluster_handler.go Fix all "should omit type" golint warnings Jan 16, 2017
redis_logrus_hook.go Run goimports on all the code Jan 6, 2017
redis_notifier_outbound.go Remove more unused code Jan 16, 2017
redis_signal_dash_zeroconf.go Fix misuse of strings.TrimRight Jan 16, 2017
redis_signal_handle_config.go Fix all "should omit type" golint warnings Jan 16, 2017
redis_signal_handle_config_request.go Fix all "should omit type" golint warnings Jan 16, 2017
redis_signal_outbound.go Remove more explicit types, now inferred Jan 16, 2017
redis_signals.go Simplify some error logic Jan 17, 2017
res_handler_header_injector.go Run goimports on all the code Jan 6, 2017
res_handler_header_transform.go Run goimports on all the code Jan 6, 2017
res_handler_transform.go Simplify some error logic Jan 17, 2017
response_middleware.go Fix all "should omit type" golint warnings Jan 16, 2017
rewriter_test.go Fix all Error/Errorf mistakes found by vet Jan 11, 2017
round_robin.go Simplify some coprocess code Jan 17, 2017
round_robin_test.go Version update, tests updated and passing Sep 1, 2016
rpc_analytics_purger.go Fixed RPC loader so that it uses a singleton (more efficient with con… Dec 2, 2016
rpc_backup_handlers.go Simplify some error logic Jan 17, 2017
rpc_storage_handler.go Remove more unused code Jan 16, 2017
sds.c Added MaxIdleConnsPerHost Nov 15, 2016
service_discovery.go Simplify some error logic Jan 17, 2017
service_discovery_test.go Fix indentation of non-Go code Jan 17, 2017
session_manager.go Remove more unused code Jan 16, 2017
session_state.go Simplify some coprocess code Jan 17, 2017
storage_handlers.go Simplify some error logic Jan 17, 2017
swagger.go Always use pointers for APIDefinition Jan 17, 2017
tyk.conf.example RH: Make use of the ListenAddress supported by the net and tls librar… Jul 15, 2016
tyk_reverse_proxy_clone.go Fix all remaining non-pointer uses of HostList Jan 17, 2017
util_auth_helpers.go Fixes #118 - adds more robust HMAC handling with optional header fiel… Feb 22, 2016
util_http_helpers.go Run goimports on all the code Jan 6, 2017
version.go Fix all "should omit type" golint warnings Jan 16, 2017

README.md

Tyk API Gateway

Build Status

Tyk is a lightweight, open source API Gateway and Management Platform enables you to control who accesses your API, when they access it and how they access it. Tyk will also record detailed analytics on how your users are interacting with your API and when things go wrong.

Go versions 1.6 or later are supported.


What is an API Gateway?

An API Gateway sits in front of your application(s) and manages the heavy lifting of authorisation, access control and throughput limiting to your services. Ideally, it should mean that you can focus on creating services instead of implementing management infrastructure. For example if you have written a really awesome web service that provides geolocation data for all the cats in NYC, and you want to make it public, integrating an API gateway is a faster, more secure route that writing your own authorisation middleware.

Key Features of Tyk

Tyk offers powerful, yet lightweight features that allow fine grained control over your API ecosystem.

  • RESTFul API - Full programmatic access to the internals makes it easy to manage your API users, keys and Api Configuration from within your systems
  • Multiple access protocols - Out of the box, Tyk supports Token-based, HMAC Signed, Basic Auth and Keyless access methods
  • Rate Limiting - Easily rate limit your API users, rate limiting is granular and can be applied on a per-key basis
  • Quotas - Enforce usage quotas on users to manage capacity or charge for tiered access
  • Granular Access Control - Grant api access on a version by version basis, grant keys access to multiple API's or just a single version
  • Key Expiry - Control how long keys are valid for
  • API Versioning - API Versions can be easily set and deprecated at a specific time and date
  • Blacklist/Whitelist/Ignored endpoint access - Enforce strict security models on a version-by-version basis to your access points
  • Analytics logging - Record detailed usage data on who is using your API's (raw data only)
  • Webhooks - Trigger webhooks against events such as Quota Violations and Authentication failures
  • IP Whitelisting - Block access to non-trusted IP addresses for more secure interactions
  • Zero downtime restarts - Tyk configurations can be altered dynamically and the service restarted without affecting any active request

Tyk is written in Go, which makes it fast and easy to set up. Its only dependencies are a Mongo database (for analytics) and Redis, though it can be deployed without either (not recommended).

Why?

Tyk was built because other open source API Gateways in the market come with dependencies and bloat, attempting to be too many things to too many people. tyk is focused, simple and does one thing well - protecting your API from unauthorised access.

Documentation

All the documentation can be found on our main site at http://tyk.io/

License

Tyk is released under the MPL v2.0 please see the LICENSE.md file for a full version of the license.

Contribute / Build

To get started contributing, clone the repo to your local go workspace, change into the new tyk directory and run go get, this should retrieve all the dependencies.

We are working to increase test coverage of features, currently the majority of auth methods and middleware are tested, however it could always be better.

Any changes that are submitted with a pull request should come with a test and be in a separate branch. Basically, use this checklist:

  • Do your changes have tests?
  • Have you run the tests?
  • Did they pass?
  • Have you written a test for your feature?
  • Does it pass after merge?

If you can answer yes to all of the above, feel free to submit a pull request :-)

Roadmap

To coordinate development and be completely transparent as to where the project is going, the version roadmap for the next version, as well as proposed features and adopted proposals can be viewed on our public Trello board:

https://trello.com/b/59d5kAZ5/tyk-api-gateway-roadmap

Any proposals can be made in the Github issue tracker, proposals that are adopted will be placed into the trello and then moved according to their status.

A note on the tests

Currently in order for tests to pass, a redis host is required. We know, this is terrible and should be handled with an interface, and it is, however in the current version there is a hard requirement for the application to have its default memory setup to use redis as part of a deployment, this is to make it easier to install the application for the end-user. Future versions will work around this, or we may drop the memory requirement.

The simplest way to get the tests to run is to install local redis, or (what I do) have a vagrant instance that is running redis, then you can just vagrant up when you need redis and kill it later. Just make sure you are forwarding the default ports 1:1.

Dev versus stable

The master branch is NOT the stable releases, check the tags for stable releases that can be patched, please see the CHANGELOG for breaking changes or to see how things stand.

Geo IP features

This product utilises GeoLite2 data created by MaxMind, available from http://www.maxmind.com.