New rackspace auth identity filter

For grins, I reimplemented the poorly named content-identity filters for Rackspace Identity.

I called it the "Rackspace Auth Identity Filter" so it would fit along the lines of the "IP Identity" filter, which uses your IP address as your user. 

This uses Rackspace Authentication parsing logic to get the username out of a myriad of responses.

It uses the builtin scala XML parsing library to read XML responses, and it uses play-json to parse the JSON responses in a similar manner.

Open to comments, but I think it's substantially less confusing than the existing filters, and it's got way less dependencies. The code is cleaner, easier to understand (even though it's in scala).

I think we can probably ship this as part of any release of Repose, not just the latest one.
In order to avoid having to pass in the header manager and since the same logic is called on an IdentityGroupConfig, I pass a function in. 

This function is called here. That function is defined further up and it indicates what is going to be done. Namely setting the user and group headers. 

On September 29, 2014 4:21:44 PM EDT, Adrian J George III <notifications@github.com> wrote:
>> +    val group = config.getGroup
>> +    val quality = config.getQuality
>> +
>> +    val limit = BigInt(config.getContentBodyReadLimit).toLong
>> +    val limitedInputStream = new LimitedReadInputStream(limit,
>inputStream) //Allows me to reset?
>> +    try {
>> +      val usernameOpt = if (contentType.contains("xml")) {
>> +        //It's probably xml, lets try to xpath it
>> +        xml(limitedInputStream)
>> +      } else {
>> +        //Try to run it through the JSON pather
>> +        json(limitedInputStream)
>> +      }
>> +
>> +      usernameOpt.map { username =>
>> +        f(config, username)
>
>?
>
>---
>Reply to this email directly or view it on GitHub:
>https://github.com/rackerlabs/repose/pull/1124/files#r18180437

-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.