Skip to content

Commit 132e2b1

Browse files
committed
remove revoked Google API key from defualt SearchProvider configs; update testing workflows
1 parent 2fb566e commit 132e2b1

File tree

5 files changed

+113
-20
lines changed

5 files changed

+113
-20
lines changed

.github/workflows/qa-suite.yml

+31
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,37 @@ jobs:
4646
python swirl.py start
4747
env:
4848
ALLOWED_HOSTS: localhost,host.docker.internal
49+
- name: PATCH the Web PSE Config
50+
env:
51+
JSON: ${{ secrets.QA_PSE_WEB }}
52+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/1/
53+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
54+
run: |
55+
sleep 15
56+
curl -X PATCH "$API_ENDPOINT" \
57+
-u admin:"$PASSWORD" \
58+
-H "Content-Type: application/json" \
59+
-d "$JSON"
60+
- name: PATCH the LinkedIn PSE Config
61+
env:
62+
JSON: ${{ secrets.QA_PSE_LINKEDIN }}
63+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/3/
64+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
65+
run: |
66+
curl -X PATCH "$API_ENDPOINT" \
67+
-u admin:"$PASSWORD" \
68+
-H "Content-Type: application/json" \
69+
-d "$JSON"
70+
- name: PATCH the SWIRL Docs PSE Config
71+
env:
72+
JSON: ${{ secrets.QA_PSE_DOCS }}
73+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/4/
74+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
75+
run: |
76+
curl -X PATCH "$API_ENDPOINT" \
77+
-u admin:"$PASSWORD" \
78+
-H "Content-Type: application/json" \
79+
-d "$JSON"
4980
- name: Decode BigQuery token and create JSON file
5081
run: |
5182
echo "$BIGQUERY_TOKEN_BASE64" | base64 --decode > "${{ github.workspace }}/token.json"

.github/workflows/test-build-pipeline.yml

+31
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,37 @@ jobs:
143143
python swirl.py start
144144
env:
145145
ALLOWED_HOSTS: localhost,host.docker.internal
146+
- name: PATCH the Web PSE Config
147+
env:
148+
JSON: ${{ secrets.QA_PSE_WEB }}
149+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/1/
150+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
151+
run: |
152+
sleep 15
153+
curl -X PATCH "$API_ENDPOINT" \
154+
-u admin:"$PASSWORD" \
155+
-H "Content-Type: application/json" \
156+
-d "$JSON"
157+
- name: PATCH the LinkedIn PSE Config
158+
env:
159+
JSON: ${{ secrets.QA_PSE_LINKEDIN }}
160+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/3/
161+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
162+
run: |
163+
curl -X PATCH "$API_ENDPOINT" \
164+
-u admin:"$PASSWORD" \
165+
-H "Content-Type: application/json" \
166+
-d "$JSON"
167+
- name: PATCH the SWIRL Docs PSE Config
168+
env:
169+
JSON: ${{ secrets.QA_PSE_DOCS }}
170+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/4/
171+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
172+
run: |
173+
curl -X PATCH "$API_ENDPOINT" \
174+
-u admin:"$PASSWORD" \
175+
-H "Content-Type: application/json" \
176+
-d "$JSON"
146177
- name: Decode BigQuery token and create JSON file
147178
run: |
148179
echo "$BIGQUERY_TOKEN_BASE64" | base64 --decode > "${{ github.workspace }}/token.json"

.github/workflows/testing-wip.yml

+31
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,37 @@ jobs:
5959
python swirl.py start
6060
env:
6161
ALLOWED_HOSTS: localhost,host.docker.internal
62+
- name: PATCH the Web PSE Config
63+
env:
64+
JSON: ${{ secrets.QA_PSE_WEB }}
65+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/1/
66+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
67+
run: |
68+
sleep 15
69+
curl -X PATCH "$API_ENDPOINT" \
70+
-u admin:"$PASSWORD" \
71+
-H "Content-Type: application/json" \
72+
-d "$JSON"
73+
- name: PATCH the LinkedIn PSE Config
74+
env:
75+
JSON: ${{ secrets.QA_PSE_LINKEDIN }}
76+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/3/
77+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
78+
run: |
79+
curl -X PATCH "$API_ENDPOINT" \
80+
-u admin:"$PASSWORD" \
81+
-H "Content-Type: application/json" \
82+
-d "$JSON"
83+
- name: PATCH the SWIRL Docs PSE Config
84+
env:
85+
JSON: ${{ secrets.QA_PSE_DOCS }}
86+
API_ENDPOINT: http://localhost:8000/swirl/searchproviders/4/
87+
PASSWORD: ${{ secrets.QA_ADMIN_PW }}
88+
run: |
89+
curl -X PATCH "$API_ENDPOINT" \
90+
-u admin:"$PASSWORD" \
91+
-H "Content-Type: application/json" \
92+
-d "$JSON"
6293
- name: Decode BigQuery token and create JSON file
6394
run: |
6495
echo "$BIGQUERY_TOKEN_BASE64" | base64 --decode > "${{ github.workspace }}/token.json"

SearchProviders/google.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
33
"name": "Google Web - pse.google.com",
4-
"active": true,
5-
"default": true,
4+
"active": false,
5+
"default": false,
66
"connector": "RequestsGet",
77
"url": "https://www.googleapis.com/customsearch/v1",
88
"query_template": "{url}?cx={cx}&key={key}&q={query_string}",
@@ -33,15 +33,15 @@
3333
"query_processors": [
3434
"AdaptiveQueryProcessor"
3535
],
36-
"query_mappings": "cx=7d473806dcdde5bc6,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
36+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
3737
"result_processors": [
3838
"MappingResultProcessor",
3939
"DateFinderResultProcessor",
4040
"CosineRelevancyResultProcessor"
4141
],
4242
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
4343
"result_mappings": "url=link,body=snippet,author=displayLink,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].['og:site_name'],pagemap.metatags[*].['og:description'],NO_PAYLOAD",
44-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
44+
"credentials": "key=<your-Google-API-key>",
4545
"tags": [
4646
"Web", "WWW", "Google"
4747
]
@@ -87,7 +87,7 @@
8787
"query_processors": [
8888
"AdaptiveQueryProcessor"
8989
],
90-
"query_mappings": "cx=333906f8f74144c5c,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
90+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
9191
"result_grouping_field": "",
9292
"result_processors": [
9393
"MappingResultProcessor",
@@ -98,7 +98,7 @@
9898
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
9999
"result_mappings": "title= htmlTitle,url=link,body=snippet,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].locale,pagemap.metatags[*].['og:image'],NO_PAYLOAD",
100100
"results_per_query": 10,
101-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
101+
"credentials": "key=<your-Google-API-key>",
102102
"eval_credentials": "",
103103
"tags": [
104104
"LinkedIn",
@@ -107,8 +107,8 @@
107107
},
108108
{
109109
"name": "Swirl Documentation - docs.swirlaiconnect.com",
110-
"active": true,
111-
"default": true,
110+
"active": false,
111+
"default": false,
112112
"connector": "RequestsGet",
113113
"url": "https://www.googleapis.com/customsearch/v1",
114114
"query_template": "{url}?cx={cx}&key={key}&q={query_string}",
@@ -139,7 +139,7 @@
139139
"query_processors": [
140140
"AdaptiveQueryProcessor"
141141
],
142-
"query_mappings": "cx=f047885d9696f447c,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
142+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
143143
"result_grouping_field": "",
144144
"result_processors": [
145145
"MappingResultProcessor",
@@ -149,7 +149,7 @@
149149
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
150150
"result_mappings": "title=title,url=link,body=snippet,author=displayLink,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].['og:site_name'],pagemap.metatags[*].['og:description'],NO_PAYLOAD",
151151
"results_per_query": 10,
152-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
152+
"credentials": "key=<your-Google-API-key>",
153153
"eval_credentials": "",
154154
"tags": [
155155
"Swirl",

SearchProviders/preloaded.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
22
{
33
"name": "Google Web - pse.google.com",
4-
"active": true,
5-
"default": true,
4+
"active": false,
5+
"default": false,
66
"connector": "RequestsGet",
77
"url": "https://www.googleapis.com/customsearch/v1",
88
"query_template": "{url}?cx={cx}&key={key}&q={query_string}",
@@ -33,7 +33,7 @@
3333
"query_processors": [
3434
"AdaptiveQueryProcessor"
3535
],
36-
"query_mappings": "cx=7d473806dcdde5bc6,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
36+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
3737
"result_processors": [
3838
"MappingResultProcessor",
3939
"DateFinderResultProcessor",
@@ -42,7 +42,7 @@
4242
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
4343
"result_mappings": "url=link,body=snippet,author=displayLink,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].['og:site_name'],pagemap.metatags[*].['og:description'],NO_PAYLOAD",
4444
"results_per_query": 10,
45-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
45+
"credentials": "key=<your-Google-API-key>",
4646
"tags": [
4747
"Google",
4848
"Web",
@@ -90,7 +90,7 @@
9090
"query_processors": [
9191
"AdaptiveQueryProcessor"
9292
],
93-
"query_mappings": "cx=333906f8f74144c5c,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
93+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
9494
"result_grouping_field": "",
9595
"result_processors": [
9696
"MappingResultProcessor",
@@ -101,7 +101,7 @@
101101
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
102102
"result_mappings": "title= htmlTitle,url=link,body=snippet,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].locale,pagemap.metatags[*].['og:image'],NO_PAYLOAD",
103103
"results_per_query": 10,
104-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
104+
"credentials": "key=<your-Google-API-key>",
105105
"eval_credentials": "",
106106
"tags": [
107107
"LinkedIn",
@@ -110,8 +110,8 @@
110110
},
111111
{
112112
"name": "Swirl Documentation - docs.swirlaiconnect.com",
113-
"active": true,
114-
"default": true,
113+
"active": false,
114+
"default": false,
115115
"connector": "RequestsGet",
116116
"url": "https://www.googleapis.com/customsearch/v1",
117117
"query_template": "{url}?cx={cx}&key={key}&q={query_string}",
@@ -142,7 +142,7 @@
142142
"query_processors": [
143143
"AdaptiveQueryProcessor"
144144
],
145-
"query_mappings": "cx=f047885d9696f447c,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
145+
"query_mappings": "cx=<your-Google-PSE-code>,DATE_SORT=sort=date,PAGE=start=RESULT_INDEX,NOT_CHAR=-",
146146
"result_grouping_field": "",
147147
"result_processors": [
148148
"MappingResultProcessor",
@@ -152,7 +152,7 @@
152152
"response_mappings": "FOUND=searchInformation.totalResults,RETRIEVED=queries.request[0].count,RESULTS=items",
153153
"result_mappings": "title=title,url=link,body=snippet,author=displayLink,cacheId,pagemap.metatags[*].['og:type'],pagemap.metatags[*].['og:site_name'],pagemap.metatags[*].['og:description'],NO_PAYLOAD",
154154
"results_per_query": 10,
155-
"credentials": "key=AIzaSyDvVeE-L6nCC9u-TTGuhggvSmzhtiTHJsA",
155+
"credentials": "key=<your-Google-API-key>",
156156
"eval_credentials": "",
157157
"tags": [
158158
"Swirl",

0 commit comments

Comments
 (0)