[Apiman-user] Property placeholder within policy does not resolve in the gateway (v1.2.0.Final / APIMAN-831)

Eric Wittmann eric.wittmann at redhat.com
Tue Jan 19 09:28:59 EST 2016


Yes, environment variables are expected to work.  Let me write up a bug 
and I can look into the problem today.

Note that this is the code being used to resolve a single property by key:

https://github.com/apiman/apiman/blob/master/common/util/src/main/java/io/apiman/common/util/ApimanStrLookup.java

Here is a JIRA issue for tracking purposes:

https://issues.jboss.org/browse/APIMAN-904

-Eric

On 1/19/2016 5:44 AM, Ton Swieb wrote:
> Hi,
>
> I just tried it with a system property instead of a environment
> property. With a system property it works, but they are a bit cumbersome
> to supply to the apiman-wildfly docker image.
> Are environment variables expected to work?
>
> Regards, Ton
>
>
>
> 2016-01-19 11:25 GMT+01:00 Ton Swieb <ton at finalist.nl
> <mailto:ton at finalist.nl>>:
>
>     Hi,
>
>     I tried to take the property placeholder functionality for a test
>     drive, which should be available as of v1.2.0.Final. See JIRA:
>     https://issues.jboss.org/browse/APIMAN-831
>
>     But for some reason I do not get it to work. Did I configure
>     something wrong or am I running into a bug?
>
>     I use the property placeholder in the keycloak plugin which is
>     preconfigured in a Docker image.
>     I defined the realm property of the Keycloak plugin as
>     ${external_url}/auth/realms/apiman
>
>     I started my Docker image with the -e
>     external_url=https://192.168.99.100:8443 parameter to set the
>     environment variable within the Docker container.
>
>     When I try to access the API I get a failure in Keycloak Plugin saying:
>
>     {
>        "type": "Authentication",
>        "failureCode": 11004,
>        "responseCode": 401,
>        "message": "Token audience doesn't match domain. Token issuer ishttps://192.168.99.100:8443/auth/realms/apiman, but URL from configuration is ${external_url}/auth/realms/apiman",
>        "headers": {}
>     }
>
>     It looks like the property placeholder did not get resolved correctly.
>
>     When I have a look in the Docker image using docker exec -ti <name>
>     /binbash and do a list of the environment variables. The environment
>     variable is correctly defined:
>     MacBook-Pro-van-Ton:~ ton$ docker exec -ti tiny_wilson /bin/bash
>     [jboss at 43c099aae441 ~]$ export
>     declare -x APIMAN_VERSION="1.2.0.Final"
>     ....
>     declare -x external_url="https://192.168.99.100:8443"
>
>     I also tried setting the property to ${external_url} without the
>     '/auth/realms/apiman' suffix. I figured that it might perhaps will
>     do a full String comparison, but that did not work either.
>
>     Any ideas?
>
>     Regards, Ton
>
>
>
>
> _______________________________________________
> Apiman-user mailing list
> Apiman-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/apiman-user
>


More information about the Apiman-user mailing list