Is it possible to get the IP Address of a REST service's caller via an Aspect? If so, how can it be done?
Related
I'm trying to achieve mocked responses for certain endpoints for UI testing in XCUITests. However all the available mock servers set the url at the start of the test and hence all the requests go through them.
How can I make only specific requests to go through the local mock server and rest of the requests to go through the default prod / stage endpoints?
checkout http://wiremock.org/. There is proxy setting that allow you to redirect URL to actual end points v/s mock end point. Technical name is proxy stub mapping : http://wiremock.org/docs/proxying/
Copy And Paste from documents
Proxy stub mappings
Proxy responses are defined in exactly the same manner as stubs, meaning that the same request matching criteria can be used.
The following code will proxy all GET requests made to http://:/other/service/.* to http://otherservice.com/approot, e.g. when running WireMock locally a request to http://localhost:8080/other/service/doc/123 would be forwarded to http://otherservice.com/approot/other/service/doc/123.
I need to simulate real user behavior. Each of real user must have new IP. Can I set Proxy programmatically via jmeter ? Example - I launch tests without Proxy, then, after 1-2 sec I activate the proxy and after 3-4 sec - I disable. Is that possible without stopping the test ?
If you need to spoof the ids then you can use csv to get the different IPs (proxy IPs) and pass them as a variable in the HTTP Request Server Name field under advanced tab as shown below:-
Please check this article for more information.
I hope this help.
There is a possibility to define a proxy per HTTP Request, the relevant configuration lives on "Advanced" tab of the HTTP Request sampler.
A better option would be going for IP Spoofing, this way you will be able to bind each virtual user to a real (or virtual) IP address so source address will be different.
I do not know How to cancel VLAN FireWall by rest api.
There was nothing like deleteObject method of SoftLayer_Network_Vlan or SoftLayer_Network_Vlan_Firewall service.
So, Please tell me how to cancel VLAN FireWall by rest api.
Thanks.
I recomed you to read this article:
https://sldn.softlayer.com/node/274103 (Getting started with REST and the SoftLayer Billing API)
Basically you need to camcel the associated billingItem of your VLAN for that you can use the https://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelService or the https://sldn.softlayer.com/reference/services/SoftLayer_Billing_Item/cancelItem methods
I have created an API using AWS API Gateway. Now I want to log each of the request on each method of each resource. Also, I need the source IP address of the client accessing the route. How can I accomplish this without writing custom code in the API functions ?
The default CloudWatch logs for your API should include all headers, including the X-Forwarded-For header which will contain the source IP address. (See http://docs.aws.amazon.com/apigateway/latest/developerguide/how-to-stage-settings.html)
If you need custom logging you will need to implement this in your Lambda functions. You could take advantage of something like Apex or Serverless and write some automation to manage your Lambda functions and share duplicate code.
Looking through the XirSys API, I don't see a way to simply get my IP address as it visible from XirSys.
Is that possible to get via the exposed API?
The XirSys STUN servers do exactly that, but it's not something you can request from an HTTP request. If you're using a middleware server (for security), however, then you can do this in pretty much any language. See for example: How to get the client IP address in PHP?