Skip to content

Commit 414ebff

Browse files
committed
try using x-headers
1 parent 2faec3f commit 414ebff

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

run/idp-sql/test/e2e_test_setup.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ steps:
5858
- |
5959
./test/retry.sh "gcloud run deploy ${_SERVICE} \
6060
--image gcr.io/${PROJECT_ID}/${_SERVICE}:${_VERSION} \
61-
--allow-unauthenticated \
61+
--no-allow-unauthenticated \
6262
--region ${_REGION} \
6363
--service-account ${_SERVICE_ACCOUNT} \
6464
--add-cloudsql-instances ${_CLOUD_SQL_CONNECTION_NAME} \

run/idp-sql/test/system.test.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,12 @@ describe('System Tests', () => {
5454
throw Error('"IDP_KEY" env var not found.');
5555
}
5656

57+
// Get ID token for the authentication part
58+
const {ID_TOKEN} = process.env;
59+
if (!ID_TOKEN) {
60+
throw Error('"ID_TOKEN" env var not found.');
61+
}
62+
5763
let BASE_URL, CUSTOM_TOKEN;
5864
before(async () => {
5965
// Deploy service using Cloud Build
@@ -142,6 +148,7 @@ describe('System Tests', () => {
142148
form: {team: 'DOGS'},
143149
headers: {
144150
Authorization: `Bearer ${CUSTOM_TOKEN.trim()}`,
151+
"X-Serverless-Authorization": `Bearer ${ID_TOKEN}`
145152
},
146153
retry: {
147154
limit: 5,
@@ -167,6 +174,7 @@ describe('System Tests', () => {
167174
form: {team: 'DOGS'},
168175
headers: {
169176
Authorization: 'Bearer iam-a-token',
177+
"X-Serverless-Authorization": `Bearer ${ID_TOKEN}`
170178
},
171179
retry: {
172180
limit: 5,

0 commit comments

Comments
 (0)