Skip to content

Commit

Permalink
Merge branch 'master' into sam/25_01_16/fix/http-agent-keepalive
Browse files Browse the repository at this point in the history
  • Loading branch information
bodinsamuel authored Jan 17, 2025
2 parents d751861 + 8aba672 commit 9965203
Showing 1 changed file with 27 additions and 39 deletions.
66 changes: 27 additions & 39 deletions packages/shared/lib/services/proxy.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,52 +76,39 @@ class ProxyService {
let token;
switch (connection.credentials.type) {
case 'OAUTH2':
{
const credentials = connection.credentials;
token = credentials.access_token;
}
case 'APP': {
const credentials = connection.credentials;
token = credentials.access_token;
break;
case 'OAUTH1': {
const error = new Error('OAuth1 is not supported yet in the proxy.');
const nangoError = new NangoError('pass_through_error', error);
return { success: false, error: nangoError, response: null, logs };
}
case 'BASIC':
token = connection.credentials;
break;
case 'API_KEY':
token = connection.credentials;
break;
case 'APP':
{
const credentials = connection.credentials;
token = credentials.access_token;
}
break;
case 'OAUTH2_CC':
{
const credentials = connection.credentials;
token = credentials.token;
}
break;
case 'TWO_STEP':
case 'TABLEAU':
{
const credentials = connection.credentials;
token = credentials.token;
}
break;
case 'JWT':
{
const credentials = connection.credentials;
token = credentials.token;
}
case 'SIGNATURE': {
const credentials = connection.credentials;
token = credentials.token;
break;
case 'SIGNATURE':
{
const credentials = connection.credentials;
token = credentials.token;
}
}
case 'BASIC':
case 'API_KEY':
token = connection.credentials;
break;
case 'OAUTH1': {
const error = new Error('OAuth1 is not supported yet in the proxy.');
const nangoError = new NangoError('pass_through_error', error);
return { success: false, error: nangoError, response: null, logs };
}
case 'APP_STORE':
case 'CUSTOM':
case 'TBA':
case undefined:
case 'BILL': {
break;
}
default: {
throw new Error(`Unhandled connection.credentials for: ${(connection.credentials as any).type}`);
}
}

const provider = getProvider(providerName);
Expand Down Expand Up @@ -470,6 +457,7 @@ class ProxyService {
case 'API_KEY':
case 'OAUTH2_CC':
case 'TABLEAU':
case 'TWO_STEP':
case 'JWT':
if (value.includes('connectionConfig')) {
value = value.replace(/connectionConfig\./g, '');
Expand Down

0 comments on commit 9965203

Please sign in to comment.