CLI fixes for aws and environment modifications (#1713)

* Interpolate awsv4 values to support them including templated values.

Closes #1508

* change to let to allow for rewrite; rename to envVariables for consistency

* When running via CLI, preserve changes to collection variables and
environment variables.

Closes #1255

* Closes #1255 - set well known variable name on environment

* Revert "When running via CLI, preserve changes to collection variables and"

This reverts commit 7c94c9ec19.

* Revert "change to let to allow for rewrite; rename to envVariables for consistency"

This reverts commit 9320b8faf0.

---------

Co-authored-by: Scott LaPlante <scott.laplante@flueid.com>
This commit is contained in:
Scott LaPlante 2024-03-12 13:50:37 -04:00 committed by GitHub
parent e6090a4d59
commit 3ee76067fb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -288,6 +288,7 @@ const handler = async function (argv) {
const envBruContent = fs.readFileSync(envFile, 'utf8');
const envJson = bruToEnvJson(envBruContent);
envVars = getEnvVars(envJson);
envVars.__name__ = env;
}
if (envVar) {

View File

@ -109,7 +109,16 @@ const interpolateVars = (request, envVars = {}, collectionVariables = {}, proces
delete request.auth;
}
return request;
if (request.awsv4config) {
request.awsv4config.accessKeyId = _interpolate(request.awsv4config.accessKeyId) || '';
request.awsv4config.secretAccessKey = _interpolate(request.awsv4config.secretAccessKey) || '';
request.awsv4config.sessionToken = _interpolate(request.awsv4config.sessionToken) || '';
request.awsv4config.service = _interpolate(request.awsv4config.service) || '';
request.awsv4config.region = _interpolate(request.awsv4config.region) || '';
request.awsv4config.profileName = _interpolate(request.awsv4config.profileName) || '';
}
if (request) return request;
};
module.exports = interpolateVars;