mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-15 03:41:28 +00:00
review update fixes
This commit is contained in:
@@ -89,7 +89,7 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
tokenQueryKey: get(collectionAuth, 'oauth2.tokenQueryKey'),
|
||||
autoFetchToken: get(collectionAuth, 'oauth2.autoFetchToken'),
|
||||
autoRefreshToken: get(collectionAuth, 'oauth2.autoRefreshToken'),
|
||||
additionalParameters: get(collectionAuth, 'auth.oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
additionalParameters: get(collectionAuth, 'oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
};
|
||||
break;
|
||||
case 'authorization_code':
|
||||
@@ -111,7 +111,7 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
tokenQueryKey: get(collectionAuth, 'oauth2.tokenQueryKey'),
|
||||
autoFetchToken: get(collectionAuth, 'oauth2.autoFetchToken'),
|
||||
autoRefreshToken: get(collectionAuth, 'oauth2.autoRefreshToken'),
|
||||
additionalParameters: get(collectionAuth, 'auth.oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
additionalParameters: get(collectionAuth, 'oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
};
|
||||
break;
|
||||
case 'implicit':
|
||||
@@ -145,7 +145,7 @@ const setAuthHeaders = (axiosRequest, request, collectionRoot) => {
|
||||
tokenQueryKey: get(collectionAuth, 'oauth2.tokenQueryKey'),
|
||||
autoFetchToken: get(collectionAuth, 'oauth2.autoFetchToken'),
|
||||
autoRefreshToken: get(collectionAuth, 'oauth2.autoRefreshToken'),
|
||||
additionalParameters: get(collectionAuth, 'auth.oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
additionalParameters: get(collectionAuth, 'oauth2.additionalParameters', { authorization: [], token: [], refresh: [] })
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -243,7 +243,7 @@ const getOAuth2TokenUsingAuthorizationCode = async ({ request, collectionUid, fo
|
||||
}
|
||||
|
||||
// Fetch new token process
|
||||
const { authorizationCode, debugInfo } = await getOAuth2AuthorizationCode(requestCopy, codeChallenge, collectionUid);
|
||||
let { authorizationCode, debugInfo } = await getOAuth2AuthorizationCode(requestCopy, codeChallenge, collectionUid);
|
||||
|
||||
let axiosRequestConfig = {};
|
||||
axiosRequestConfig.method = 'POST';
|
||||
@@ -716,7 +716,7 @@ const applyAdditionalParameters = (requestCopy, data, params = []) => {
|
||||
// For query params, add to URL
|
||||
try {
|
||||
let url = new URL(requestCopy.url);
|
||||
url.searchParams.append(param.name, param.value);
|
||||
url.searchParams.append(param.name, param.value || '');
|
||||
requestCopy.url = url.href;
|
||||
}
|
||||
catch (error) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const { getOauth2AdditionalParameters } = require('../utils/oauth2-additional-params');
|
||||
const { bruRequestToJson, bruCollectionToJson } = require('../index');
|
||||
const { clientCredentialsBruJson, authorizationCodeBruJson, passwordCredentialsBruJson, implicitBruJson, getBruJsonWithAdditionalParams } = require('./fixtures/oauth2-additional-params');
|
||||
const { getBruJsonWithAdditionalParams } = require('./fixtures/oauth2-additional-params');
|
||||
|
||||
describe('getOauth2AdditionalParameters', () => {
|
||||
it('authorization_code', () => {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const ohm = require('ohm-js');
|
||||
const _ = require('lodash');
|
||||
const { safeParseJson, outdentString, mergeOauth2AdditionalParameters } = require('./utils');
|
||||
const { safeParseJson, outdentString } = require('./utils');
|
||||
|
||||
/**
|
||||
* A Bru file is made up of blocks.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
const ohm = require('ohm-js');
|
||||
const _ = require('lodash');
|
||||
const { safeParseJson, outdentString, mergeOauth2AdditionalParameters } = require('./utils');
|
||||
const { safeParseJson, outdentString } = require('./utils');
|
||||
|
||||
const grammar = ohm.grammar(`Bru {
|
||||
BruFile = (meta | query | headers | auth | auths | vars | script | tests | docs | authOAuth2Configs)*
|
||||
|
||||
Reference in New Issue
Block a user