Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 40 additions & 16 deletions src/api/BaseApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,11 @@ export function generateAmApi({
...headers,
...state.getAuthenticationHeaderOverrides(),
},
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
},
requestOverride
Expand Down Expand Up @@ -269,8 +272,11 @@ export function generateOauth2Api({
...headers,
...state.getAuthenticationHeaderOverrides(),
},
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
};

Expand Down Expand Up @@ -313,8 +319,11 @@ export function generateIdmApi({
Authorization: `Bearer ${state.getBearerToken()}`,
}),
},
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
},
requestOverride
Expand Down Expand Up @@ -358,8 +367,11 @@ export function generateLogKeysApi({
{
timeout,
headers,
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
},
requestOverride
Expand Down Expand Up @@ -401,8 +413,11 @@ export function generateLogApi({
// baseURL: getTenantURL(storage.session.getTenant()),
timeout,
headers,
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
},
requestOverride
Expand Down Expand Up @@ -452,8 +467,11 @@ export function generateEnvApi({
timeout,
headers,
...requestOverride,
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
};

Expand Down Expand Up @@ -500,8 +518,11 @@ export function generateGovernanceApi({
timeout,
headers,
...requestOverride,
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(state.getAllowInsecureConnection()),
}),
proxy: getProxy(),
};

Expand Down Expand Up @@ -541,8 +562,11 @@ export function generateReleaseApi({
'Content-Type': 'application/json',
},
...requestOverride,
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(false, false),
...(process.env.FRODO_MOCK !== 'record' &&
process.env.FRODO_POLLY_MODE !== 'record' && {
httpAgent: getHttpAgent(),
httpsAgent: getHttpsAgent(false, false),
}),
proxy: getProxy(),
};

Expand Down
Loading