Application Request Routing (ARR) with HTTP Methods and Mule - redirect

I'm trying to redirect messages internet URL with the Application Request Routing (ARR), the component to the IIS in Windows Server.
I want to redirect that messages by the HTTP Method. Example:
HTTP POST: http://XXX.XXX.XXX.XX:7050/api/createUser
HTTP DELETE: http://XXX.XXX.XXX.XX:7050/api/deleteUser
HTTP PUT: http://XXX.XXX.XXX.XX:7050/api/modifyUser
The endpoint will be Mule (REST API Service with RAML).
Is it possible to make this filter?

I think you could do it by using choice router with this MEL expression #[message.inboundProperties.'http.method'] ?

Related

TR069 / CWMP Protocol Handling using Apace CXF - How to implement SOAP service?

Background:
I am trying to implement an Auto-configuration Server (ACS , CWMP protocol) using
Apache CXF.
CWMP uses SOAP for interaction between CPE and auto configuration server.
Section 3.4.1 of TR-069 Amendment 1 / CWMP describes the HTTP binding.
As per the spec for TR-069/CWMP, CPE sends SOAP request to ACS in HTTP Post and ACS shall put SOAP responses in HTTP response.
ACS shall also include SOAP requests towards CPE in an HTTP response send towards CPE.
Query:
While using Apache CXF for SOAP, is it possible to send SOAP requests inside HTTP responses ?
If so please provide any pointers ..

Change location header in redirect responses from HTTP to HTTPS in Kong API Gateway

I have the following setup
User Request --> AWS ELB Application load balancer --> Kong Gateway --> Integration
The SSL termination happens at application load balancer.
One of my endpoint makes the Integration respond a redirect URL with a code 302. Ex. when I make a request to https://api.domain.my/a/b/c should make the integration return a redirect path /x/y/z
This redirect request with a status of 302 reaches the API gateway which should add a location header to the response with the complete URL i.e. https://api.domain.my/x/y/z
But the response I get in the header on my browser is http://api.domain.my/x/y/z in the location header. I am guessing this is happening because my SSL termination happens at the ELB and hence Kong is just returning http:// in the location header.
Is there a workaround for this? How can I use the response transformer maybe to achieve this?
Is there any better way to achieve this?

Custom endpoint path for AWS API Gateway WebSocket

I have created an API Gateway with Websocket protocol.
After I deploy the API, I get a WebSocket URL and a connection URL.
e.g.
WebSocket URL: wss://xxxx.execute-api.us-west-2.amazonaws.com/test
Connection URL: https://xxxx.execute-api.us-west-2.amazonaws.com/test/#connections
Now everything is fine, I am able to connect to the API, and send and receive messages.
But when I try to access a different path, I get an HTTP 403 error.
e.g. If I try to connect to wss://xxxx.execute-api.us-west-2.amazonaws.com/test/some/path
, I get 403 error.
Is it possible to configure API gateway in such a way that it accepts connections to all paths and passes on the path, i.e. /some/path in my case, to the $connect route handler?
This is not yet supported by AWS. See the article and comments here https://medium.com/#lancers/using-parameter-mapping-in-websocket-api-67b414376d5e
There is a workaround with using an additional server, author of the article proposes the following:
you may put your own server that accepts an URI with path parameters, then return 302 to redirect the client to the WebSocket API endpoint with query string instead.

Keycloak API execute-actions-email sending http email

I'm running Keycloak and it works great. The only thing I'd like to change is when the execute-actions-email API is called it sends the email but the link uses HTTP. I'd like it to be HTTPS. How does KC determine it should use HTTP? Is it because I made the API call over HTTP to trigger the request? Doe it get it from the client config?
It uses whatever protocol was used to make the RESTfull call; just connect to KC on port 8443 (default SSL port) and it'll send the email with a link that uses HTTPS.

Best way redirect REST service request on glassfish + JAX-RS to https URL?

I have implemented a REST service on glassfish4 + JAX-RS. Now I want use a https connection for authentication.
The URI for http is http://myhost/myapp/services/rest/myservice and for https is https://myhost_2/myapp/services/rest/myservice. I want prevent the usage of http://myhost/myapp/services/rest/myservice.
I think one way is redirect a request over http://myhost in the REST JAX-RS class to https://myhost_2. Is this a good way? How can I implement this?
you could answer requests to http with 301 (Moved permanently, telling the client to use the new location in future requests) pointing to the https equivalent in the location header of the response.