Rep 900

If the regex is there you use the Id from it, if not you either use a default project Id or just don't do anything.  I could combine the none case and put the if inside the case

Sent from my iPhone

On Oct 4, 2014, at 1:04 PM, Adrian J George III <notifications@github.com<mailto:notifications@github.com>> wrote:


In repose-aggregator/components/filters/openstack-identity-v3/src/main/scala/com/rackspace/papi/components/openstack/identity/v3/OpenStackIdentityV3Handler.scala:

> @@ -121,9 +121,18 @@ class OpenStackIdentityV3Handler(identityConfig: OpenstackIdentityV3Config, iden
>            requestHeaderManager.appendHeader(PowerApiHeader.USER.toString, id, 1.0)
>          }
>          token.get.user.rax_default_region.map { requestHeaderManager.putHeader(OpenStackIdentityV3Headers.X_DEFAULT_REGION.toString, _) }
> -        token.get.project.map { project =>
> -          project.id.map(requestHeaderManager.putHeader(OpenStackIdentityV3Headers.X_PROJECT_ID.toString, _))
> -          project.name.map(requestHeaderManager.putHeader(OpenStackIdentityV3Headers.X_PROJECT_NAME.toString, _))
> +        if(identityConfig.isSendAllProjectIds) {
> +          writeProjectHeader(token.flatMap(_.project.flatMap(_.id)).orNull, token.flatMap(_.roles).orNull, writeAll = true, filterDirector)
> +        } else {
> +          projectIdUriRegex match {
> +            case Some(regex) => writeProjectHeader(extractProjectIdFromUri(projectIdUriRegex.get, request.getRequestURI).orNull, token.flatMap(_.roles).get, writeAll = false, filterDirector)
> +            case None if token.flatMap(_.project).flatMap(_.id).isDefined =>


Two None cases? I'm guessing this if delineates them, but i'm not familiar with what this means

—
Reply to this email directly or view it on GitHub<https://github.com/rackerlabs/repose/pull/1133/files#r18430738>.