You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The utility loadSharedConfigFiles incorrecly prefix keys when previous key has an empty value.
In the example below, in latest version, the region key is incorrectly prefixed with cli_pager.
Steps to reproduce
// test.mjsimport{tmpdir}from"os";import{mkdtemp,rm,writeFile}from"fs/promises";import{loadSharedConfigFiles}from"@smithy/shared-ini-file-loader";consttempDir=awaitmkdtemp(tmpdir());constfilepath=`${tempDir}/credentials`;awaitwriteFile(filepath,``);constconfigFilepath=`${tempDir}/config`;awaitwriteFile(configFilepath,`[profile dev]cli_pager= region = us-east-2`);constsharedConfigFiles=awaitloadSharedConfigFiles({
filepath,
configFilepath,});console.log(JSON.stringify(sharedConfigFiles,null,2));awaitrm(tempDir,{recursive: true});
As per the SDK reference for file-format, the subsections appears after the main section. And that's how the JS SDK v3 currently reads the configuration.
A workaround will be to move region above subsection as follows:
[profile dev]region = us-east-2cli_pager=
In the meantime, I'll investigate if we can read values after subsections.
@trivikr yes the documentation specify that subsettings should have one or many spaces before. That is workly perfectly with AWS CLI and JS SDK until v2.0.12
I'm rather waiting for a new release instead of using the workaround : it may be costly to identify all the files to be updated, and in some situation I may not have the required permission to update them promptly.
Describe the bug
The utility
loadSharedConfigFiles
incorrecly prefix keys when previous key has an empty value.In the example below, in latest version, the
region
key is incorrectly prefixed withcli_pager.
Steps to reproduce
Observed behavior
v2.0.12 ✅ correct behavior
v2.0.13 ❌ incorrect behavior
v2.1.0 and v2.2.0 ❌ incorrect behavior
Additional context
The regression comes from 60e88af (#986) and then from aa86b3f (#989)
The text was updated successfully, but these errors were encountered: