Repose Ninja - Hello World
This is the first in a series of Sprint-ly (Bi-Weekly) posts written by the Repose Ninja on Duty.
Have you ever ...
- ... needed to access Cloud Identity (OpenStack's Keystone) but didn't want to re-invent that wheel, again?
- ... had to figure out how to protect your service from malicious or even accidental denial of service attacks?
- ... developed (copy/pasted) the same functionality again and again as you created each new service?
Well, Repose can help with all of these things and many more.
What is Repose and how do I get help
Since this is the first of the Repose Ninja on Duty Sprint-ly posts, I thought I should introduce Repose a bit. Repose is a Reverse Proxy that helps protect/manage backend Origin Services, and the Repose Ninja on Duty is a position that all of the Repose developers rotate through. While assigned as the Ninja on Duty, we monitor:
- our public Freenode IRC channel #repose
- email to the ReposeCore@Rackspace.com list
- questions/comments on our Wiki
So, if you ever have any questions about how to set up, configure, and/or upgrade Repose, then feel free to reach out to us by using any of these methods. Oh yeah, I almost forgot, the Repose Ninja on Duty is also responsible for writing one of these posts.
Now that you know a little bit about who we are, you are probably wondering what Repose actually does or, more importantly, how it can help you. Repose is a series of Java Servlet Filters that execute with minimal overhead to perform various functions. Most installations are seeing around 4-6 ms added to response times, with some minimal installations down to only 1 ms. There are filters for:
- Rate Limiting
- API Management and Validation
- Header Management and Translation/Extraction
- Cloud Auditing Data Federation (CADF)/User Access Events (UAE) via the HERP and DERP filter combination
- and many more.
Some of the Repose filters are tailored, or specifically designed, for Rackspace API's, but most are generic and/or configurable enough to be useful to a broader range of developers. Most installations are using one or two filters targeting their specific environment, such as:
- Protect against DOS attacks using the Rate Limit filter
- API Version Management using the Versioning filter
- API Access control using the Simple Role Based Access Control (RBAC) or API Validation filters
Since Repose can do so many things, it would be impossible to cover them all in one post. There is also a wealth of documentation on the Wiki, so I will let you peruse that as well. However, on the off chance that Repose doesn't support your particular case, this post is going to concentrate on how to overcome this.
What can you do?
Hello World project to the rescue
The Repose Hello World project walks you through how you can create a custom filter bundle to add new functionality to Repose. This is a good option if you need something quick to prototype a new functionality before the Repose team has time to add it or if you need truly custom behavior that will never be added to the baseline.
Currently this project has examples in Java, Scala, and Groovy. Using these examples, any language that executes directly on the Java Virtual Machine (JVM) could be added. There are even plans to expand the Hello World project to include the following scripting languages that have been ported or bridged to the JVM:
- Python (Jython)
- Ruby (JRuby)
- Lua (LuaJ)
Let me close with this: Repose is Open Source and we are more than happy to accept external Pull Requests. Also, if you come across something that you would like us to go into in a future Repose Ninja on Duty post, then please contact us on IRC, email, or the Wiki.