Skip to content

Commit

Permalink
chore: code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 committed Mar 12, 2024
1 parent d318567 commit 74bc4bc
Show file tree
Hide file tree
Showing 2 changed files with 121 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,48 @@ export const v0oauthScenarios = [
},
},
},
{
id: 'gaoc_v0_oauth_scenario_2',
name: 'google_adwords_offline_conversions',
description:
'[Proxy v0 API] :: Oauth where ACCESS_TOKEN_SCOPE_INSUFFICIENT error as mock response from destination',
successCriteria:
'Since the error from the destination is 403 - the proxy should return 403 with authErrorCategory as AUTH_STATUS_INACTIVE',
scenario: 'Oauth',
feature: 'dataDelivery',
module: 'destination',
version: 'v0',
input: {
request: {
body: generateProxyV0Payload({
...commonRequestParameters,
endpoint: 'https://googleads.googleapis.com/v14/customers/1234/offlineUserDataJobs',
}),
method: 'POST',
},
},
output: {
response: {
status: 403,
body: {
output: {
authErrorCategory: 'AUTH_STATUS_INACTIVE',
destinationResponse: {
error: {
code: 403,
message: 'Request had insufficient authentication scopes',
status: 'PERMISSION_DENIED',
},
},
message:
'[Google Ads Offline Conversions]:: Request had insufficient authentication scopes during google_ads_offline_store_conversions Job Creation',
statTags: expectedStatTags,
status: 403,
},
},
},
},
},
];

export const v1oauthScenarios = [
Expand Down Expand Up @@ -172,4 +214,50 @@ export const v1oauthScenarios = [
},
},
},
{
id: 'gaoc_v1_oauth_scenario_2',
name: 'google_adwords_offline_conversions',
description:
'[Proxy v1 API] :: Oauth where ACCESS_TOKEN_SCOPE_INSUFFICIENT error as mock response from destination',
successCriteria:
'Since the error from the destination is 403 - the proxy should return 403 with authErrorCategory as AUTH_STATUS_INACTIVE',
scenario: 'Oauth',
feature: 'dataDelivery',
module: 'destination',
version: 'v1',
input: {
request: {
body: generateProxyV1Payload(
{
...commonRequestParameters,
endpoint: 'https://googleads.googleapis.com/v14/customers/1234/offlineUserDataJobs',
},
metadataArray,
),
method: 'POST',
},
},
output: {
response: {
status: 403,
body: {
output: {
authErrorCategory: 'AUTH_STATUS_INACTIVE',
message:
'[Google Ads Offline Conversions]:: Request had insufficient authentication scopes during google_ads_offline_store_conversions Job Creation',
response: [
{
error:
'[Google Ads Offline Conversions]:: Request had insufficient authentication scopes during google_ads_offline_store_conversions Job Creation',
metadata: generateMetadata(1),
statusCode: 403,
},
],
statTags: expectedStatTags,
status: 403,
},
},
},
},
},
];
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,39 @@ export const networkCallsData = [
},
},
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v14/customers/1234/offlineUserDataJobs:create',
data: {
job: {
storeSalesMetadata: {
custom_key: 'CUSTOM_KEY',
loyaltyFraction: 1,
transaction_upload_fraction: '1',
},
type: 'STORE_SALES_UPLOAD_FIRST_PARTY',
},
},
params: { destination: 'google_adwords_offline_conversion' },
headers: {
Authorization: 'Bearer abcd1234',
'Content-Type': 'application/json',
'developer-token': 'ijkl91011',
'login-customer-id': 'logincustomerid',
},
method: 'POST',
},
httpRes: {
status: 403,
data: {
error: {
code: 403,
message: 'Request had insufficient authentication scopes',
status: 'PERMISSION_DENIED',
},
},
},
},
{
httpReq: {
url: 'https://googleads.googleapis.com/v14/customers/1234567890/googleAds:searchStream',
Expand Down

0 comments on commit 74bc4bc

Please sign in to comment.