Skip to content

Conversation

azdagron
Copy link
Member

Recent changes to the plugin config parsing code required to enable deterministic plugin ordering were too restrictive on the shapes of plugin configuration, causing some previously-allowed configurations to become invalid.

This PR changes parsing code to be more flexible when determining order. It walks the AST and builds up a stack of ast nodes until it has enough object key's in the stack to determine the plugin type and name.

The actual config parsing is then done separately using the more or less the same config shape as before, changing to a list of maps of maps to accomodate the way HCL parses into the AST.

Recent changes to the plugin config parsing code required to enable
deterministic plugin ordering were too restrictive on the shapes of
plugin configuration, causing some previously-allowed configurations to
become invalid.

This PR changes parsing code to be more flexible when determining order.
It walks the AST and builds up a stack of ast nodes until it has enough
object key's in the stack to determine the plugin type and name.

The actual config parsing is then done separately using the more or less
the same config shape as before, changing to a list of maps of maps to
accomodate the way HCL parses into the AST.

Signed-off-by: Andrew Harding <[email protected]>
@azdagron azdagron force-pushed the fix-plugin-config-parsing branch from 1518bdd to fadfc20 Compare March 20, 2023 14:16
Copy link
Collaborator

@MarcosDY MarcosDY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rturner3 rturner3 merged commit 3c1c7f2 into spiffe:main Mar 21, 2023
@azdagron azdagron deleted the fix-plugin-config-parsing branch March 21, 2023 01:56
@rturner3 rturner3 added this to the 1.6.2 milestone Mar 24, 2023
@amartinezfayo amartinezfayo modified the milestones: 1.6.2, 1.6.3 Apr 5, 2023
Basavaraju-G pushed a commit to Basavaraju-G/spire that referenced this pull request May 3, 2023
Recent changes to the plugin config parsing code required to enable
deterministic plugin ordering were too restrictive on the shapes of
plugin configuration, causing some previously-allowed configurations to
become invalid.

This PR changes parsing code to be more flexible when determining order.
It walks the AST and builds up a stack of ast nodes until it has enough
object key's in the stack to determine the plugin type and name.

The actual config parsing is then done separately using the more or less
the same config shape as before, changing to a list of maps of maps to
accomodate the way HCL parses into the AST.

Signed-off-by: Andrew Harding <[email protected]>
Signed-off-by: Basavaraju-G <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants