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

Ton Swieb ton at finalist.nl
Wed Jan 20 04:04:04 EST 2016


Hi Eric,

I see in JIRA that you found the bug. Good catch. Thanks for the quick
response.
Looking forward to Apiman v1.2.1.Final

Regards, Ton

2016-01-19 15:28 GMT+01:00 Eric Wittmann <eric.wittmann at redhat.com>:

> 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
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/apiman-user/attachments/20160120/eb6e4457/attachment.html 


More information about the Apiman-user mailing list