Giter Club home page Giter Club logo

maif / otoroshi Goto Github PK

View Code? Open in Web Editor NEW
235.0 17.0 37.0 339.45 MB

Lightweight api management on top of a modern http reverse proxy

Home Page: https://www.otoroshi.io

License: Apache License 2.0

Shell 0.46% Scala 71.55% CSS 0.45% JavaScript 25.67% HTML 0.28% Rust 0.60% Java 0.23% Dockerfile 0.02% Go 0.07% SCSS 0.59% Smarty 0.02% StringTemplate 0.05% TypeScript 0.01%
proxy reverse-proxy http http-proxy scala akka playframework loadbalancer microservices api-management

otoroshi's Introduction

Otoroshi

Join the discord Download Build status

Otoroshi http reverse proxy and api management

Otoroshi is a layer of lightweight api management on top of a modern http reverse proxy written in Scala and developed by the MAIF OSS team that can handle all the calls to and between your microservices without service locator and let you change configuration dynamically at runtime.

Otoroshi is built on top of akka and playframework.

Reference Documentation

The reference documentation is available at https://maif.github.io/otoroshi/manual/

Roadmap

You can find the roadmap or topics considered for the roadmap in the Roadmap 2024 project.

The roadmap for 2023 is also available here.

Community

You can join these groups and chats to discuss and ask Otoroshi related questions:

  • Issue tracker: github: MAIF/otoroshi/issues
  • Pull request: github: MAIF/otoroshi/pulls
  • Chat room: Join the chat on Discord

Contributing

Contributions are very welcome!

If you see an issue that you'd like to see fixed, the best way to make it happen is to help out by submitting a pull request implementing it.

Refer to the CONTRIBUTING.md file for more details about the workflow, and general hints on how to prepare your pull request. You can also ask for clarifications or guidance in GitHub issues directly.

License

Otoroshi is Open Source and available under the Apache 2 License.

otoroshi's People

Contributors

baudelotphilippe avatar cwoodrow avatar dependabot[bot] avatar desmfr avatar fedysalahserli avatar guillaumesolderaserli avatar larousso avatar lucbu avatar mathieuancelin avatar mathieuancelinserli avatar omahs avatar ptitficus avatar quentinovega avatar sebprunierserli avatar snyk-bot avatar tristan-chauveau avatar zwiterrion avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

otoroshi's Issues

Page not Found

Select "Priv Apps Sessions" in the Select topbar -> http://.../bo/dashboard/sessions

Not found

Update Elastic connector

need to support :

/api/v1/events/:type/_count
/api/v1/events/:type/:field/_sum
/api/v1/events/:type/:field/_avg
/api/v1/events/:type/:field/_piechart
/api/v1/events/:type/:field/_histogram/stats
/api/v1/events/:type/:field/_histogram/percentiles

Verify origin in BackOffice actions

Otoroshi should verify Origin or Referer headers (if available) in BackOfficeAction to validate that the request actually comes from the BackOffice

Elastic support

Should we

  • support sending events to elastic using standard elastic api
  • improve the elastic connector

[error] otoroshi-analytics-actor - SEND_TO_ANALYTICS_ERROR

We got these kind of error logs recently on our Otoroshi instance :

[error] otoroshi-analytics-actor - SEND_TO_ANALYTICS_ERROR: analytics actor error : Failure(java.lang.IllegalStateException: Stream is terminated. SourceQueue is detached)

Note: we did not activate Analytics.

After a restart, everything seems ok.

[error] otoroshi-error-handler - Server Error Clock is running backward

We got this error today during a few minutes :

[error] otoroshi-error-handler - Server Error Clock is running backward. Sorry :-( on /v1/infos/categories
2018-01-16T16:31:51.197+01:00java.lang.RuntimeException: Clock is running backward. Sorry :-(
2018-01-16T16:31:51.197+01:00at security.IdGenerator$.nextId(generators.scala:27)
2018-01-16T16:31:51.197+01:00at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
2018-01-16T16:31:51.197+01:00at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
2018-01-16T16:31:51.198+01:00at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:99)
2018-01-16T16:31:51.198+01:00at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:346)
2018-01-16T16:31:51.198+01:00at scala.concurrent.Future$$anonfun$recoverWith$1.apply(Future.scala:345)
2018-01-16T16:31:51.198+01:00at security.IdGenerator.nextId(generators.scala:7)
2018-01-16T16:31:51.198+01:00at gateway.Errors$.craftResponseResult(errors.scala:25)
2018-01-16T16:31:51.198+01:00at gateway.ErrorHandler.onServerError(handlers.scala:56)
2018-01-16T16:31:51.198+01:00at play.core.server.netty.PlayRequestHandler$$anonfun$2$$anonfun$apply$1.applyOrElse(PlayRequestHandler.scala:100)
2018-01-16T16:31:51.199+01:00at security.IdGenerator$.nextId(generators.scala:27)
2018-01-16T16:31:51.199+01:00at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32)
2018-01-16T16:31:51.199+01:00at security.IdGenerator.nextId(generators.scala:7)
2018-01-16T16:31:51.199+01:00at play.api.libs.iteratee.Execution$trampoline$.execute(Execution.scala:70)
2018-01-16T16:31:51.199+01:00at gateway.Errors$.craftResponseResult(errors.scala:25)

Our config :

  • Otoroshi deployed on Clever Cloud
  • 2 M instances

Event based cluster (master / workers) mode

The goal here is to provide a mode where an Otoroshi instance (with a redis or cassandra backend) is the master (that does not handle traffic) and send all its internal state changes to a Kafka topic.

Other Otoroshi instances, the workers (with an in memory storage) will be connected to the same kafka topic. At statup, a worker will ask the state of the master, then will receive the flow of masters internal state changes.

This mode will be a good way to scale easily Otoroshi while providing great performance an in memory backed Otoroshi instance introduce almost no overhead

Tasks

  • Remote Worker config
    • Kafka config
    • Kafka topic
    • master / worker
  • Expose remote worker config in UI
  • Expose remote worker config in Swagger
  • Expose remote worker config in CLI
  • For master instance
    • listen to messages asking for full internal state
    • listen to messages like alerts to broadcast them ?
    • send commands (from the ApiController maybe ?) to the kafka topic
  • For worker instance
    • asking for full internal state at startup
    • sending message to say instance is ready
    • listen to command messages and trigger Api according to it
      • do not mutate workers admin api service from master
      • do not mutate workers admin users from master
      • do not mutate workers admin sessions from master
      • do not mutate workers private sessions from master
      • do not mutate remote worker config when global config changes from master
      • do not mutate auth0 stuff when global config changes from master
      • do not mutate clevercloud stuff when global config changes from master

Upgrade to Play 2.6

We should update play to last version.

But using Akka http as backend could introduce some regressions

  • move to play 2.6
  • use scala 2.12
  • update scala dependencies
  • fix performance issues
  • merge PR
  • update documentation about change config keys, etc ...

Alternative https port for admin API/UI

Proposal

Can you consider adding an option to choose a different https port for the admin API & UI ?

Benefit

We will be able to bloc traffic from internet on this port with a firewall and open it only for internals IPs and enforce the security.

open-sourcing

  • finish mvp doc
  • add gitter.im page
  • add travis build
  • add bintray for libraries
  • publish otoroshi images on docker repository (bintray)
  • write the otoroshi landing page
  • rewrite build on CC
  • push otoroshi code
  • push cli code
  • push connectors code
  • create a root readme
  • create a root/otoroshi readme
  • add badges on root readme
  • add badges on root manual index
  • change jar URL on root manual index
  • change jar URL on manual quickstart
  • change urls in manual get otoroshi
  • shutdown tryout
  • write code of conduct
  • write contribution guide
  • write issue template
  • write PR template
  • push snapshots somewhere
  • close old issues
  • provide docker tryout

shields at https://shields.io/

Fix bad behavior of rps counters

val callsShiftGlobalTime = redisCli.lpushLong(serviceCallStatsKey("global"), time).flatMap { _ =>
  redisCli.ltrim(serviceCallStatsKey("global"), 0, maxQueueSize)
  redisCli.expire(serviceCallStatsKey("global"), 10) 
}
val callsShiftServiceTime = redisCli.lpushLong(serviceCallStatsKey(id), time).flatMap { _ =>
  redisCli.ltrim(serviceCallStatsKey(id), 0, maxQueueSize)
  redisCli.expire(serviceCallStatsKey(id), 10)
}

JWT as apikey enhancements

  • JWT apikey can be passed in Authorization: Bearer header
  • JWT apikey can be passed in Otoroshi-Authorization: Bearer header
  • apikey clientId should be passed using standard iss field instead of custom clientId
  • original JWT token should be passed to target if in Authorization header

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.