Skip to content

Commit

Permalink
Update personalization and proxy placeholders for outbound
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Malogulko committed Sep 3, 2020
1 parent c1a78c8 commit 8666f57
Show file tree
Hide file tree
Showing 13 changed files with 38 additions and 33 deletions.
7 changes: 6 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
.idea
.idea
**/personalized-inbound-integration.*
**/personalized-outbound-integration.*
**/node_modules
**/results.txt
content-by-language/node/package*.json
4 changes: 2 additions & 2 deletions content-by-language/bash/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
echo "{\"bash\": \
{\"inbound\": $(bash inbound-integration.sh | jq tostring), \
\"outbound\": $(bash outbound-integration.sh | jq tostring)}}" > results.txt
{\"inbound\": $(bash personalized-inbound-integration.sh | jq tostring), \
\"outbound\": $(bash personalized-outbound-integration.sh | jq tostring)}}" > results.txt
4 changes: 2 additions & 2 deletions content-by-language/go/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# sed 's/pattern/replacement/flags'
echo "{\"go\": {\"inbound\": \"$(echo $(./inbound-integration) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(./outbound-integration) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
echo "{\"go\": {\"inbound\": \"$(echo $(./personalized-inbound-integration) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(./personalized-outbound-integration) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
2 changes: 1 addition & 1 deletion content-by-language/java/outbound-integration.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

public class OutboundIntegration {
public static void main(String[] args) throws IOException, GeneralSecurityException {
final String proxyHost = "{VAULT_URL}";
final String proxyHost = "{VAULT_PROXY_URL}";
final int proxyPort = {PORT};
final String proxyUser = "{USERNAME}";
final String proxyPassword = "{PASSWORD}";
Expand Down
4 changes: 2 additions & 2 deletions content-by-language/java/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# sed 's/pattern/replacement/flags'
echo "{\"java\": {\"inbound\": \"$(echo $(java inbound-integration.java) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"\"}}" > results.txt
echo "{\"java\": {\"inbound\": \"$(echo $(java personalized-inbound-integration.java) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"\"}}" > results.txt
4 changes: 2 additions & 2 deletions content-by-language/node/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
npm install
# sed 's/pattern/replacement/flags'
echo "{\"node\": {\"inbound\": \"$(echo $(node inbound-integration.js) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(node outbound-integration.js) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
echo "{\"node\": {\"inbound\": \"$(echo $(node personalized-inbound-integration.js) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(node personalized-outbound-integration.js) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
4 changes: 2 additions & 2 deletions content-by-language/php/outbound-integration.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<?php
$url = '{VGS_SAMPLE_ECHO_SERVER}/post';
$data = json_encode(array('account_number' => '{ALIAS}'));
$proxy = '{VAULT_URL}:{PORT}';
$proxy = '{VAULT_PROXY_URL}:{PORT}';
$proxyauth = '{ACCESS_CREDENTIALS}';
$certpath = '{CERT_LOCATION}';

$cURL = curl_init();
$options = array(
$options = array(
CURLOPT_URL => $url,
CURLOPT_PROXY => $proxy,
CURLOPT_PROXYUSERPWD => $proxyauth,
Expand Down
4 changes: 2 additions & 2 deletions content-by-language/php/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# sed 's/pattern/replacement/flags'
echo "{\"php\": {\"inbound\": \"$(echo $(php inbound-integration.php) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(php outbound-integration.php) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
echo "{\"php\": {\"inbound\": \"$(echo $(php personalized-inbound-integration.php) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(php personalized-outbound-integration.php) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
2 changes: 1 addition & 1 deletion content-by-language/python/outbound-integration.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
import requests

os.environ['HTTPS_PROXY'] = 'https://{ACCESS_CREDENTIALS}@{VAULT_HOST}:{PORT}'
os.environ['HTTPS_PROXY'] = 'http://{ACCESS_CREDENTIALS}@{VAULT_HOST}:{PORT}'
response = requests.post('{VGS_SAMPLE_ECHO_SERVER}/post',
json={'account_number': '{ALIAS}'},
verify='{CERT_LOCATION}')
Expand Down
4 changes: 2 additions & 2 deletions content-by-language/python/run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
pip install -r requirements.txt
# sed 's/pattern/replacement/flags'
echo "{\"python\": {\"inbound\": \"$(echo $(python3 inbound-integration.py) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(python3 outbound-integration.py) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
echo "{\"python\": {\"inbound\": \"$(echo $(python3 personalized-inbound-integration.py) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(python3 personalized-outbound-integration.py) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
2 changes: 1 addition & 1 deletion content-by-language/ruby/outbound-integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
require 'net/http'
require 'net/https'

proxy = URI.parse('https://{ACCESS_CREDENTIALS}@{VAULT_HOST}:{PORT}')
proxy = URI.parse('http://{ACCESS_CREDENTIALS}@{VAULT_HOST}:{PORT}')
uri = URI.parse('{VGS_SAMPLE_ECHO_SERVER}/post')
http = Net::HTTP.new(uri.host, uri.port, proxy.host, proxy.port, proxy.user, proxy.password)
http.use_ssl = true
Expand Down
4 changes: 2 additions & 2 deletions content-by-language/ruby/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
# sed 's/pattern/replacement/flags'
echo "{\"ruby\": {\"inbound\": \"$(echo $(ruby inbound-integration.rb) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(ruby outbound-integration.rb) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
echo "{\"ruby\": {\"inbound\": \"$(echo $(ruby personalized-inbound-integration.rb) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\", \
\"outbound\": \"$(echo $(ruby personalized-outbound-integration.rb) | sed 's/\\/\\\\/g' | sed 's/"/\\"/g')\"}}" > results.txt
Loading

0 comments on commit 8666f57

Please sign in to comment.