Skip to content

Commit

Permalink
fix an issue where sections were not properly divided when parsing th…
Browse files Browse the repository at this point in the history
…e config file (#1216)
  • Loading branch information
jeonghwan-jang authored Feb 21, 2024
1 parent 613df19 commit 4153e02
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/8e7992a3-5add-4fc4-987f-c8bd0c6ef405.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"id": "8e7992a3-5add-4fc4-987f-c8bd0c6ef405",
"type": "bugfix",
"description": "Fix an issue where sections were not properly divided when parsing the config file"
}
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ private fun mergeSections(tokenIndexMap: Map<Token.Section, Map<String, AwsConfi
when (entry.key.hasSectionPrefix) {
true -> true
false -> {
val prefixVariantExists = tokenIndexMap.keys.any { it.hasSectionPrefix && it.name == entry.key.name }
val prefixVariantExists = tokenIndexMap.keys.any { it.hasSectionPrefix && it.name == entry.key.name && it.type == entry.key.type }
!prefixVariantExists
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -819,6 +819,24 @@ internal const val parserTestSuiteJson = """
}
}
}
},
{
"name": "SSO Session in config file with same name as default profile",
"input": {
"configFile": "[default]\nname = profile-default\n[sso-session default]\nname = sso-session-default"
},
"output": {
"profiles": {
"default": {
"name": "profile-default"
}
},
"sso-sessions": {
"default": {
"name": "sso-session-default"
}
}
}
}
]
}
Expand Down

0 comments on commit 4153e02

Please sign in to comment.