[Apiman-user] Changing gateway endpoints

Eric Wittmann eric.wittmann at redhat.com
Tue May 3 11:52:36 EDT 2016


Yes I think I didn't understand your question last time.

Currently the full managed endpoint in apiman looks like this:

http(s)://host:port/apiman-gateway/ORG_ID/API_ID/VERSION/path/to/blah

The instructions I sent last time would only allow you to change the 
"apiman-gateway" part of the URL, which is what I thought you were 
looking for (e.g. to change that to /apis).

The rest of the URL is dictated by code, as you observed.  We have an 
outstanding Feature Request which would allow each API to specify a 
custom endpoint URL, rather than forcing the format above.  However we 
haven't yet implemented that feature.

Your only choices in the short term would be to modify apiman code, or 
maintain your own mappings and implement something like a servlet filter 
to enforce them.

As for HTTPS - you don't want to use port 80 for HTTPS.  The default 
port for SSL is 443 - so if you want the following URL to work:

https://host/path/to/something

...then you want to set your SSL port to be 443 (that's the default port 
your browser will use when connecting via https).

-Eric



On 5/3/2016 10:48 AM, Christopher Stolte wrote:
> Upon further investigation, it seems that APIMAN dictates the URL structure for a managed endpoint. Namely:
>
>  /ORG_ID/API_ID/VERSION/path/to/resource
>
> I found this enforced, for example, in io.apiman.gateway.platforms.servlet.GatewayServlet#readRequest(request).
>
> Is that true? Would I need to change that code (and probably other code too) in order to deploy to an arbitrary URL structure?
> Also, I didn't have much luck using port 80 for SSL. (I tried changing the socket-binding in standalone.xml). What I really want is a managed endpoint like this:
>
> https://mydomain.com/apis/arbitrary/endpoint/resource
>
> I don't know if this is possible shy of code changes - has anyone else attempted this or similar? Thanks for any pointers or guidance!
>
> ________________________________________
> From: Eric Wittmann <eric.wittmann at redhat.com>
> Sent: Tuesday, April 19, 2016 10:32:26 AM
> To: Christopher Stolte; apiman-user at lists.jboss.org
> Subject: Re: [Apiman-user] Changing gateway endpoints
>
> Assuming you are running apiman in WildFly or EAP (typical use) here is
> what you need to do to change the apiman endpoint:
>
> 1) Modify the "jboss-web.xml" file inside the apiman-gateway.war file
> (you can find it in WEB-INF).
>
> 2) Change the <context-root> to whatever you want it to be
>
> 3) Deploy the changed WAR to EAP/WildFly
>
> 4) Profit!
>
> Here is the file in question within the apiman source code:
>
> https://github.com/apiman/apiman/blob/master/gateway/platforms/war/wildfly8/gateway/src/main/webapp/WEB-INF/jboss-web.xml#L3
>
> If you are running apiman on tomcat or jetty, you'll need to do
> something different - so let me know. :)
>
> -Eric
>
> On 4/18/2016 3:33 PM, Christopher Stolte wrote:
>> Hi All,
>>
>>
>> I am trying to change the gateway endpoint so that managed endpoints for
>> my services have a public URL under my control (for example maybe
>> http://my.domain.com/apis).  I found this discussion:
>>
>>
>> http://lists.jboss.org/pipermail/apiman-user/2015-October/000324.html
>>
>>
>> Is changing the gateway WAR the only way to achieve this?  Maybe I'm
>> missing a more obvious way to affect the managed endpoint?  If that is
>> the way to go about it, can someone give me an idea of where in the code
>> to do that?
>>
>>
>> Thanks for any help!
>>
>>
>>
>> _______________________________________________
>> 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