Skip to content

Commit 6a3a33d

Browse files
ovadbarandywolk
authored andcommitted
Changes to add tests
1 parent 1d2fa3d commit 6a3a33d

File tree

5 files changed

+232
-32
lines changed

5 files changed

+232
-32
lines changed

src/mod/applications/mod_http_cache/Makefile.am

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,16 @@ mod_http_cache_la_CPPFLAGS = $(CURL_CFLAGS) $(AM_CPPFLAGS)
1111
mod_http_cache_la_LIBADD = $(switch_builddir)/libfreeswitch.la libhttpcachemod.la
1212
mod_http_cache_la_LDFLAGS = $(CURL_LIBS) -avoid-version -module -no-undefined -shared
1313

14-
noinst_PROGRAMS = test/test_aws
14+
noinst_PROGRAMS = test/test_aws test/test_gcs
1515

1616
test_test_aws_SOURCES = test/test_aws.c
1717
test_test_aws_CFLAGS = $(AM_CFLAGS) -I. -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\"
1818
test_test_aws_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS)
1919
test_test_aws_LDADD = libhttpcachemod.la
2020

21-
TESTS = $(noinst_PROGRAMS)
21+
test_test_gcs_SOURCES = test/test_gcs.c
22+
test_test_gcs_CFLAGS = $(AM_CFLAGS) -I. -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\"
23+
test_test_gcs_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) -lcurl
24+
test_test_gcs_LDADD = libhttpcachemod.la
2225

26+
TESTS = $(noinst_PROGRAMS)

src/mod/applications/mod_http_cache/gcs.c

Lines changed: 37 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,7 @@ struct http_data {
4242
};
4343

4444
#if defined(HAVE_OPENSSL)
45-
char *encoded_token(const char *token_uri, const char *client_email, const char *private_key_id, int *token_length) {
46-
time_t now = time(NULL);
45+
char *encoded_token(const char *token_uri, const char *client_email, const char *private_key_id, int *token_length, time_t now) {
4746
time_t then = now + 3600;
4847
int tlength = 1 + snprintf(NULL, 0, "{\"typ\":\"JWT\",\"alg\":\"RS256\",\"kid\":\"%s\"}", private_key_id);
4948
int payload_length = 1 + snprintf(NULL, 0, "{\"iat\":\"%ld\",\"exp\":\"%ld\",\"iss\":\"%s\",\"aud\":\"%s\",\"scope\":\"https://www.googleapis.com/auth/devstorage.full_control https://www.googleapis.com/auth/devstorage.read_only https://www.googleapis.com/auth/devstorage.read_write\"}", now, then, client_email,token_uri);
@@ -93,7 +92,8 @@ switch_status_t gcs_refresh_authorization (http_profile_t *profile)
9392
char content[GCS_SIGNATURE_LENGTH_MAX];
9493
char *signature_url_encoded = NULL;
9594
time_t exp;
96-
token = encoded_token(profile->region, profile->gcs_email, profile->aws_s3_access_key_id, &token_length);
95+
time_t now = time(NULL);
96+
token = encoded_token(profile->region, profile->gcs_email, profile->aws_s3_access_key_id, &token_length, now);
9797
encoded = malloc(sizeof(char) * 343);
9898
signtoken(token, token_length, profile->secret_access_key, encoded);
9999
assertion = malloc(sizeof(char) * (1 + token_length + 343));
@@ -102,14 +102,11 @@ switch_status_t gcs_refresh_authorization (http_profile_t *profile)
102102
signature_url_encoded = switch_string_replace(assertion, "+", "%2B");
103103
sprintf(content,"%s%s", "grant_type=urn%3Aietf%3Aparams%3Aoauth%3Agrant-type%3Ajwt-bearer&assertion=", signature_url_encoded);
104104
auth = gcs_auth_request(content, profile->region);
105-
if (profile->gcs_credentials != NULL) {
106-
free(profile->gcs_credentials);
107-
}
108105
profile->gcs_credentials = auth;
109-
exp = time(NULL) + 3540;
106+
exp = now + 3540;
110107
profile->expires = exp;
111108
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Credentials Expries Unix Time: %ld", exp);
112-
free(assertion);
109+
switch_safe_free(assertion);
113110
return SWITCH_STATUS_SUCCESS;
114111
}
115112
#endif
@@ -190,19 +187,26 @@ switch_status_t gcs_config_profile(switch_xml_t xml, http_profile_t *profile,swi
190187
return status;
191188
}
192189
json = cJSON_Parse(contents);
193-
194-
jsonstr = cJSON_GetObjectItem(json,"private_key_id")->valuestring;
195-
profile->aws_s3_access_key_id = malloc(sizeof(char) * (1+ strlen(jsonstr)));
196-
strcpy(profile->aws_s3_access_key_id, jsonstr);
197-
jsonstr = cJSON_GetObjectItem(json,"private_key")->valuestring;
198-
profile->secret_access_key = malloc(sizeof(char) * (1+ strlen(jsonstr)));
199-
strcpy(profile->secret_access_key, jsonstr);
200-
jsonstr = cJSON_GetObjectItem(json,"client_email")->valuestring;
201-
profile->gcs_email = malloc(sizeof(char) * (1+ strlen(jsonstr)));
202-
strcpy(profile->gcs_email, jsonstr);
203-
jsonstr = cJSON_GetObjectItem(json,"token_uri")->valuestring;
204-
profile->region = malloc(sizeof(char) * (1+ strlen(jsonstr)));
205-
strcpy(profile->region, jsonstr);
190+
if (cJSON_GetObjectItem(json,"private_key_id") != NULL) {
191+
jsonstr = cJSON_GetObjectItem(json,"private_key_id")->valuestring;
192+
profile->aws_s3_access_key_id = malloc(sizeof(char) * (1+ strlen(jsonstr)));
193+
strcpy(profile->aws_s3_access_key_id, jsonstr);
194+
}
195+
if (cJSON_GetObjectItem(json,"private_key") != NULL) {
196+
jsonstr = cJSON_GetObjectItem(json,"private_key")->valuestring;
197+
profile->secret_access_key = malloc(sizeof(char) * (1+ strlen(jsonstr)));
198+
strcpy(profile->secret_access_key, jsonstr);
199+
}
200+
if (cJSON_GetObjectItem(json,"client_email") != NULL) {
201+
jsonstr = cJSON_GetObjectItem(json,"client_email")->valuestring;
202+
profile->gcs_email = malloc(sizeof(char) * (1+ strlen(jsonstr)));
203+
strcpy(profile->gcs_email, jsonstr);
204+
}
205+
if (cJSON_GetObjectItem(json,"token_uri") != NULL) {
206+
jsonstr = cJSON_GetObjectItem(json,"token_uri")->valuestring;
207+
profile->region = malloc(sizeof(char) * (1+ strlen(jsonstr)));
208+
strcpy(profile->region, jsonstr);
209+
}
206210
cJSON_Delete(json);
207211
free(contents);
208212
} else {
@@ -297,21 +301,24 @@ char *gcs_auth_request(char *content, char *url) {
297301
switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *)&http_data);
298302

299303
res = switch_curl_easy_perform(curl_handle);
300-
curl_easy_cleanup(curl_handle);
304+
switch_curl_easy_cleanup(curl_handle);
305+
306+
if(res != CURLE_OK)
307+
fprintf(stderr, "curl_easy_perform() failed: %s\n",
308+
switch_curl_easy_strerror(res));
301309

302310
if (http_data.stream.data && !zstr((char *) http_data.stream.data) && strcmp(" ", http_data.stream.data)) {
303311
cJSON *json = {0};
304-
char *jsonstr;
305312
json = cJSON_Parse(http_data.stream.data);
306-
jsonstr = cJSON_GetObjectItem(json,"access_token")->valuestring;
307-
response = malloc(sizeof(char) * (1+strlen(jsonstr)));
308-
strcpy(response, jsonstr);
313+
314+
if (cJSON_GetObjectItem(json,"access_token") != NULL) {
315+
char *jsonstr;
316+
jsonstr = cJSON_GetObjectItem(json,"access_token")->valuestring;
317+
response = malloc(sizeof(char) * (1+strlen(jsonstr)));
318+
strcpy(response, jsonstr);
319+
}
309320
cJSON_Delete(json);
310321
}
311-
312-
if(res != CURLE_OK)
313-
fprintf(stderr, "curl_easy_perform() failed: %s\n",
314-
switch_curl_easy_strerror(res));
315322
return response;
316323
}
317324
#endif
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
/*
2+
* aws.h for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
3+
* Copyright (C) 2013-2014, Grasshopper
4+
*
5+
* Version: MPL 1.1
6+
*
7+
* The contents of this file are subject to the Mozilla Public License Version
8+
* 1.1 (the "License"); you may not use this file except in compliance with
9+
* the License. You may obtain a copy of the License at
10+
* http://www.mozilla.org/MPL/
11+
*
12+
* Software distributed under the License is distributed on an "AS IS" basis,
13+
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
14+
* for the specific language governing rights and limitations under the
15+
* License.
16+
*
17+
* The Original Code is aws.h for FreeSWITCH Modular Media Switching Software Library / Soft-Switch Application
18+
*
19+
* The Initial Developer of the Original Code is Grasshopper
20+
* Portions created by the Initial Developer are Copyright (C)
21+
* the Initial Developer. All Rights Reserved.
22+
*
23+
* Contributor(s):
24+
* Chris Rienzo <[email protected]>
25+
* Quoc-Bao Nguyen <[email protected]>
26+
*
27+
* test_aws.c - Unit tests for functions in aws.c
28+
*
29+
*/
30+
31+
#include <switch.h>
32+
#include <test/switch_test.h>
33+
#include "../gcs.c"
34+
#include <stdlib.h>
35+
36+
// Run test
37+
// make && libtool --mode=execute valgrind --leak-check=full --log-file=vg.log ./test/test_aws && cat vg.log
38+
39+
FST_BEGIN()
40+
{
41+
42+
FST_SUITE_BEGIN()
43+
{
44+
45+
FST_SETUP_BEGIN()
46+
{
47+
}
48+
FST_SETUP_END()
49+
50+
FST_TEARDOWN_BEGIN()
51+
{
52+
}
53+
FST_TEARDOWN_END()
54+
55+
#if defined(HAVE_OPENSSL)
56+
FST_TEST_BEGIN(encoded_token)
57+
{
58+
//char *encoded_token(const char *token_uri, const char *client_email, const char *private_key_id, int *token_length, time_t now) {
59+
time_t now = 1615402513;
60+
char *token = NULL;
61+
int token_length;
62+
token = encoded_token("https://accounts.google.com/o/oauth2/token", "[email protected]", "667265657377697463682D676373", &token_length, now);
63+
fst_check_string_equals("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjY2NzI2NTY1NzM3NzY5NzQ2MzY4MkQ2NzYzNzMifQ.eyJpYXQiOiIxNjE1NDAyNTEzIiwiZXhwIjoiMTYxNTQwNjExMyIsImlzcyI6Imdjc0BmcmVlc3dpdGNoLmNvbSIsImF1ZCI6Imh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi90b2tlbiIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9kZXZzdG9yYWdlLmZ1bGxfY29udHJvbCBodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2RldnN0b3JhZ2UucmVhZF9vbmx5IGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvZGV2c3RvcmFnZS5yZWFkX3dyaXRlIn0", token);
64+
free(token);
65+
}
66+
FST_TEST_END()
67+
68+
FST_TEST_BEGIN(signtoken)
69+
{
70+
//void signtoken(char *token, int tokenlen,char *pkey, char *out) {
71+
char *encoded = NULL;
72+
char *pkey = "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCXiVOV3h61llym\nnpHamUHsuVjrdDiEQnNX1KA4k/kcfP+gqRjL9m3YAxXfUA9GFCIC2OYvdciW3Ggm\nt4CSYmSltljKjbN2JHs7iNQw4CcFfiAXhxL0TYNhNE9wBDOZRsC1Uusv38RPwqwd\n922pAGzF+PqNE2j+zSxlNOnlJfyJDMKrqCGV8CclS+j/u41MaT6cpOlHP6KgaS01\nJJVyaqLpnMLWAx9/5G6Y/YWah+obEyn7yoDva/1Yhlnq20CMHlh3ifDfYYrS9rtp\nhdutz4fESKFPKymlG9aGfFuCME3GP8Rn8ZdPbsAWZ2cf388CLjlxEid1EU8klr2X\n+G1+3di/AgMBAAECggEAHL6UZ9+/5IMWpRZ8JUKgAjbwWo1rsQ7n0TfIgqLzBIfj\nd4bL6NigYnLHYdpOY2UrRG3/T+5gM9mwOfPiBCJ85AAwXI+/hIAMDjF4yqKiVETl\n8oCRRF01uCkTjnSFkyQcJukJKsYf918+hdqq5v1pJK6DXGJbrsWdj78XRPvNKPPD\naEEvSNwdet12Jz9wkmj2g7zg8KMX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snprintf(NULL, 0, "%s", pkey);
74+
encoded = malloc(sizeof(char) * 343);
75+
signtoken("eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImtpZCI6IjY2NzI2NTY1NzM3NzY5NzQ2MzY4MkQ2NzYzNzMifQ.eyJpYXQiOiIxNjE1NDAyNTEzIiwiZXhwIjoiMTYxNTQwNjExMyIsImlzcyI6Imdjc0BmcmVlc3dpdGNoLmNvbSIsImF1ZCI6Imh0dHBzOi8vYWNjb3VudHMuZ29vZ2xlLmNvbS9vL29hdXRoMi90b2tlbiIsInNjb3BlIjoiaHR0cHM6Ly93d3cuZ29vZ2xlYXBpcy5jb20vYXV0aC9kZXZzdG9yYWdlLmZ1bGxfY29udHJvbCBodHRwczovL3d3dy5nb29nbGVhcGlzLmNvbS9hdXRoL2RldnN0b3JhZ2UucmVhZF9vbmx5IGh0dHBzOi8vd3d3Lmdvb2dsZWFwaXMuY29tL2F1dGgvZGV2c3RvcmFnZS5yZWFkX3dyaXRlIn0", tlength, pkey, encoded);
76+
fst_check_string_equals("iSNfnz8gn1q8cYUrs7+m3hhXRalFRemt9SXvlnrzr1tyYx2ztL0m/882jghpsHMDVcti59avBjamcbrwMRDah7KXomu2cuCEwuYaGo6C7KTe9WZf+J0ep2shOAJJwnDKvUfuyVT21EEf/rWXfy8lblsq/YK0D7982FsXUgPDFU5NzPiw2fWk6YEPWbET3Yy+gJiTqYj5P0Fo1s66LNrLIX1RbH6/GW7d+lDl2RNMCZxGTtEygLdAXj+l0OPQG4Qvfzeymi9zWEq6j0rAChT0OppjZKqWf9IjMRbPUbuwIpNmgntfU7OcYtTFeiLy+W9fFutXEbSrq72MxMOrDEWWhQ", encoded);
77+
free(encoded);
78+
}
79+
FST_TEST_END()
80+
81+
FST_TEST_BEGIN(parse_xml_config_with_gcs)
82+
{
83+
switch_xml_t cfg, profiles, profile, gcs_profile;
84+
http_profile_t http_profile;
85+
int fd;
86+
int i = 0;
87+
88+
89+
fd = open("test_gcs_http_cache.conf.xml", O_RDONLY);
90+
if (fd < 0) {
91+
//printf("Open in test dir\n");
92+
fd = open("test/parse_xml_config_with_gcs", O_RDONLY);
93+
}
94+
fst_check(fd > 0);
95+
96+
cfg = switch_xml_parse_fd(fd);
97+
fst_check(cfg != NULL);
98+
99+
profiles = switch_xml_child(cfg, "profiles");
100+
fst_check(profiles);
101+
102+
for (profile = switch_xml_child(profiles, "profile"); profile; profile = profile->next) {
103+
const char *name = NULL;
104+
switch_memory_pool_t *pool;
105+
switch_core_new_memory_pool(&pool);
106+
i++;
107+
108+
fst_check(profile);
109+
110+
name = switch_xml_attr_soft(profile, "name");
111+
fst_check(name);
112+
113+
http_profile.name = name;
114+
http_profile.aws_s3_access_key_id = NULL;
115+
http_profile.secret_access_key = NULL;
116+
http_profile.base_domain = NULL;
117+
http_profile.region = NULL;
118+
119+
gcs_profile = switch_xml_child(profile, "gcs");
120+
gcs_config_profile(gcs_profile, &http_profile, pool);
121+
//aws_s3_access_key_id, secret_access_key, gcs_email, region
122+
fst_check(!zstr(http_profile.region));
123+
fst_check(!zstr(http_profile.aws_s3_access_key_id));
124+
fst_check(!zstr(http_profile.secret_access_key));
125+
switch_safe_free(http_profile.region);
126+
switch_safe_free(http_profile.aws_s3_access_key_id);
127+
switch_safe_free(http_profile.secret_access_key);
128+
switch_safe_free(http_profile.base_domain);
129+
}
130+
131+
fst_check(i == 1); // test data contain two config
132+
133+
switch_xml_free(cfg);
134+
}
135+
FST_TEST_END()
136+
137+
#endif
138+
139+
}
140+
FST_SUITE_END()
141+
142+
}
143+
FST_END()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"type": "service_account",
3+
"project_id": "freeswitch-gcs",
4+
"private_key_id": "667265657377697463682D676373",
5+
"private_key": "-----BEGIN PRIVATE KEY-----\nMIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCXiVOV3h61llym\nnpHamUHsuVjrdDiEQn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6JNX7/Bp2PiNktEVx8e1UF\nbNrFsj388Y4v7OVo5VQOhfCIlHmckeI0lXt42dboEivC7ydiUjvmzmZmUUcKA1yQ\nvcgZaaNEBoSoqaInR4IVnsJFZiXoR+qvJqlo7j8lXbYgulfLaw8Iv+y4xQKBgGK6\no6eq2urWajy8UJE9DjMOdQQLqWanSu0kMkZiPJk3OnROGwosH48n4qAKlfEOBDPh\nAvsvbWmt3FfU3ptfphmwqcrvMqAzTzbLm2txfVrPn+RyakViAt4cm+cnmQSP19un\nfHQG6SktHeJ0FhPai5PNQ4QIAyZeJdP8mGPBm5XBAoGBAJWnXiapFMcHi3DgsVb4\n+ni8Qvs293OvsdjHlo2eent/Kwbrdytw/V8uhq9awJb1npdgVd54RrbZ+Jq4x19K\nt06Jz9/EAoLLfL+tqzpEiKvSLjdKpedPm1Cgfj0KTM+MqoSU0bv4gMssnM428luJ\nv5ptWjeaHoYpJzvGfGBouVCI\n-----END PRIVATE KEY-----\n",
6+
"client_email": "[email protected]",
7+
"client_id": "105862293685176461395",
8+
"auth_uri": "https://accounts.google.com/o/oauth2/auth",
9+
"token_uri": "https://accounts.google.com/o/oauth2/token",
10+
"auth_provider_x509_cert_url": "https://www.googleapis.com/oauth2/v1/certs",
11+
"client_x509_cert_url": "https://www.googleapis.com/robot/v1/metadata/x509/gcs%40freeswitch.com"
12+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<configuration name="http_cache.conf" description="HTTP GET cache">
2+
<settings>
3+
<!-- set to true if you want to enable http:// and https:// formats. Do not use if mod_httapi is also loaded -->
4+
<param name="enable-file-formats" value="true"/>
5+
<param name="max-urls" value="10000"/>
6+
<param name="location" value="$${cache_dir}"/>
7+
<param name="default-max-age" value="86400"/>
8+
<param name="prefetch-thread-count" value="8"/>
9+
<param name="prefetch-queue-size" value="100"/>
10+
<!-- absolute path to CA bundle file -->
11+
<param name="ssl-cacert" value="$${certs_dir}/cacert.pem"/>
12+
<!-- verify certificates -->
13+
<param name="ssl-verifypeer" value="true"/>
14+
<!-- verify host name matches certificate -->
15+
<param name="ssl-verifyhost" value="true"/>
16+
<!-- default is 300 seconds, override here -->
17+
<!--param name="connect-timeout" value="300"/-->
18+
<!-- default is 300 seconds, override here -->
19+
<!--param name="download-timeout" value="300"/-->
20+
</settings>
21+
<profiles>
22+
<!-- amazon s3 security credentials -->
23+
<profile name="gcs">
24+
<!-- optional list of domains that this profile will automatically be applied to -->
25+
<!-- if you wish to apply the s3 credentials to a domain not listed here, then use
26+
{profile=s3}http://foo.s3... -->
27+
<domains>
28+
<!-- FORMAT https://<bucket>.storage.googleapis.com -->
29+
<domain name="dyl1.storage.googleapis.com"/>
30+
</domains>
31+
<credential_file>test_gcs.json</credential_file>
32+
</profile>
33+
</profiles>
34+
</configuration>

0 commit comments

Comments
 (0)