NR-610 : Complete the security gateway

Enhanced the ally processing to better support the complexity
of the new gateway structures, also added support for gateway
to be able to make the requests on external servers.