MCPcopy
hub / github.com/motiv-labs/janus

github.com/motiv-labs/janus @4.0.0 sqlite

repository ↗ · DeepWiki ↗ · release 4.0.0 ↗
827 symbols 3,203 edges 160 files 402 documented · 49%
README

Janus

Build Status codecov GoDoc Go Report Card Join us on slack


Note: This project is in maintenance mode. There will be bug fixes, but no feature development.


An API Gateway written in Go

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

Go version 1.9 or later is required to build master, the current development version. Janus is officially supported on linux/amd64, linux/i386, linux/arm64, darwin/i386, darwin/amd64, windows/i386 and windows/amd64.

Why Janus?

In ancient Roman religion and myth, Janus (/ˈdʒeɪnəs/; Latin: Ianus, pronounced [ˈjaː.nus]) is the god of beginnings, gates, transitions, time, doorways, passages, and endings. He is usually depicted as having two faces since he looks to the future and to the past. Wikipedia

We thought it would be nice to name the project after the God of the Gates :smile:

What is an API Gateway?

An API Gateway sits in front of your application(s) and/or services 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 than writing your own authorisation middleware.

Key Features

This API Gateway offers powerful, yet lightweight features that allows fine-grained control over your API ecosystem.

  • No dependency hell, single binary made with go
  • REST API, full programatic access to the internals makes it easy to manage your API users, keys and API Configuration from within your systems
  • Hot-reloading of configuration. No need to restart the process
  • Graceful shutdown of http connections
  • OpenTracing support for Distributed tracing (Supports Google Cloud Platform and Jaeger)
  • HTTP/2 support
  • Circuit Breaker support that can be configured for each API
  • Retry mechanism to make your endpoints more resilient
  • Rate Limiting, easily rate limit your API users, rate limiting is granular and can be applied on a per-key basis
  • CORS Filter, enable cors for your API, or even for specific endpoints
  • Multiple auth protocols, out of the box, we support JWT, OAuth 2.0 and Basic Auth access methods
  • Small official docker image included

Installation

Note: All examples here and in the documentation will be using HTTPie for simplicity. But all requests can easily be converted to curl if needed.

Docker

The simplest way of installing Janus is to run the docker image for it. You can check our examples folder and you can find some good examples. All you got to do is:

cd examples/front-proxy

docker-compose up -d

Now you should be able to get a response from the gateway.

Try the following command:

http http://localhost:8081

Manual

You can get the binary and play with it in your own environment (or even deploy it where ever you like). Just go to the releases page and download the latest one for your platform.

Getting Started

Check out our quick start guide to get up to speed with Janus.

Contributing

To start contributing, please check CONTRIBUTING.

Documentation

  • Janus Docs: https://hellofresh.gitbooks.io/janus
  • Janus Go Docs: https://godoc.org/github.com/hellofresh/janus
  • Go lang: https://golang.org/

<a href="https://hellofresh.com" style="text-decoration:none; margin-right:2rem;">
<img height="110" src="https://www.hellofresh.de/images/hellofresh/press/HelloFresh_Logo.png">

Extension points exported contracts — how you extend this code

Verifier (Interface)
Verifier contains the methods for verification of providers [7 implementers]
pkg/jwt/provider/verifier.go
Manager (Interface)
Manager holds the methods to handle tokens [3 implementers]
pkg/plugin/oauth2/manager_factory.go
Watcher (Interface)
Watcher defines how a provider should watch for changes on configurations [3 implementers]
pkg/api/repository.go
Balancer (Interface)
Balancer holds the load balancer methods for many different algorithms [2 implementers]
pkg/proxy/balancer/balancer.go
Router (Interface)
Router defines the basic methods for a router [1 implementers]
pkg/router/router.go
Option (FuncType)
Option represents the available options
pkg/server/option.go
Option (FuncType)
Option represents the available options
pkg/web/options.go
Provider (Interface)
Provider represents an auth provider [4 implementers]
pkg/jwt/provider/provider.go

Core symbols most depended-on inside this repo

Error
called by 128
pkg/errors/error.go
ServeHTTP
called by 50
pkg/router/router.go
Add
called by 45
pkg/plugin/basic/mongodb_repository.go
Handler
called by 43
pkg/errors/error.go
Get
called by 39
pkg/plugin/oauth2/handlers.go
New
called by 36
pkg/errors/error.go
Get
called by 30
pkg/web/api_handler.go
Decode
called by 25
pkg/plugin/plugin.go

Shape

Function 417
Method 254
Struct 119
TypeAlias 16
Interface 11
FuncType 10

Languages

Go100%

Modules by API surface

pkg/router/chi.go21 symbols
pkg/router/router.go19 symbols
pkg/proxy/definition.go19 symbols
features/bootstrap/context_request.go19 symbols
pkg/config/specification.go17 symbols
pkg/plugin/oauth2/oauth.go16 symbols
pkg/server/server.go14 symbols
pkg/plugin/requesttransformer/middleware_test.go14 symbols
pkg/plugin/oauth2/mongodb_repository.go14 symbols
pkg/plugin/basic/mongodb_repository.go14 symbols
pkg/plugin/requesttransformer/middleware.go13 symbols
pkg/jwt/provider/provider_test.go12 symbols

Dependencies from manifests, versioned

code.cloudfoundry.org/bytefmtv0.0.0-2018010819041 · 1×
github.com/DataDog/datadog-gov0.0.0-2018033021495 · 1×
github.com/Knetic/govaluatev3.0.0+incompatible · 1×
github.com/afex/hystrix-gov0.0.0-2018040601243 · 1×
github.com/asaskevich/govalidatorv0.0.0-2017111115101 · 1×
github.com/bshuster-repo/logrus-logstash-hookv0.4.1 · 1×
github.com/cactus/go-statsd-clientv3.1.1+incompatible · 1×
github.com/cucumber/messages-go/v10v10.0.3 · 1×
github.com/dgrijalva/jwt-gov3.2.0+incompatible · 1×
github.com/felixge/httpsnoopv1.0.0 · 1×

Datastores touched

(mongodb)Database · 1 repos
janusDatabase · 1 repos

For agents

$ claude mcp add janus \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact