Skip to content
This repository has been archived by the owner on Oct 26, 2022. It is now read-only.

Latest commit

 

History

History

httpbin-router

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Httpbin Router

Sample application demonstrating use of vgs-proxy-spring library.

The application is a router to httpbin service, the values which are sent to it are redacted via reverse proxy and revealed on request to httpbin via forward proxy.

Local setup

  1. Install ngrok
  2. Start ngrok with ngrok http 8080
  3. Go to VGS Dashboard
  4. Create sandbox vault and configure the routes the following way (use your ngrok address for Inbound destination url):

Httpbin routes on VGS Dashboard

  1. Add your forward proxy url to application.properties replacing <USERNAME> and <PASSWORD> with your proxy credentials
  2. Start the httpbin-router app with mvn spring-boot:run
  3. Send a curl request to verify request is proxied via VGS:
curl https://tntgssc4gig.SANDBOX.verygoodproxy.com/post \
  -H "Content-type: application/json" \
  -d '{"secret": "foo"}'
  1. Check the logs for redacted secret value using VGS proxy:
2018-07-20 12:24:01.974  INFO 88278 --- [nio-8080-exec-1] com.verygoodsecurity.HttpBinRouter       : Redacted JSON using VGS reverse proxy:
 {"secret":"tok_sandbox_dSDFUJwihGCSVwcsKWEJfa"}
  1. Check the logs for revealed secret value using VGS proxy:
2018-07-20 12:24:03.531  INFO 88278 --- [nio-8080-exec-1] com.verygoodsecurity.HttpBinRouter       : Revealed JSON after sending via VGS forward proxy:
 {
  "args": {}, 
  "data": "{\"secret\":\"foo\"}", 
  "files": {}, 
  "form": {}, 
  "headers": {
    "Accept": "text/plain, application/json, application/*+json, */*",  
    "Accept-Encoding": "gzip,deflate", 
    "Connection": "close", 
    "Content-Length": "16", 
    "Content-Type": "text/plain;charset=ISO-8859-1", 
    "Host": "httpbin.verygoodsecurity.io", 
    "User-Agent": "Apache-HttpClient/4.5.2 (Java/1.8.0_151)", 
    "Vgs-Request-Id": "cc0cbf4e84bc3fef", 
    "Via": "1.1 3c455ebab049"
  }, 
  "json": {
    "secret": "foo"
  }, 
  "origin": "52.6.216.177, 172.31.2.130", 
  "url": "https://httpbin.verygoodsecurity.io/post"
}