Provide support to add named configs map for authenticators#4363
Provide support to add named configs map for authenticators#4363sahandilshan wants to merge 3 commits intowso2:4.10.xfrom
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for named configuration maps in authenticators, allowing configurations to be organized in named groups rather than just flat parameter maps. This enables more structured configuration management for authenticators while maintaining backward compatibility with existing flat parameter configurations.
Key changes:
- Introduces a nested parameter map structure alongside the existing flat parameter map
- Adds processing logic to handle both named and unnamed configuration elements
- Provides new getter methods to access named configurations
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
|
||
| // Only process configs that have an explicit name attribute. | ||
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ |
|
|
||
| // Only process configs that have an explicit name attribute. | ||
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ |
There was a problem hiding this comment.
It unclear what are we trying to achieve here.
There was a problem hiding this comment.
Currently we can have define as below
<Config>
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
With this new config we are providing the support to define named config along with the previous support. so now we can have something like this
<Config>
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
<Config name="configName">
<Parameter name="name01">value01</Parameter>
<Parameter name="name02">value02</Parameter>
</Config>
| OMAttribute configNameAttr = configElement.getAttribute(new QName(ATTR_NAME)); | ||
| if(configNameAttr == null){ | ||
| // Skip configs without name attribute - process parameters for flat map only. | ||
| for(Iterator paramIterator = configElement.getChildrenWithLocalName(ELEM_PARAMETER); |
There was a problem hiding this comment.
Can we avoid iterating the elements twice?
Purpose
$subject
With this new support we can define new configurations for Authenticators as below.